Changeset 186791 in webkit
- Timestamp:
- Jul 13, 2015 3:51:15 PM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 12 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r186786 r186791 1 2015-07-13 Matt Rajca <mrajca@apple.com> 2 3 Media Session: add plumbing for delivering start/end-of-interruption events 4 https://bugs.webkit.org/show_bug.cgi?id=146837 5 6 Reviewed by Tim Horton. 7 8 * Modules/mediasession/MediaSessionEvents.h: Renamed from MediaEventTypes.h and added new constants for 9 interruption events. 10 * WebCore.xcodeproj/project.pbxproj: Renamed MediaEventTypes.h. 11 * page/Page.h: Added stub. 12 * page/Page.cpp: Added stub. 13 1 14 2015-07-13 Simon Fraser <simon.fraser@apple.com> 2 15 -
trunk/Source/WebCore/Modules/mediasession/MediaSessionEvents.h
r186786 r186791 24 24 */ 25 25 26 #ifndef Media EventTypes_h27 #define Media EventTypes_h26 #ifndef MediaSessionEvents_h 27 #define MediaSessionEvents_h 28 28 29 29 #if ENABLE(MEDIA_SESSION) … … 37 37 }; 38 38 39 enum MediaSessionInterruptionEvent { 40 StartOfInterruption, 41 EndOfInterruption 42 }; 43 44 enum MediaSessionInterruptingCategory { 45 Content, 46 Transient, 47 TransientSolo 48 }; 49 39 50 } 40 51 41 52 #endif 42 53 43 #endif /* Media EventTypes_h */54 #endif /* MediaSessionEvents_h */ -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r186608 r186791 5721 5721 C9D851F01B39DC780085062E /* MediaSessionMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = C9D851EE1B39DC780085062E /* MediaSessionMetadata.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5722 5722 C9DADBCB1B1D3B97001F17D8 /* JSMediaSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C9DADBC91B1D3B25001F17D8 /* JSMediaSession.cpp */; }; 5723 C9F87CFE1B28F40E00979B83 /* Media EventTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = C9F87CFD1B28E5F600979B83 /* MediaEventTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };5723 C9F87CFE1B28F40E00979B83 /* MediaSessionEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = C9F87CFD1B28E5F600979B83 /* MediaSessionEvents.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5724 5724 CA3BF67C10D99BAE00E6CE53 /* ScrollAnimator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CA3BF67B10D99BAE00E6CE53 /* ScrollAnimator.cpp */; }; 5725 5725 CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 13314 13314 C9DADBC91B1D3B25001F17D8 /* JSMediaSession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaSession.cpp; sourceTree = "<group>"; }; 13315 13315 C9DADBCA1B1D3B25001F17D8 /* JSMediaSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaSession.h; sourceTree = "<group>"; }; 13316 C9F87CFD1B28E5F600979B83 /* Media EventTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaEventTypes.h; sourceTree = "<group>"; };13316 C9F87CFD1B28E5F600979B83 /* MediaSessionEvents.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; path = MediaSessionEvents.h; sourceTree = "<group>"; }; 13317 13317 CA3BF67B10D99BAE00E6CE53 /* ScrollAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollAnimator.cpp; sourceTree = "<group>"; }; 13318 13318 CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAnimator.h; sourceTree = "<group>"; }; … … 14660 14660 C968B2E61B1E72F700EF1F81 /* HTMLMediaElementMediaSession.h */, 14661 14661 C968B2E51B1E704500EF1F81 /* HTMLMediaElementMediaSession.idl */, 14662 C9F87CFD1B28E5F600979B83 /* MediaEventTypes.h */,14663 14662 C90843CD1B18E47D00B68564 /* MediaRemoteControls.cpp */, 14664 14663 C90843CE1B18E47D00B68564 /* MediaRemoteControls.h */, … … 14667 14666 C9027F401B1D0AD200BFBFEF /* MediaSession.h */, 14668 14667 C9027F3E1B1D0AB900BFBFEF /* MediaSession.idl */, 14668 C9F87CFD1B28E5F600979B83 /* MediaSessionEvents.h */, 14669 14669 C90F65531B225396002163A1 /* MediaSessionManager.cpp */, 14670 14670 C90F65541B225396002163A1 /* MediaSessionManager.h */, … … 25905 25905 07FE99DD18807A7D00256648 /* MediaElementSession.h in Headers */, 25906 25906 E44613AD0CD6331000FADA75 /* MediaError.h in Headers */, 25907 C9F87CFE1B28F40E00979B83 /* MediaEventTypes.h in Headers */,25908 25907 4E1959220A39DABA00220FE5 /* MediaFeatureNames.h in Headers */, 25909 25908 07A6D1EC1491137700051D0C /* MediaFragmentURIParser.h in Headers */, … … 25933 25932 CDBEAEAD19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.h in Headers */, 25934 25933 C9027F421B1D0AD200BFBFEF /* MediaSession.h in Headers */, 25934 C9F87CFE1B28F40E00979B83 /* MediaSessionEvents.h in Headers */, 25935 25935 C90F65561B2253BE002163A1 /* MediaSessionManager.h in Headers */, 25936 25936 07638A991884487200E15A1B /* MediaSessionManagerIOS.h in Headers */, -
trunk/Source/WebCore/page/Page.cpp
r186392 r186791 58 58 #include "Navigator.h" 59 59 #include "NetworkStateNotifier.h" 60 #include "NotImplemented.h" 60 61 #include "PageCache.h" 61 62 #include "PageConfiguration.h" … … 1225 1226 } 1226 1227 } 1228 1229 void Page::handleMediaSessionInterruptionEvent(MediaSessionInterruptionEvent event, MediaSessionInterruptingCategory category) 1230 { 1231 notImplemented(); 1232 } 1227 1233 #endif 1228 1234 -
trunk/Source/WebCore/page/Page.h
r186392 r186791 56 56 57 57 #if ENABLE(MEDIA_SESSION) 58 #include "Media EventTypes.h"58 #include "MediaSessionEvents.h" 59 59 #endif 60 60 … … 443 443 #if ENABLE(MEDIA_SESSION) 444 444 WEBCORE_EXPORT void handleMediaEvent(MediaEventType); 445 WEBCORE_EXPORT void handleMediaSessionInterruptionEvent(MediaSessionInterruptionEvent, MediaSessionInterruptingCategory); 445 446 #endif 446 447 -
trunk/Source/WebKit2/ChangeLog
r186786 r186791 1 2015-07-13 Matt Rajca <mrajca@apple.com> 2 3 Media Session: add plumbing for delivering start/end-of-interruption events 4 https://bugs.webkit.org/show_bug.cgi?id=146837 5 6 Reviewed by Tim Horton. 7 8 * UIProcess/API/C/WKPage.cpp: 9 (WKPageHandleMediaSessionInterruptionEvent): 10 * UIProcess/API/C/WKPagePrivate.h: 11 * UIProcess/WebPageProxy.cpp: 12 (WebKit::WebPageProxy::handleMediaSessionInterruptionEvent): 13 * UIProcess/WebPageProxy.h: 14 * WebProcess/WebPage/WebPage.cpp: 15 (WebKit::WebPage::handleMediaSessionInterruptionEvent): 16 * WebProcess/WebPage/WebPage.h: 17 * WebProcess/WebPage/WebPage.messages.in: 18 1 19 2015-07-13 Simon Fraser <simon.fraser@apple.com> 2 20 -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r186538 r186791 82 82 #if ENABLE(MEDIA_SESSION) 83 83 #include "WebMediaSessionMetadata.h" 84 #include <WebCore/Media EventTypes.h>84 #include <WebCore/MediaSessionEvents.h> 85 85 #endif 86 86 … … 2190 2190 } 2191 2191 2192 #if ENABLE(MEDIA_SESSION) 2193 // NOTE: The values in the WKMediaSessionInterruptingCategory enum must stay in sync with those in WebCore::MediaSessionInterruptingCategory. 2194 COMPILE_ASSERT(MediaSessionInterruptingCategory::Content == static_cast<MediaSessionInterruptingCategory>(kWKMediaSessionInterruptingCategoryContent), MediaSessionInterruptingCategoryEnumContent_Is_Wrong_Should_Be_kWKMediaSessionInterruptingCategoryContent); 2195 COMPILE_ASSERT(MediaSessionInterruptingCategory::Transient == static_cast<MediaSessionInterruptingCategory>(kWKMediaSessionInterruptingCategoryTransient), MediaSessionInterruptingCategoryEnumTransient_Is_Wrong_Should_Be_kWKMediaSessionInterruptingCategoryTransient); 2196 COMPILE_ASSERT(MediaSessionInterruptingCategory::TransientSolo == static_cast<MediaSessionInterruptingCategory>(kWKMediaSessionInterruptingCategoryTransientSolo), MediaSessionInterruptingCategoryEnumTransientSolo_Is_Wrong_Should_Be_kWKMediaSessionInterruptingCategoryTransientSolo); 2197 2198 COMPILE_ASSERT(MediaSessionInterruptionEvent::StartOfInterruption == static_cast<MediaSessionInterruptionEvent>(kWKMediaSessionInterruptionEventStartOfInterruption), MediaSessionInterruptionEventEnumStartOfInterruption_Is_Wrong_Should_Be_kWKMediaSessionInterruptionEventStartOfInterruption); 2199 COMPILE_ASSERT(MediaSessionInterruptionEvent::EndOfInterruption == static_cast<MediaSessionInterruptionEvent>(kWKMediaSessionInterruptionEventEndOfInterruption), MediaSessionInterruptionEventEnumEndOfInterruption_Is_Wrong_Should_Be_kWKMediaSessionInterruptionEventEndOfInterruption); 2200 #endif 2201 2202 void WKPageHandleMediaSessionInterruptionEvent(WKPageRef page, WKMediaSessionInterruptionEvent wkEvent, WKMediaSessionInterruptingCategory wkCategory) 2203 { 2204 #if ENABLE(MEDIA_SESSION) 2205 MediaSessionInterruptingCategory category; 2206 2207 switch (wkCategory) { 2208 case kWKMediaSessionInterruptingCategoryContent: 2209 category = MediaSessionInterruptingCategory::Content; 2210 break; 2211 case kWKMediaSessionInterruptingCategoryTransient: 2212 category = MediaSessionInterruptingCategory::Transient; 2213 break; 2214 case kWKMediaSessionInterruptingCategoryTransientSolo: 2215 category = MediaSessionInterruptingCategory::TransientSolo; 2216 break; 2217 default: 2218 ASSERT_NOT_REACHED(); 2219 } 2220 2221 MediaSessionInterruptionEvent event; 2222 2223 switch (wkEvent) { 2224 case kWKMediaSessionInterruptionEventStartOfInterruption: 2225 event = MediaSessionInterruptionEvent::StartOfInterruption; 2226 break; 2227 case kWKMediaSessionInterruptionEventEndOfInterruption: 2228 event = MediaSessionInterruptionEvent::EndOfInterruption; 2229 break; 2230 default: 2231 ASSERT_NOT_REACHED(); 2232 } 2233 2234 toImpl(page)->handleMediaSessionInterruptionEvent(event, category); 2235 #else 2236 UNUSED_PARAM(page); 2237 UNUSED_PARAM(wkEvent); 2238 UNUSED_PARAM(wkCategory); 2239 #endif 2240 } 2241 2192 2242 void WKPagePostMessageToInjectedBundle(WKPageRef pageRef, WKStringRef messageNameRef, WKTypeRef messageBodyRef) 2193 2243 { -
trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h
r186538 r186791 119 119 typedef uint32_t WKMediaEventType; 120 120 121 enum { 122 kWKMediaSessionInterruptingCategoryContent, 123 kWKMediaSessionInterruptingCategoryTransient, 124 kWKMediaSessionInterruptingCategoryTransientSolo 125 }; 126 typedef uint32_t WKMediaSessionInterruptingCategory; 127 128 enum { 129 kWKMediaSessionInterruptionEventStartOfInterruption, 130 kWKMediaSessionInterruptionEventEndOfInterruption 131 }; 132 typedef uint32_t WKMediaSessionInterruptionEvent; 133 121 134 WK_EXPORT bool WKPageHasMediaSessionWithActiveMediaElements(WKPageRef page); 122 135 WK_EXPORT void WKPageHandleMediaEvent(WKPageRef page, WKMediaEventType event); 136 WK_EXPORT void WKPageHandleMediaSessionInterruptionEvent(WKPageRef page, WKMediaSessionInterruptionEvent event, WKMediaSessionInterruptingCategory category); 123 137 124 138 WK_EXPORT void WKPageLoadURLWithShouldOpenExternalURLsPolicy(WKPageRef page, WKURLRef url, bool shouldOpenExternalURLs); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r186712 r186791 3785 3785 m_process->send(Messages::WebPage::HandleMediaEvent(eventType), m_pageID); 3786 3786 } 3787 3788 void WebPageProxy::handleMediaSessionInterruptionEvent(MediaSessionInterruptionEvent event, MediaSessionInterruptingCategory category) 3789 { 3790 if (!isValid()) 3791 return; 3792 3793 m_process->send(Messages::WebPage::HandleMediaSessionInterruptionEvent(event, category), m_pageID); 3794 } 3787 3795 #endif 3788 3796 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r186712 r186791 943 943 bool hasMediaSessionWithActiveMediaElements() const { return m_hasMediaSessionWithActiveMediaElements; } 944 944 void handleMediaEvent(WebCore::MediaEventType); 945 void handleMediaSessionInterruptionEvent(WebCore::MediaSessionInterruptionEvent, WebCore::MediaSessionInterruptingCategory); 945 946 #endif 946 947 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r186786 r186791 4044 4044 m_page->handleMediaEvent(static_cast<MediaEventType>(eventType)); 4045 4045 } 4046 4047 void WebPage::handleMediaSessionInterruptionEvent(uint32_t event, uint32_t category) 4048 { 4049 m_page->handleMediaSessionInterruptionEvent(static_cast<MediaSessionInterruptionEvent>(event), static_cast<MediaSessionInterruptingCategory>(category)); 4050 } 4046 4051 #endif 4047 4052 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r186684 r186791 744 744 #if ENABLE(MEDIA_SESSION) 745 745 void handleMediaEvent(uint32_t /* WebCore::MediaEventType */); 746 void handleMediaSessionInterruptionEvent(uint32_t /* WebCore::MediaSessionInterruptionEvent */, uint32_t /* WebCore::MediaSessionInterruptingCategory */); 746 747 #endif 747 748 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r185878 r186791 315 315 #if ENABLE(MEDIA_SESSION) 316 316 HandleMediaEvent(uint32_t eventType) 317 HandleMediaSessionInterruptionEvent(uint32_t event, uint32_t interruptingCategory) 317 318 #endif 318 319
Note: See TracChangeset
for help on using the changeset viewer.