Changeset 206193 in webkit
- Timestamp:
- Sep 20, 2016 6:10:18 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r206190 r206193 1 2016-09-20 Jer Noble <jer.noble@apple.com> 2 3 Adopt MRMediaRemoteSetParentApplication. 4 https://bugs.webkit.org/show_bug.cgi?id=162259 5 <rdar://problem/28376161> 6 7 Reviewed by Anders Carlsson. 8 9 Allow MediaSessionManagerMac to retrieve the correct parent application identifier 10 from a PlatformMediaSession so that it can pass that identifier through to MediaRemote 11 via MRMediaRemoteSetParentApplication. 12 13 * Modules/webaudio/AudioContext.cpp: 14 (WebCore::AudioContext::sourceApplicationIdentifier): 15 * Modules/webaudio/AudioContext.h: 16 * platform/audio/PlatformMediaSession.cpp: 17 (WebCore::PlatformMediaSession::sourceApplicationIdentifier): 18 * platform/audio/PlatformMediaSession.h: 19 (WebCore::PlatformMediaSession::resetPlaybackSessionState): Deleted. 20 * platform/audio/mac/MediaSessionManagerMac.mm: 21 (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): 22 * platform/mac/MediaRemoteSoftLink.cpp: 23 * platform/mac/MediaRemoteSoftLink.h: 24 25 1 26 2016-09-20 Nan Wang <n_wang@apple.com> 2 27 -
trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp
r205088 r206193 49 49 #include "ExceptionCode.h" 50 50 #include "FFTFrame.h" 51 #include "Frame.h" 51 52 #include "GainNode.h" 52 53 #include "GenericEventQueue.h" … … 54 55 #include "HRTFPanner.h" 55 56 #include "JSDOMPromise.h" 57 #include "NetworkingContext.h" 56 58 #include "OfflineAudioCompletionEvent.h" 57 59 #include "OfflineAudioDestinationNode.h" … … 354 356 } 355 357 358 String AudioContext::sourceApplicationIdentifier() const 359 { 360 Document* document = this->document(); 361 if (Frame* frame = document ? document->frame() : nullptr) { 362 if (NetworkingContext* networkingContext = frame->loader().networkingContext()) 363 return networkingContext->sourceApplicationIdentifier(); 364 } 365 return emptyString(); 366 } 367 356 368 RefPtr<AudioBuffer> AudioContext::createBuffer(unsigned numberOfChannels, size_t numberOfFrames, float sampleRate, ExceptionCode& ec) 357 369 { -
trunk/Source/WebCore/Modules/webaudio/AudioContext.h
r205088 r206193 318 318 bool supportsSeeking() const override { return false; } 319 319 bool shouldOverrideBackgroundPlaybackRestriction(PlatformMediaSession::InterruptionType) const override { return false; } 320 String sourceApplicationIdentifier() const override; 320 321 321 322 // EventTarget -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r206146 r206193 6519 6519 } 6520 6520 6521 String HTMLMediaElement:: mediaPlayerSourceApplicationIdentifier() const6521 String HTMLMediaElement::sourceApplicationIdentifier() const 6522 6522 { 6523 6523 if (Frame* frame = document().frame()) { -
trunk/Source/WebCore/html/HTMLMediaElement.h
r206127 r206193 628 628 bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) override; 629 629 void mediaPlayerHandlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType command) override { didReceiveRemoteControlCommand(command, nullptr); } 630 String mediaPlayerSourceApplicationIdentifier() const override; 630 String sourceApplicationIdentifier() const override; 631 String mediaPlayerSourceApplicationIdentifier() const override { return sourceApplicationIdentifier(); } 631 632 Vector<String> mediaPlayerPreferredAudioCharacteristics() const override; 632 633 -
trunk/Source/WebCore/platform/audio/PlatformMediaSession.cpp
r203982 r206193 290 290 } 291 291 292 String PlatformMediaSession::sourceApplicationIdentifier() const 293 { 294 return m_client.sourceApplicationIdentifier(); 295 } 296 292 297 bool PlatformMediaSession::isHidden() const 293 298 { -
trunk/Source/WebCore/platform/audio/PlatformMediaSession.h
r205412 r206193 167 167 void scheduleClientDataBufferingCheck(); 168 168 virtual void resetPlaybackSessionState() { } 169 String sourceApplicationIdentifier() const; 169 170 170 171 protected: … … 225 226 226 227 virtual const Document* hostingDocument() const = 0; 228 virtual String sourceApplicationIdentifier() const = 0; 227 229 228 230 protected: -
trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm
r203706 r206193 113 113 return; 114 114 115 if (!MRMediaRemoteSetCanBeNowPlayingApplication(true)) {116 LOG(Media, "MediaSessionManagerMac::updateNowPlayingInfo - MRMediaRemoteSetCanBeNowPlayingApplication(true) failed");117 return;118 }119 120 115 const PlatformMediaSession* currentSession = this->nowPlayingEligibleSession(); 121 116 … … 124 119 if (!currentSession) { 125 120 if (m_nowPlayingActive) { 121 MRMediaRemoteSetCanBeNowPlayingApplication(false); 126 122 LOG(Media, "MediaSessionManagerMac::updateNowPlayingInfo - clearing now playing info"); 127 123 MRMediaRemoteSetNowPlayingInfo(nullptr); … … 136 132 } 137 133 134 return; 135 } 136 137 if (!MRMediaRemoteSetCanBeNowPlayingApplication(true)) { 138 LOG(Media, "MediaSessionManagerMac::updateNowPlayingInfo - MRMediaRemoteSetCanBeNowPlayingApplication(true) failed"); 138 139 return; 139 140 } … … 173 174 title.utf8().data(), rate, duration, currentTime); 174 175 176 String parentApplication = currentSession->sourceApplicationIdentifier(); 177 if (canLoad_MediaRemote_MRMediaRemoteSetParentApplication() && !parentApplication.isEmpty()) 178 MRMediaRemoteSetParentApplication(MRMediaRemoteGetLocalOrigin(), parentApplication.createCFString().get()); 179 175 180 m_nowPlayingActive = true; 176 181 MRPlaybackState playbackState = (currentSession->state() == PlatformMediaSession::Playing) ? kMRPlaybackStatePlaying : kMRPlaybackStatePaused; -
trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp
r203982 r206193 43 43 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingInfo, void, (CFDictionaryRef info), (info)) 44 44 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin, void, (MROriginRef origin, MRPlaybackState playbackState, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError)), (origin, playbackState, replyQ, completion)) 45 SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetParentApplication, void, (MROriginRef origin, CFStringRef parentAppDisplayID), (origin, parentAppDisplayID)) 45 46 SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoTitle, CFStringRef); 46 47 SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoDuration, CFStringRef); -
trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.h
r203982 r206193 54 54 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin, void, (MROriginRef origin, MRPlaybackState playbackState, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError)), (origin, playbackState, replyQ, completion)) 55 55 #define MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin softLink_MediaRemote_MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin 56 SOFT_LINK_FUNCTION_MAY_FAIL_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteSetParentApplication, void, (MROriginRef origin, CFStringRef parentAppDisplayID), (origin, parentAppDisplayID)) 57 #define MRMediaRemoteSetParentApplication softLink_MediaRemote_MRMediaRemoteSetParentApplication 56 58 SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoTitle, CFStringRef); 57 59 #define kMRMediaRemoteNowPlayingInfoTitle get_MediaRemote_kMRMediaRemoteNowPlayingInfoTitle()
Note: See TracChangeset
for help on using the changeset viewer.