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

Changeset 259858 in webkit


Ignore:
Timestamp:
Apr 10, 2020, 3:32:59 AM (6 years ago)
Author:
cturner@igalia.com
Message:

[EME][GStreamer] Relax proxy initialization assert
https://bugs.webkit.org/show_bug.cgi?id=210258

Reviewed by Xabier Rodriguez-Calvar.

update() may be called on a session before its parent MediaKeys object
has been associated with a media element. Supporting this is officially
optional, but enough sites (including the W3C EME tests) depend on this
optional behaviour that we should support it.

Covered by imported/w3c/web-platform-tests/encrypted-media.

  • platform/encryptedmedia/CDMProxy.cpp:

(WebCore::CDMInstanceProxy::mergeKeysFrom): Since the background
proxy may not be installed yet, don't ASSERT() it exists.

  • platform/encryptedmedia/CDMProxy.h:

(WebCore::KeyStore::hasKeys const):
(WebCore::CDMInstanceProxy::setProxy): Now, when the background
proxy is installed, check if any keys have been made available as
described above, and if so, set them.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r259854 r259858  
     12020-04-10  Charlie Turner  <cturner@igalia.com>
     2
     3        [EME][GStreamer] Relax proxy initialization assert
     4        https://bugs.webkit.org/show_bug.cgi?id=210258
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        update() may be called on a session before its parent MediaKeys object
     9        has been associated with a media element. Supporting this is officially
     10        optional, but enough sites (including the W3C EME tests) depend on this
     11        optional behaviour that we should support it.
     12
     13        Covered by imported/w3c/web-platform-tests/encrypted-media.
     14
     15        * platform/encryptedmedia/CDMProxy.cpp:
     16        (WebCore::CDMInstanceProxy::mergeKeysFrom): Since the background
     17        proxy may not be installed yet, don't ASSERT() it exists.
     18        * platform/encryptedmedia/CDMProxy.h:
     19        (WebCore::KeyStore::hasKeys const):
     20        (WebCore::CDMInstanceProxy::setProxy): Now, when the background
     21        proxy is installed, check if any keys have been made available as
     22        described above, and if so, set them.
     23
    1242020-04-10  Adrian Perez de Castro  <aperez@igalia.com>
    225
  • trunk/Source/WebCore/platform/encryptedmedia/CDMProxy.cpp

    r256429 r259858  
    288288    ASSERT(isMainThread());
    289289    m_keyStore.merge(keyStore);
    290     LOG(EME, "EME - CDMInstanceProxy - merging keys into proxy instance and notifying CDMProxy of changes");
    291     ASSERT(m_cdmProxy);
    292     m_cdmProxy->updateKeyStore(keyStore);
     290    if (m_cdmProxy) {
     291        LOG(EME, "EME - CDMInstanceProxy - merging keys into proxy instance and notifying CDMProxy of changes");
     292        m_cdmProxy->updateKeyStore(keyStore);
     293    }
    293294}
    294295
  • trunk/Source/WebCore/platform/encryptedmedia/CDMProxy.h

    r256429 r259858  
    8989    bool add(RefPtr<Key>&&);
    9090    bool remove(const RefPtr<Key>&);
     91    bool hasKeys() const { return m_keys.size(); }
    9192    unsigned numKeys() const { return m_keys.size(); }
    9293    const Vector<uint8_t>& keyValue(const Vector<uint8_t>& keyID) const;
     
    152153        m_cdmProxy = WTFMove(proxy);
    153154        m_cdmProxy->setInstance(this);
     155        // The CDM instance may be attached after an update(). Not
     156        // recommended, but apps and the W3C test-suite do this.
     157        if (m_keyStore.hasKeys())
     158            m_cdmProxy->updateKeyStore(m_keyStore);
    154159    }
    155160    void mergeKeysFrom(const KeyStore&);
Note: See TracChangeset for help on using the changeset viewer.