Changeset 206288 in webkit


Ignore:
Timestamp:
Sep 22, 2016 7:10:59 PM (8 years ago)
Author:
bshafiei@apple.com
Message:

Merge r206193. rdar://problem/28376161

Location:
branches/safari-602-branch/Source/WebCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-602-branch/Source/WebCore/ChangeLog

    r206270 r206288  
     12016-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
    1302016-09-22  Babak Shafiei  <bshafiei@apple.com>
    231
  • branches/safari-602-branch/Source/WebCore/Modules/webaudio/AudioContext.cpp

    r203303 r206288  
    4949#include "ExceptionCode.h"
    5050#include "FFTFrame.h"
     51#include "Frame.h"
    5152#include "GainNode.h"
    5253#include "GenericEventQueue.h"
     
    5455#include "HRTFPanner.h"
    5556#include "JSDOMPromise.h"
     57#include "NetworkingContext.h"
    5658#include "OfflineAudioCompletionEvent.h"
    5759#include "OfflineAudioDestinationNode.h"
     
    357359}
    358360
     361String 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
    359371RefPtr<AudioBuffer> AudioContext::createBuffer(unsigned numberOfChannels, size_t numberOfFrames, float sampleRate, ExceptionCode& ec)
    360372{
  • branches/safari-602-branch/Source/WebCore/Modules/webaudio/AudioContext.h

    r204102 r206288  
    317317    void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override { }
    318318    bool shouldOverrideBackgroundPlaybackRestriction(PlatformMediaSession::InterruptionType) const override { return false; }
     319    String sourceApplicationIdentifier() const override;
    319320
    320321    // EventTarget
  • branches/safari-602-branch/Source/WebCore/html/HTMLMediaElement.cpp

    r205952 r206288  
    65096509}
    65106510
    6511 String HTMLMediaElement::mediaPlayerSourceApplicationIdentifier() const
     6511String HTMLMediaElement::sourceApplicationIdentifier() const
    65126512{
    65136513    if (Frame* frame = document().frame()) {
  • branches/safari-602-branch/Source/WebCore/html/HTMLMediaElement.h

    r205952 r206288  
    627627    bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) override;
    628628    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(); }
    630631    Vector<String> mediaPlayerPreferredAudioCharacteristics() const override;
    631632
  • branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSession.cpp

    r204102 r206288  
    285285}
    286286
     287String PlatformMediaSession::sourceApplicationIdentifier() const
     288{
     289    return m_client.sourceApplicationIdentifier();
     290}
     291
    287292bool PlatformMediaSession::isHidden() const
    288293{
  • branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSession.h

    r205705 r206288  
    161161    void scheduleClientDataBufferingCheck();
    162162    virtual void resetPlaybackSessionState() { }
     163    String sourceApplicationIdentifier() const;
    163164
    164165protected:
     
    218219
    219220    virtual const Document* hostingDocument() const = 0;
     221    virtual String sourceApplicationIdentifier() const = 0;
    220222
    221223protected:
  • branches/safari-602-branch/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm

    r203876 r206288  
    113113        return;
    114114
    115     if (!MRMediaRemoteSetCanBeNowPlayingApplication(true)) {
    116         LOG(Media, "MediaSessionManagerMac::updateNowPlayingInfo - MRMediaRemoteSetCanBeNowPlayingApplication(true) failed");
    117         return;
    118     }
    119 
    120115    const PlatformMediaSession* currentSession = this->nowPlayingEligibleSession();
    121116
     
    124119    if (!currentSession) {
    125120        if (m_nowPlayingActive) {
     121            MRMediaRemoteSetCanBeNowPlayingApplication(false);
    126122            LOG(Media, "MediaSessionManagerMac::updateNowPlayingInfo - clearing now playing info");
    127123            MRMediaRemoteSetNowPlayingInfo(nullptr);
     
    136132        }
    137133
     134        return;
     135    }
     136
     137    if (!MRMediaRemoteSetCanBeNowPlayingApplication(true)) {
     138        LOG(Media, "MediaSessionManagerMac::updateNowPlayingInfo - MRMediaRemoteSetCanBeNowPlayingApplication(true) failed");
    138139        return;
    139140    }
     
    173174        title.utf8().data(), rate, duration, currentTime);
    174175
     176    String parentApplication = currentSession->sourceApplicationIdentifier();
     177    if (canLoad_MediaRemote_MRMediaRemoteSetParentApplication() && !parentApplication.isEmpty())
     178        MRMediaRemoteSetParentApplication(MRMediaRemoteGetLocalOrigin(), parentApplication.createCFString().get());
     179
    175180    m_nowPlayingActive = true;
    176181    MRPlaybackState playbackState = (currentSession->state() == PlatformMediaSession::Playing) ? kMRPlaybackStatePlaying : kMRPlaybackStatePaused;
  • branches/safari-602-branch/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp

    r204102 r206288  
    4343SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingInfo, void, (CFDictionaryRef info), (info))
    4444SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin, void, (MROriginRef origin, MRPlaybackState playbackState, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError)), (origin, playbackState, replyQ, completion))
     45SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetParentApplication, void, (MROriginRef origin, CFStringRef parentAppDisplayID), (origin, parentAppDisplayID))
    4546SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoTitle, CFStringRef);
    4647SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoDuration, CFStringRef);
  • branches/safari-602-branch/Source/WebCore/platform/mac/MediaRemoteSoftLink.h

    r204102 r206288  
    5454SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin, void, (MROriginRef origin, MRPlaybackState playbackState, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError)), (origin, playbackState, replyQ, completion))
    5555#define MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin softLink_MediaRemote_MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin
     56SOFT_LINK_FUNCTION_MAY_FAIL_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteSetParentApplication, void, (MROriginRef origin, CFStringRef parentAppDisplayID), (origin, parentAppDisplayID))
     57#define MRMediaRemoteSetParentApplication softLink_MediaRemote_MRMediaRemoteSetParentApplication
    5658SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoTitle, CFStringRef);
    5759#define kMRMediaRemoteNowPlayingInfoTitle get_MediaRemote_kMRMediaRemoteNowPlayingInfoTitle()
Note: See TracChangeset for help on using the changeset viewer.