Changeset 185477 in webkit
- Timestamp:
- Jun 11, 2015 2:49:49 PM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r185472 r185477 1 2015-06-11 Matt Rajca <mrajca@apple.com> 2 3 Media Session: Add plumbing for media control event delivery. 4 https://bugs.webkit.org/show_bug.cgi?id=145859 5 6 Reviewed by Anders Carlsson. 7 8 * Modules/mediasession/MediaEventTypes.h: Added. 9 * WebCore.xcodeproj/project.pbxproj: 10 * page/Page.cpp: 11 (WebCore::Page::handleMediaEvent): Toggle media playback upon receiving the PlayPause event as described in the spec. 12 * page/Page.h: 13 1 14 2015-06-11 Jon Lee <jonlee@apple.com> 2 15 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r185459 r185477 5703 5703 C968B2E81B1E778100EF1F81 /* HTMLMediaElementMediaSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C968B2E71B1E778100EF1F81 /* HTMLMediaElementMediaSession.cpp */; }; 5704 5704 C9DADBCB1B1D3B97001F17D8 /* JSMediaSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C9DADBC91B1D3B25001F17D8 /* JSMediaSession.cpp */; }; 5705 C9F87CFE1B28F40E00979B83 /* MediaEventTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = C9F87CFD1B28E5F600979B83 /* MediaEventTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5705 5706 CA3BF67C10D99BAE00E6CE53 /* ScrollAnimator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CA3BF67B10D99BAE00E6CE53 /* ScrollAnimator.cpp */; }; 5706 5707 CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 13277 13278 C9DADBC91B1D3B25001F17D8 /* JSMediaSession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaSession.cpp; sourceTree = "<group>"; }; 13278 13279 C9DADBCA1B1D3B25001F17D8 /* JSMediaSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaSession.h; sourceTree = "<group>"; }; 13280 C9F87CFD1B28E5F600979B83 /* MediaEventTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaEventTypes.h; sourceTree = "<group>"; }; 13279 13281 CA3BF67B10D99BAE00E6CE53 /* ScrollAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollAnimator.cpp; sourceTree = "<group>"; }; 13280 13282 CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAnimator.h; sourceTree = "<group>"; }; … … 14623 14625 C968B2E61B1E72F700EF1F81 /* HTMLMediaElementMediaSession.h */, 14624 14626 C968B2E51B1E704500EF1F81 /* HTMLMediaElementMediaSession.idl */, 14627 C9F87CFD1B28E5F600979B83 /* MediaEventTypes.h */, 14625 14628 C90843CD1B18E47D00B68564 /* MediaRemoteControls.cpp */, 14626 14629 C90843CE1B18E47D00B68564 /* MediaRemoteControls.h */, … … 25840 25843 07FE99DD18807A7D00256648 /* MediaElementSession.h in Headers */, 25841 25844 E44613AD0CD6331000FADA75 /* MediaError.h in Headers */, 25845 C9F87CFE1B28F40E00979B83 /* MediaEventTypes.h in Headers */, 25842 25846 4E1959220A39DABA00220FE5 /* MediaFeatureNames.h in Headers */, 25843 25847 07A6D1EC1491137700051D0C /* MediaFragmentURIParser.h in Headers */, -
trunk/Source/WebCore/page/Page.cpp
r185231 r185477 111 111 #endif 112 112 113 #if ENABLE(MEDIA_SESSION) 114 #include "MediaSessionManager.h" 115 #endif 116 113 117 namespace WebCore { 114 118 … … 1228 1232 } 1229 1233 1234 #if ENABLE(MEDIA_SESSION) 1235 void Page::handleMediaEvent(MediaEventType eventType) 1236 { 1237 switch (eventType) { 1238 case MediaEventType::PlayPause: 1239 MediaSessionManager::singleton().togglePlayback(); 1240 break; 1241 default: 1242 break; 1243 } 1244 } 1245 #endif 1246 1230 1247 #if !ASSERT_DISABLED 1231 1248 void Page::checkSubframeCountConsistency() const -
trunk/Source/WebCore/page/Page.h
r185337 r185477 53 53 #if PLATFORM(COCOA) 54 54 #include <wtf/SchedulePair.h> 55 #endif 56 57 #if ENABLE(MEDIA_SESSION) 58 #include "MediaEventTypes.h" 55 59 #endif 56 60 … … 444 448 WEBCORE_EXPORT void setMuted(bool); 445 449 450 #if ENABLE(MEDIA_SESSION) 451 WEBCORE_EXPORT void handleMediaEvent(MediaEventType); 452 #endif 453 446 454 #if ENABLE(WIRELESS_PLAYBACK_TARGET) 447 455 void addPlaybackTargetPickerClient(uint64_t); -
trunk/Source/WebKit2/ChangeLog
r185475 r185477 1 2015-06-11 Matt Rajca <mrajca@apple.com> 2 3 Media Session: Add plumbing for media control event delivery. 4 https://bugs.webkit.org/show_bug.cgi?id=145859 5 6 Reviewed by Anders Carlsson. 7 8 * UIProcess/API/C/WKPage.cpp: 9 (WKPageHandleMediaEvent): 10 * UIProcess/API/C/WKPagePrivate.h: 11 * UIProcess/WebPageProxy.cpp: 12 (WebKit::WebPageProxy::handleMediaEvent): 13 * UIProcess/WebPageProxy.h: 14 * WebProcess/WebPage/WebPage.cpp: 15 (WebKit::WebPage::handleMediaEvent): 16 * WebProcess/WebPage/WebPage.h: 17 * WebProcess/WebPage/WebPage.messages.in: 18 1 19 2015-06-11 Myles C. Maxfield <mmaxfield@apple.com> 2 20 -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r185072 r185477 79 79 #endif 80 80 81 #if ENABLE(MEDIA_SESSION) 82 #include <WebCore/MediaEventTypes.h> 83 #endif 84 81 85 using namespace WebCore; 82 86 using namespace WebKit; … … 2122 2126 } 2123 2127 2128 void WKPageHandleMediaEvent(WKPageRef page, WKMediaEventType wkEventType) 2129 { 2130 #if ENABLE(MEDIA_SESSION) 2131 MediaEventType eventType; 2132 2133 switch (wkEventType) { 2134 case kWKMediaEventTypePlayPause: 2135 eventType = MediaEventType::PlayPause; 2136 break; 2137 case kWKMediaEventTypeTrackNext: 2138 eventType = MediaEventType::TrackNext; 2139 break; 2140 case kWKMediaEventTypeTrackPrevious: 2141 eventType = MediaEventType::TrackPrevious; 2142 break; 2143 default: 2144 ASSERT_NOT_REACHED(); 2145 } 2146 2147 toImpl(page)->handleMediaEvent(eventType); 2148 #else 2149 UNUSED_PARAM(page); 2150 UNUSED_PARAM(wkEventType); 2151 #endif 2152 } 2153 2124 2154 void WKPagePostMessageToInjectedBundle(WKPageRef pageRef, WKStringRef messageNameRef, WKTypeRef messageBodyRef) 2125 2155 { -
trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h
r185072 r185477 112 112 WK_EXPORT void WKPageSetMuted(WKPageRef page, bool muted); 113 113 114 enum { 115 kWKMediaEventTypePlayPause, 116 kWKMediaEventTypeTrackNext, 117 kWKMediaEventTypeTrackPrevious 118 }; 119 typedef uint32_t WKMediaEventType; 120 121 WK_EXPORT void WKPageHandleMediaEvent(WKPageRef page, WKMediaEventType event); 122 114 123 WK_EXPORT void WKPageLoadURLWithShouldOpenExternalURLsPolicy(WKPageRef page, WKURLRef url, bool shouldOpenExternalURLs); 115 124 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r184950 r185477 3775 3775 } 3776 3776 3777 #if ENABLE(MEDIA_SESSION) 3778 void WebPageProxy::handleMediaEvent(MediaEventType eventType) 3779 { 3780 if (!isValid()) 3781 return; 3782 3783 m_process->send(Messages::WebPage::HandleMediaEvent(eventType), m_pageID); 3784 } 3785 #endif 3786 3777 3787 void WebPageProxy::setMayStartMediaWhenInWindow(bool mayStartMedia) 3778 3788 { -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r185123 r185477 923 923 bool mayStartMediaWhenInWindow() const { return m_mayStartMediaWhenInWindow; } 924 924 925 #if ENABLE(MEDIA_SESSION) 926 void handleMediaEvent(WebCore::MediaEventType); 927 #endif 928 925 929 // WebPopupMenuProxy::Client 926 930 virtual NativeWebMouseEvent* currentlyProcessedMouseDownEvent() override; -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r185123 r185477 4049 4049 } 4050 4050 4051 #if ENABLE(MEDIA_SESSION) 4052 void WebPage::handleMediaEvent(uint32_t eventType) 4053 { 4054 m_page->handleMediaEvent(static_cast<MediaEventType>(eventType)); 4055 } 4056 #endif 4057 4051 4058 void WebPage::setMayStartMediaWhenInWindow(bool mayStartMedia) 4052 4059 { -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r185123 r185477 741 741 void setMayStartMediaWhenInWindow(bool); 742 742 743 #if ENABLE(MEDIA_SESSION) 744 void handleMediaEvent(uint32_t /* WebCore::MediaEventType */); 745 #endif 746 743 747 void updateMainFrameScrollOffsetPinning(); 744 748 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r185123 r185477 315 315 SetMayStartMediaWhenInWindow(bool mayStartMedia) 316 316 317 #if ENABLE(MEDIA_SESSION) 318 HandleMediaEvent(uint32_t eventType) 319 #endif 320 317 321 // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require 318 322 // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
Note: See TracChangeset
for help on using the changeset viewer.