Changeset 206288 in webkit
- Timestamp:
- Sep 22, 2016 7:10:59 PM (8 years ago)
- Location:
- branches/safari-602-branch/Source/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-602-branch/Source/WebCore/ChangeLog
r206270 r206288 1 2016-09-22 Babak Shafiei <bshafiei@apple.com> 2 3 Merge r206193. rdar://problem/28376161 4 5 2016-09-20 Jer Noble <jer.noble@apple.com> 6 7 Adopt MRMediaRemoteSetParentApplication. 8 https://bugs.webkit.org/show_bug.cgi?id=162259 9 <rdar://problem/28376161> 10 11 Reviewed by Anders Carlsson. 12 13 Allow MediaSessionManagerMac to retrieve the correct parent application identifier 14 from a PlatformMediaSession so that it can pass that identifier through to MediaRemote 15 via MRMediaRemoteSetParentApplication. 16 17 * Modules/webaudio/AudioContext.cpp: 18 (WebCore::AudioContext::sourceApplicationIdentifier): 19 * Modules/webaudio/AudioContext.h: 20 * platform/audio/PlatformMediaSession.cpp: 21 (WebCore::PlatformMediaSession::sourceApplicationIdentifier): 22 * platform/audio/PlatformMediaSession.h: 23 (WebCore::PlatformMediaSession::resetPlaybackSessionState): Deleted. 24 * platform/audio/mac/MediaSessionManagerMac.mm: 25 (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): 26 * platform/mac/MediaRemoteSoftLink.cpp: 27 * platform/mac/MediaRemoteSoftLink.h: 28 29 1 30 2016-09-22 Babak Shafiei <bshafiei@apple.com> 2 31 -
branches/safari-602-branch/Source/WebCore/Modules/webaudio/AudioContext.cpp
r203303 r206288 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" … … 357 359 } 358 360 361 String AudioContext::sourceApplicationIdentifier() const 362 { 363 Document* document = this->document(); 364 if (Frame* frame = document ? document->frame() : nullptr) { 365 if (NetworkingContext* networkingContext = frame->loader().networkingContext()) 366 return networkingContext->sourceApplicationIdentifier(); 367 } 368 return emptyString(); 369 } 370 359 371 RefPtr<AudioBuffer> AudioContext::createBuffer(unsigned numberOfChannels, size_t numberOfFrames, float sampleRate, ExceptionCode& ec) 360 372 { -
branches/safari-602-branch/Source/WebCore/Modules/webaudio/AudioContext.h
r204102 r206288 317 317 void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override { } 318 318 bool shouldOverrideBackgroundPlaybackRestriction(PlatformMediaSession::InterruptionType) const override { return false; } 319 String sourceApplicationIdentifier() const override; 319 320 320 321 // EventTarget -
branches/safari-602-branch/Source/WebCore/html/HTMLMediaElement.cpp
r205952 r206288 6509 6509 } 6510 6510 6511 String HTMLMediaElement:: mediaPlayerSourceApplicationIdentifier() const6511 String HTMLMediaElement::sourceApplicationIdentifier() const 6512 6512 { 6513 6513 if (Frame* frame = document().frame()) { -
branches/safari-602-branch/Source/WebCore/html/HTMLMediaElement.h
r205952 r206288 627 627 bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) override; 628 628 void mediaPlayerHandlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType command) override { didReceiveRemoteControlCommand(command); } 629 String mediaPlayerSourceApplicationIdentifier() const override; 629 String sourceApplicationIdentifier() const override; 630 String mediaPlayerSourceApplicationIdentifier() const override { return sourceApplicationIdentifier(); } 630 631 Vector<String> mediaPlayerPreferredAudioCharacteristics() const override; 631 632 -
branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSession.cpp
r204102 r206288 285 285 } 286 286 287 String PlatformMediaSession::sourceApplicationIdentifier() const 288 { 289 return m_client.sourceApplicationIdentifier(); 290 } 291 287 292 bool PlatformMediaSession::isHidden() const 288 293 { -
branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSession.h
r205705 r206288 161 161 void scheduleClientDataBufferingCheck(); 162 162 virtual void resetPlaybackSessionState() { } 163 String sourceApplicationIdentifier() const; 163 164 164 165 protected: … … 218 219 219 220 virtual const Document* hostingDocument() const = 0; 221 virtual String sourceApplicationIdentifier() const = 0; 220 222 221 223 protected: -
branches/safari-602-branch/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm
r203876 r206288 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; -
branches/safari-602-branch/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp
r204102 r206288 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); -
branches/safari-602-branch/Source/WebCore/platform/mac/MediaRemoteSoftLink.h
r204102 r206288 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.