⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 276571 in webkit


Ignore:
Timestamp:
Apr 25, 2021, 1:38:23 PM (5 years ago)
Author:
jer.noble@apple.com
Message:

[GPUP] REGRESSION: Selecting play/pause on Spotify.com causes page to reload
https://bugs.webkit.org/show_bug.cgi?id=225023
<rdar://76985997>

Reviewed by Darin Adler.

A zero ObjectIdentifier is apparently invalid, which causes a debug ASSERT on the sending
side and a SIGKILL on the receiving side. Replace the zero ObjectIdentifier message when
clearing a LegacyCDMSession with an Optional<ObjectIdentifier>, and send an explicit
WTF::nullopt when clearing.

  • GPUProcess/media/RemoteMediaPlayerProxy.cpp:

(WebKit::RemoteMediaPlayerProxy::mediaPlayerCachedKeyForKeyId const):
(WebKit::RemoteMediaPlayerProxy::setLegacyCDMSession):

  • GPUProcess/media/RemoteMediaPlayerProxy.h:
  • GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
  • WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:

(WebKit::MediaPlayerPrivateRemote::setCDMSession):

Location:
trunk/Source/WebKit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r276570 r276571  
     12021-04-25  Jer Noble  <jer.noble@apple.com>
     2
     3        [GPUP] REGRESSION: Selecting play/pause on Spotify.com causes page to reload
     4        https://bugs.webkit.org/show_bug.cgi?id=225023
     5        <rdar://76985997>
     6
     7        Reviewed by Darin Adler.
     8
     9        A zero ObjectIdentifier is apparently invalid, which causes a debug ASSERT on the sending
     10        side and a SIGKILL on the receiving side. Replace the zero ObjectIdentifier message when
     11        clearing a LegacyCDMSession with an Optional<ObjectIdentifier>, and send an explicit
     12        WTF::nullopt when clearing.
     13
     14        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
     15        (WebKit::RemoteMediaPlayerProxy::mediaPlayerCachedKeyForKeyId const):
     16        (WebKit::RemoteMediaPlayerProxy::setLegacyCDMSession):
     17        * GPUProcess/media/RemoteMediaPlayerProxy.h:
     18        * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
     19        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
     20        (WebKit::MediaPlayerPrivateRemote::setCDMSession):
     21
    1222021-04-25  Jer Noble  <jer.noble@apple.com>
    223
  • trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp

    r276177 r276571  
    653653        return nullptr;
    654654
    655     if (auto cdmSession = m_manager->gpuConnectionToWebProcess()->legacyCdmFactoryProxy().getSession(m_legacySession))
     655    if (auto cdmSession = m_manager->gpuConnectionToWebProcess()->legacyCdmFactoryProxy().getSession(*m_legacySession))
    656656        return cdmSession->getCachedKeyForKeyId(keyId);
    657657    return nullptr;
     
    848848
    849849#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
    850 void RemoteMediaPlayerProxy::setLegacyCDMSession(RemoteLegacyCDMSessionIdentifier&& instanceId)
     850void RemoteMediaPlayerProxy::setLegacyCDMSession(Optional<RemoteLegacyCDMSessionIdentifier>&& instanceId)
    851851{
    852852    ASSERT(m_manager && m_manager->gpuConnectionToWebProcess());
     
    858858
    859859    if (m_legacySession) {
    860         if (auto cdmSession = m_manager->gpuConnectionToWebProcess()->legacyCdmFactoryProxy().getSession(m_legacySession)) {
     860        if (auto cdmSession = m_manager->gpuConnectionToWebProcess()->legacyCdmFactoryProxy().getSession(*m_legacySession)) {
    861861            m_player->setCDMSession(nullptr);
    862862            cdmSession->setPlayer(nullptr);
     
    867867
    868868    if (m_legacySession) {
    869         if (auto cdmSession = m_manager->gpuConnectionToWebProcess()->legacyCdmFactoryProxy().getSession(m_legacySession)) {
     869        if (auto cdmSession = m_manager->gpuConnectionToWebProcess()->legacyCdmFactoryProxy().getSession(*m_legacySession)) {
    870870            m_player->setCDMSession(cdmSession->session());
    871871            cdmSession->setPlayer(makeWeakPtr(this));
  • trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h

    r276177 r276571  
    158158
    159159#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
    160     void setLegacyCDMSession(RemoteLegacyCDMSessionIdentifier&& instanceId);
     160    void setLegacyCDMSession(Optional<RemoteLegacyCDMSessionIdentifier>&& instanceId);
    161161    void keyAdded();
    162162#endif
     
    330330#if ENABLE(LEGACY_ENCRYPTED_MEDIA) && ENABLE(ENCRYPTED_MEDIA)
    331331    bool m_shouldContinueAfterKeyNeeded { false };
    332     RemoteLegacyCDMSessionIdentifier m_legacySession;
     332    Optional<RemoteLegacyCDMSessionIdentifier> m_legacySession;
    333333#endif
    334334
  • trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in

    r275530 r276571  
    7777
    7878#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
    79     SetLegacyCDMSession(WebKit::RemoteLegacyCDMSessionIdentifier instanceId)
     79    SetLegacyCDMSession(Optional<WebKit::RemoteLegacyCDMSessionIdentifier> instanceId)
    8080    KeyAdded()
    8181#endif
  • trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp

    r276411 r276571  
    10571057{
    10581058    if (!session || session->type() != CDMSessionTypeRemote) {
    1059         connection().send(Messages::RemoteMediaPlayerProxy::SetLegacyCDMSession({ }), m_id);
     1059        connection().send(Messages::RemoteMediaPlayerProxy::SetLegacyCDMSession(WTF::nullopt), m_id);
    10601060        return;
    10611061    }
Note: See TracChangeset for help on using the changeset viewer.