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

Changeset 142918 in webkit


Ignore:
Timestamp:
Feb 14, 2013, 2:26:53 PM (14 years ago)
Author:
jer.noble@apple.com
Message:

EME: replace MediaKeySession.addKey() -> update()
https://bugs.webkit.org/show_bug.cgi?id=109461

Source/WebCore:

Reviewed by Eric Carlson.

No new tests; updated media/encrypted-media/encrypted-media-v2-syntax.html test.

In the latest draft of the Encrypted Media Spec, the addKeys() method has been replaced
with update().

  • Modules/encryptedmedia/CDM.h:
  • Modules/encryptedmedia/MediaKeySession.cpp:

(WebCore::MediaKeySession::update):
(WebCore::MediaKeySession::addKeyTimerFired):

  • Modules/encryptedmedia/MediaKeySession.h:
  • Modules/encryptedmedia/MediaKeySession.idl:
  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::webkitAddKey):

  • testing/MockCDM.cpp:

(WebCore::MockCDMSession::update):

LayoutTests:

Rebaseline after API change.

Reviewed by Eric Carlson.

  • media/encrypted-media/encrypted-media-v2-syntax-expected.txt:
  • media/encrypted-media/encrypted-media-v2-syntax.html:
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r142904 r142918  
     12013-02-14  Jer Noble  <jer.noble@apple.com>
     2
     3        EME: replace MediaKeySession.addKey() -> update()
     4        https://bugs.webkit.org/show_bug.cgi?id=109461
     5
     6        Rebaseline after API change.
     7
     8        Reviewed by Eric Carlson.
     9
     10        * media/encrypted-media/encrypted-media-v2-syntax-expected.txt:
     11        * media/encrypted-media/encrypted-media-v2-syntax.html:
     12
    1132013-02-14  Lamarque V. Souza  <Lamarque.Souza@basyskom.com>
    214
  • trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax-expected.txt

    r142327 r142918  
    1515EXPECTED (typeof mediaKeySession == 'object') OK
    1616EXPECTED (typeof mediaKeySession.addEventListener == 'function') OK
    17 EXPECTED (typeof mediaKeySession.addKey == 'function') OK
     17EXPECTED (typeof mediaKeySession.update == 'function') OK
    1818EXPECTED (mediaKeySession.error == 'null') OK
    1919EXPECTED (mediaKeySession.keySystem == 'com.webcore.mock') OK
     
    2222EXPECTED (mediaKeySession.onwebkitkeyerror == 'null') OK
    2323EXPECTED (mediaKeySession.onwebkitkeymessage == 'null') OK
    24 TEST(mediaKeySession.addKey(null)) THROWS(DOMException.INVALID_ACCESS_ERR) OK
     24TEST(mediaKeySession.update(null)) THROWS(DOMException.INVALID_ACCESS_ERR) OK
    2525END OF TEST
    2626
  • trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html

    r142327 r142918  
    4040                testExpected('typeof mediaKeySession', 'object');
    4141                testExpected('typeof mediaKeySession.addEventListener', 'function');
    42                 testExpected('typeof mediaKeySession.addKey', 'function');
     42                testExpected('typeof mediaKeySession.update', 'function');
    4343                testExpected('mediaKeySession.error', null);
    4444                testExpected('mediaKeySession.keySystem', 'com.webcore.mock');
     
    4747                testExpected('mediaKeySession.onwebkitkeyerror', null);
    4848                testExpected('mediaKeySession.onwebkitkeymessage', null);
    49                 testException('mediaKeySession.addKey(null)', "DOMException.INVALID_ACCESS_ERR");
     49                testException('mediaKeySession.update(null)', "DOMException.INVALID_ACCESS_ERR");
    5050                endTest();
    5151            }
  • trunk/Source/WebCore/ChangeLog

    r142914 r142918  
     12013-02-14  Jer Noble  <jer.noble@apple.com>
     2
     3        EME: replace MediaKeySession.addKey() -> update()
     4        https://bugs.webkit.org/show_bug.cgi?id=109461
     5
     6        Reviewed by Eric Carlson.
     7
     8        No new tests; updated media/encrypted-media/encrypted-media-v2-syntax.html test.
     9
     10        In the latest draft of the Encrypted Media Spec, the addKeys() method has been replaced
     11        with update().
     12
     13        * Modules/encryptedmedia/CDM.h:
     14        * Modules/encryptedmedia/MediaKeySession.cpp:
     15        (WebCore::MediaKeySession::update):
     16        (WebCore::MediaKeySession::addKeyTimerFired):
     17        * Modules/encryptedmedia/MediaKeySession.h:
     18        * Modules/encryptedmedia/MediaKeySession.idl:
     19        * html/HTMLMediaElement.cpp:
     20        (WebCore::HTMLMediaElement::webkitAddKey):
     21        * testing/MockCDM.cpp:
     22        (WebCore::MockCDMSession::update):
     23
    1242013-02-14  Tony Chang  <tony@chromium.org>
    225
  • trunk/Source/WebCore/Modules/encryptedmedia/CDM.h

    r142327 r142918  
    5454    virtual PassRefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode) = 0;
    5555    virtual void releaseKeys() = 0;
    56     virtual bool addKey(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) = 0;
     56    virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) = 0;
    5757};
    5858
  • trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp

    r142327 r142918  
    139139}
    140140
    141 void MediaKeySession::addKey(Uint8Array* key, ExceptionCode& ec)
     141void MediaKeySession::update(Uint8Array* key, ExceptionCode& ec)
    142142{
    143143    // From <http://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/encrypted-media.html#dom-addkey>:
     
    166166        unsigned long systemCode = 0;
    167167
    168         // NOTE: Continued from step 2. of MediaKeySession::addKey()
     168        // NOTE: Continued from step 2. of MediaKeySession::update()
    169169        // 2.1. Let cdm be the cdm loaded in the MediaKeys constructor.
    170170        // NOTE: This is m_session.
     
    174174        RefPtr<Uint8Array> nextMessage;
    175175        // 2.4. Use cdm to handle key.
    176         didStoreKey = m_session->addKey(pendingKey.get(), nextMessage, errorCode, systemCode);
     176        didStoreKey = m_session->update(pendingKey.get(), nextMessage, errorCode, systemCode);
    177177        // 2.5. If did store key is true and the media element is waiting for a key, queue a task to attempt to resume playback.
    178178        // TODO: Find and restart the media element
  • trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h

    r142327 r142918  
    6161
    6262    void generateKeyRequest(const String& mimeType, Uint8Array* initData);
    63     void addKey(Uint8Array* key, ExceptionCode&);
     63    void update(Uint8Array* key, ExceptionCode&);
    6464    void close();
    6565
  • trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl

    r142327 r142918  
    3737
    3838    // session operations
    39     void addKey(in Uint8Array key)
     39    void update(in Uint8Array key)
    4040        raises(DOMException);
    4141    void close();
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r142819 r142918  
    25442544    static bool firstTime = true;
    25452545    if (firstTime && context() && context()->scriptExecutionContext()) {
    2546         context()->scriptExecutionContext()->addConsoleMessage(JSMessageSource, WarningMessageLevel, "'HTMLMediaElement.webkitAddKey()' is deprecated.  Use 'MediaKeySession.addKey()' instead.");
     2546        context()->scriptExecutionContext()->addConsoleMessage(JSMessageSource, WarningMessageLevel, "'HTMLMediaElement.webkitAddKey()' is deprecated.  Use 'MediaKeySession.update()' instead.");
    25472547        firstTime = false;
    25482548    }
  • trunk/Source/WebCore/testing/MockCDM.cpp

    r142327 r142918  
    4343    virtual PassRefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode) OVERRIDE;
    4444    virtual void releaseKeys() OVERRIDE;
    45     virtual bool addKey(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) OVERRIDE;
     45    virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) OVERRIDE;
    4646
    4747protected:
     
    129129}
    130130
    131 bool MockCDMSession::addKey(Uint8Array* key, RefPtr<Uint8Array>&, unsigned short& errorCode, unsigned long&)
     131bool MockCDMSession::update(Uint8Array* key, RefPtr<Uint8Array>&, unsigned short& errorCode, unsigned long&)
    132132{
    133133    for (unsigned i = 0; i < keyPrefix()->length(); ++i) {
Note: See TracChangeset for help on using the changeset viewer.