Title: [142918] trunk
Revision
142918
Author
[email protected]
Date
2013-02-14 14:26:53 -0800 (Thu, 14 Feb 2013)

Log 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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (142917 => 142918)


--- trunk/LayoutTests/ChangeLog	2013-02-14 22:04:11 UTC (rev 142917)
+++ trunk/LayoutTests/ChangeLog	2013-02-14 22:26:53 UTC (rev 142918)
@@ -1,3 +1,15 @@
+2013-02-14  Jer Noble  <[email protected]>
+
+        EME: replace MediaKeySession.addKey() -> update()
+        https://bugs.webkit.org/show_bug.cgi?id=109461
+
+        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:
+
 2013-02-14  Lamarque V. Souza  <[email protected]>
 
         Support the ch unit from css3-values

Modified: trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax-expected.txt (142917 => 142918)


--- trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax-expected.txt	2013-02-14 22:04:11 UTC (rev 142917)
+++ trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax-expected.txt	2013-02-14 22:26:53 UTC (rev 142918)
@@ -14,13 +14,13 @@
 RUN(mediaKeySession = mediaKeys.createSession("video/mock", initData))
 EXPECTED (typeof mediaKeySession == 'object') OK
 EXPECTED (typeof mediaKeySession.addEventListener == 'function') OK
-EXPECTED (typeof mediaKeySession.addKey == 'function') OK
+EXPECTED (typeof mediaKeySession.update == 'function') OK
 EXPECTED (mediaKeySession.error == 'null') OK
 EXPECTED (mediaKeySession.keySystem == 'com.webcore.mock') OK
 EXPECTED (mediaKeySession.sessionId != 'null') OK
 EXPECTED (mediaKeySession._onwebkitkeyadded_ == 'null') OK
 EXPECTED (mediaKeySession._onwebkitkeyerror_ == 'null') OK
 EXPECTED (mediaKeySession._onwebkitkeymessage_ == 'null') OK
-TEST(mediaKeySession.addKey(null)) THROWS(DOMException.INVALID_ACCESS_ERR) OK
+TEST(mediaKeySession.update(null)) THROWS(DOMException.INVALID_ACCESS_ERR) OK
 END OF TEST
 

Modified: trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html (142917 => 142918)


--- trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html	2013-02-14 22:04:11 UTC (rev 142917)
+++ trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html	2013-02-14 22:26:53 UTC (rev 142918)
@@ -39,14 +39,14 @@
                 run('mediaKeySession = mediaKeys.createSession("video/mock", initData)');
                 testExpected('typeof mediaKeySession', 'object');
                 testExpected('typeof mediaKeySession.addEventListener', 'function');
-                testExpected('typeof mediaKeySession.addKey', 'function');
+                testExpected('typeof mediaKeySession.update', 'function');
                 testExpected('mediaKeySession.error', null);
                 testExpected('mediaKeySession.keySystem', 'com.webcore.mock');
                 testExpected('mediaKeySession.sessionId', null, '!=');
                 testExpected('mediaKeySession.onwebkitkeyadded', null);
                 testExpected('mediaKeySession.onwebkitkeyerror', null);
                 testExpected('mediaKeySession.onwebkitkeymessage', null);
-                testException('mediaKeySession.addKey(null)', "DOMException.INVALID_ACCESS_ERR");
+                testException('mediaKeySession.update(null)', "DOMException.INVALID_ACCESS_ERR");
                 endTest();
             }
         </script>
@@ -54,4 +54,4 @@
     <body _onload_="runTest()">
         <p>This tests the basic API of MediaKeys and MediaKeySession.</p>
     </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/Source/WebCore/ChangeLog (142917 => 142918)


--- trunk/Source/WebCore/ChangeLog	2013-02-14 22:04:11 UTC (rev 142917)
+++ trunk/Source/WebCore/ChangeLog	2013-02-14 22:26:53 UTC (rev 142918)
@@ -1,3 +1,26 @@
+2013-02-14  Jer Noble  <[email protected]>
+
+        EME: replace MediaKeySession.addKey() -> update()
+        https://bugs.webkit.org/show_bug.cgi?id=109461
+
+        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):
+
 2013-02-14  Tony Chang  <[email protected]>
 
         Unreviewed, set svn:eol-style CRLF for .sln files.

Modified: trunk/Source/WebCore/Modules/encryptedmedia/CDM.h (142917 => 142918)


--- trunk/Source/WebCore/Modules/encryptedmedia/CDM.h	2013-02-14 22:04:11 UTC (rev 142917)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDM.h	2013-02-14 22:26:53 UTC (rev 142918)
@@ -53,7 +53,7 @@
     virtual const String& sessionId() = 0;
     virtual PassRefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode) = 0;
     virtual void releaseKeys() = 0;
-    virtual bool addKey(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) = 0;
+    virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) = 0;
 };
 
 class CDM {

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp (142917 => 142918)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp	2013-02-14 22:04:11 UTC (rev 142917)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp	2013-02-14 22:26:53 UTC (rev 142918)
@@ -138,7 +138,7 @@
     }
 }
 
-void MediaKeySession::addKey(Uint8Array* key, ExceptionCode& ec)
+void MediaKeySession::update(Uint8Array* key, ExceptionCode& ec)
 {
     // From <http://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/encrypted-media.html#dom-addkey>:
     // The addKey(key) method must run the following steps:
@@ -165,7 +165,7 @@
         unsigned short errorCode = 0;
         unsigned long systemCode = 0;
 
-        // NOTE: Continued from step 2. of MediaKeySession::addKey()
+        // NOTE: Continued from step 2. of MediaKeySession::update()
         // 2.1. Let cdm be the cdm loaded in the MediaKeys constructor.
         // NOTE: This is m_session.
         // 2.2. Let 'did store key' be false.
@@ -173,7 +173,7 @@
         // 2.3. Let 'next message' be null.
         RefPtr<Uint8Array> nextMessage;
         // 2.4. Use cdm to handle key.
-        didStoreKey = m_session->addKey(pendingKey.get(), nextMessage, errorCode, systemCode);
+        didStoreKey = m_session->update(pendingKey.get(), nextMessage, errorCode, systemCode);
         // 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.
         // TODO: Find and restart the media element
 

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h (142917 => 142918)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h	2013-02-14 22:04:11 UTC (rev 142917)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h	2013-02-14 22:26:53 UTC (rev 142918)
@@ -60,7 +60,7 @@
     MediaKeys* keys() const { return m_keys; }
 
     void generateKeyRequest(const String& mimeType, Uint8Array* initData);
-    void addKey(Uint8Array* key, ExceptionCode&);
+    void update(Uint8Array* key, ExceptionCode&);
     void close();
 
     using RefCounted<MediaKeySession>::ref;

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl (142917 => 142918)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl	2013-02-14 22:04:11 UTC (rev 142917)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl	2013-02-14 22:26:53 UTC (rev 142918)
@@ -36,7 +36,7 @@
     readonly attribute DOMString sessionId;
 
     // session operations
-    void addKey(in Uint8Array key)
+    void update(in Uint8Array key)
         raises(DOMException);
     void close();
     

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (142917 => 142918)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2013-02-14 22:04:11 UTC (rev 142917)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2013-02-14 22:26:53 UTC (rev 142918)
@@ -2543,7 +2543,7 @@
 #if ENABLE(ENCRYPTED_MEDIA_V2)
     static bool firstTime = true;
     if (firstTime && context() && context()->scriptExecutionContext()) {
-        context()->scriptExecutionContext()->addConsoleMessage(JSMessageSource, WarningMessageLevel, "'HTMLMediaElement.webkitAddKey()' is deprecated.  Use 'MediaKeySession.addKey()' instead.");
+        context()->scriptExecutionContext()->addConsoleMessage(JSMessageSource, WarningMessageLevel, "'HTMLMediaElement.webkitAddKey()' is deprecated.  Use 'MediaKeySession.update()' instead.");
         firstTime = false;
     }
 #endif

Modified: trunk/Source/WebCore/testing/MockCDM.cpp (142917 => 142918)


--- trunk/Source/WebCore/testing/MockCDM.cpp	2013-02-14 22:04:11 UTC (rev 142917)
+++ trunk/Source/WebCore/testing/MockCDM.cpp	2013-02-14 22:26:53 UTC (rev 142918)
@@ -42,7 +42,7 @@
     virtual const String& sessionId() OVERRIDE { return m_sessionId; }
     virtual PassRefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode) OVERRIDE;
     virtual void releaseKeys() OVERRIDE;
-    virtual bool addKey(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) OVERRIDE;
+    virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) OVERRIDE;
 
 protected:
     MockCDMSession();
@@ -128,7 +128,7 @@
     // no-op
 }
 
-bool MockCDMSession::addKey(Uint8Array* key, RefPtr<Uint8Array>&, unsigned short& errorCode, unsigned long&)
+bool MockCDMSession::update(Uint8Array* key, RefPtr<Uint8Array>&, unsigned short& errorCode, unsigned long&)
 {
     for (unsigned i = 0; i < keyPrefix()->length(); ++i) {
         if (i >= key->length() || key->item(i) != keyPrefix()->item(i)) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to