Title: [179054] trunk
Revision
179054
Author
[email protected]
Date
2015-01-23 19:05:36 -0800 (Fri, 23 Jan 2015)

Log Message

Unreviewed, rolling out r179051.
https://bugs.webkit.org/show_bug.cgi?id=140850

broke the 32-bit build (Requested by thorton on #webkit).

Reverted changeset:

"[Mac][EME] Support ClearKey encryption with AES128-encrypted
HLS"
https://bugs.webkit.org/show_bug.cgi?id=140825
http://trac.webkit.org/changeset/179051

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (179053 => 179054)


--- trunk/LayoutTests/ChangeLog	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/LayoutTests/ChangeLog	2015-01-24 03:05:36 UTC (rev 179054)
@@ -1,3 +1,17 @@
+2015-01-23  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r179051.
+        https://bugs.webkit.org/show_bug.cgi?id=140850
+
+        broke the 32-bit build (Requested by thorton on #webkit).
+
+        Reverted changeset:
+
+        "[Mac][EME] Support ClearKey encryption with AES128-encrypted
+        HLS"
+        https://bugs.webkit.org/show_bug.cgi?id=140825
+        http://trac.webkit.org/changeset/179051
+
 2015-01-23  Jer Noble  <[email protected]>
 
         [Mac][EME] Support ClearKey encryption with AES128-encrypted HLS

Modified: trunk/LayoutTests/media/video-test.js (179053 => 179054)


--- trunk/LayoutTests/media/video-test.js	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/LayoutTests/media/video-test.js	2015-01-24 03:05:36 UTC (rev 179054)
@@ -203,11 +203,6 @@
     mediaElement.addEventListener(eventName, _eventCallback, true);
 }
 
-function waitForEventOnceOn(element, eventName, func, endit)
-{
-    waitForEventOn(element, eventName, func, endit, true);
-}
-
 function waitForEventOn(element, eventName, func, endit, oneTimeOnly)
 {
     waitForEvent(eventName, func, endit, oneTimeOnly, element);

Modified: trunk/Source/WebCore/CMakeLists.txt (179053 => 179054)


--- trunk/Source/WebCore/CMakeLists.txt	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/CMakeLists.txt	2015-01-24 03:05:36 UTC (rev 179054)
@@ -2734,8 +2734,6 @@
     list(APPEND WebCore_SOURCES
         Modules/encryptedmedia/CDM.cpp
         Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp
-        Modules/encryptedmedia/CDMPrivateClearKey.cpp
-        Modules/encryptedmedia/CDMSessionClearKey.cpp
         Modules/encryptedmedia/MediaKeyMessageEvent.cpp
         Modules/encryptedmedia/MediaKeyNeededEvent.cpp
         Modules/encryptedmedia/MediaKeys.cpp

Modified: trunk/Source/WebCore/ChangeLog (179053 => 179054)


--- trunk/Source/WebCore/ChangeLog	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/ChangeLog	2015-01-24 03:05:36 UTC (rev 179054)
@@ -1,3 +1,17 @@
+2015-01-23  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r179051.
+        https://bugs.webkit.org/show_bug.cgi?id=140850
+
+        broke the 32-bit build (Requested by thorton on #webkit).
+
+        Reverted changeset:
+
+        "[Mac][EME] Support ClearKey encryption with AES128-encrypted
+        HLS"
+        https://bugs.webkit.org/show_bug.cgi?id=140825
+        http://trac.webkit.org/changeset/179051
+
 2015-01-23  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Rename InjectedScriptHost::type to subtype

Modified: trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp (179053 => 179054)


--- trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp	2015-01-24 03:05:36 UTC (rev 179054)
@@ -29,7 +29,6 @@
 
 #include "CDM.h"
 
-#include "CDMPrivateClearKey.h"
 #include "CDMPrivateMediaPlayer.h"
 #include "CDMSession.h"
 #include "MediaKeyError.h"
@@ -66,8 +65,6 @@
     if (!queriedCDMs) {
         queriedCDMs = true;
 
-        cdms.get().append(new CDMFactory(CDMPrivateClearKey::create, CDMPrivateClearKey::supportsKeySystem, CDMPrivateClearKey::supportsKeySystemAndMimeType));
-
         // FIXME: initialize specific UA CDMs. http://webkit.org/b/109318, http://webkit.org/b/109320
         cdms.get().append(new CDMFactory(CDMPrivateMediaPlayer::create, CDMPrivateMediaPlayer::supportsKeySystem, CDMPrivateMediaPlayer::supportsKeySystemAndMimeType));
 

Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.cpp (179053 => 179054)


--- trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.cpp	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.cpp	2015-01-24 03:05:36 UTC (rev 179054)
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "CDMPrivateClearKey.h"
-
-#if ENABLE(ENCRYPTED_MEDIA_V2)
-
-#include "CDM.h"
-#include "CDMSessionClearKey.h"
-#include "ContentType.h"
-#include "ExceptionCode.h"
-#include "MediaPlayer.h"
-
-namespace WebCore {
-
-bool CDMPrivateClearKey::supportsKeySystem(const String& keySystem)
-{
-    if (!equalIgnoringCase(keySystem, "org.w3c.clearkey"))
-        return false;
-
-    // The MediaPlayer must also support the key system:
-    return MediaPlayer::supportsKeySystem(keySystem, emptyString());
-}
-
-bool CDMPrivateClearKey::supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType)
-{
-    if (!equalIgnoringCase(keySystem, "org.w3c.clearkey"))
-        return false;
-
-    // The MediaPlayer must also support the key system:
-    return MediaPlayer::supportsKeySystem(keySystem, mimeType);
-}
-
-bool CDMPrivateClearKey::supportsMIMEType(const String& mimeType)
-{
-    return MediaPlayer::supportsKeySystem(m_cdm->keySystem(), mimeType);
-}
-
-std::unique_ptr<CDMSession> CDMPrivateClearKey::createSession()
-{
-    return std::make_unique<CDMSessionClearKey>();
-}
-
-}
-
-#endif

Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.h (179053 => 179054)


--- trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.h	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.h	2015-01-24 03:05:36 UTC (rev 179054)
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef CDMPrivateClearKey_h
-#define CDMPrivateClearKey_h
-
-#if ENABLE(ENCRYPTED_MEDIA_V2)
-
-#include "CDMPrivate.h"
-
-namespace WebCore {
-
-class CDM;
-
-class CDMPrivateClearKey : public CDMPrivateInterface {
-public:
-    static std::unique_ptr<CDMPrivateInterface> create(CDM* cdm) { return std::unique_ptr<CDMPrivateInterface>(new CDMPrivateClearKey(cdm)); }
-    virtual ~CDMPrivateClearKey() { }
-
-    static bool supportsKeySystem(const String&);
-    static bool supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType);
-
-    virtual bool supportsMIMEType(const String& mimeType) override;
-    virtual std::unique_ptr<CDMSession> createSession() override;
-
-protected:
-    explicit CDMPrivateClearKey(CDM* cdm)
-        : m_cdm(cdm)
-    {
-    }
-
-    CDM* m_cdm;
-};
-
-}
-
-#endif // ENABLE(ENCRYPTED_MEDIA_V2)
-
-#endif // CDMPrivateClearKey_h

Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp (179053 => 179054)


--- trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp	2015-01-24 03:05:36 UTC (rev 179054)
@@ -1,193 +0,0 @@
-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "CDMSessionClearKey.h"
-
-#include "ArrayValue.h"
-#include "CryptoAlgorithm.h"
-#include "CryptoAlgorithmIdentifier.h"
-#include "CryptoAlgorithmParameters.h"
-#include "CryptoKeyDataOctetSequence.h"
-#include "Dictionary.h"
-#include "JSMainThreadExecState.h"
-#include "Logging.h"
-#include "MediaKeyError.h"
-#include "TextEncoding.h"
-#include "UUID.h"
-#include <runtime/JSGlobalObject.h>
-#include <runtime/JSLock.h>
-#include <runtime/JSONObject.h>
-#include <runtime/VM.h>
-#include <wtf/NeverDestroyed.h>
-#include <wtf/text/Base64.h>
-
-#if ENABLE(ENCRYPTED_MEDIA_V2)
-
-using namespace JSC;
-
-namespace WebCore {
-
-static VM& clearKeyVM()
-{
-    static NeverDestroyed<RefPtr<VM>> vm;
-    if (!vm.get())
-        vm.get() = VM::create();
-
-    return *vm.get();
-}
-
-CDMSessionClearKey::CDMSessionClearKey()
-    : m_sessionId(createCanonicalUUIDString())
-{
-}
-
-CDMSessionClearKey::~CDMSessionClearKey()
-{
-}
-
-PassRefPtr<Uint8Array> CDMSessionClearKey::generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode)
-{
-    UNUSED_PARAM(mimeType);
-    UNUSED_PARAM(destinationURL);
-    UNUSED_PARAM(systemCode);
-
-    if (!initData) {
-        errorCode = MediaKeyError::MEDIA_KEYERR_CLIENT;
-        return nullptr;
-    }
-    m_initData = initData;
-
-    bool sawError = false;
-    String keyID = UTF8Encoding().decode(reinterpret_cast_ptr<char*>(m_initData->baseAddress()), m_initData->byteLength(), true, sawError);
-    if (sawError) {
-        errorCode = MediaKeyError::MEDIA_KEYERR_CLIENT;
-        return nullptr;
-    }
-
-    return initData;
-}
-
-void CDMSessionClearKey::releaseKeys()
-{
-    m_cachedKeys.clear();
-}
-
-bool CDMSessionClearKey::update(Uint8Array* rawKeysData, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode)
-{
-    UNUSED_PARAM(nextMessage);
-    UNUSED_PARAM(systemCode);
-    ASSERT(rawKeysData);
-
-    do {
-        String rawKeysString = String::fromUTF8(rawKeysData->data(), rawKeysData->length());
-        if (rawKeysString.isEmpty())  {
-            LOG(Media, "CDMSessionClearKey::update(%p) - failed: empty message", this);
-            continue;
-        }
-
-        VM& vm = clearKeyVM();
-        JSLockHolder lock(vm);
-        JSGlobalObject* globalObject = JSGlobalObject::create(vm, JSGlobalObject::createStructure(vm, jsNull()));
-        ExecState* exec = globalObject->globalExec();
-
-        JSLockHolder locker(clearKeyVM());
-        JSValue keysDataObject = JSONParse(exec, rawKeysString);
-        if (exec->hadException() || !keysDataObject) {
-            LOG(Media, "CDMSessionClearKey::update(%p) - failed: invalid JSON", this);
-            break;
-        }
-        Dictionary keysDataDictionary(exec, keysDataObject);
-        ArrayValue keysArray;
-        size_t length;
-        if (!keysDataDictionary.get("keys", keysArray) || keysArray.isUndefinedOrNull() || !keysArray.length(length) || !length) {
-            LOG(Media, "CDMSessionClearKey::update(%p) - failed: keys array missing or empty", this);
-            break;
-        }
-
-        bool foundValidKey = false;
-        for (size_t i = 0; i < length; ++i) {
-            Dictionary keyDictionary;
-            if (!keysArray.get(i, keyDictionary) || keyDictionary.isUndefinedOrNull()) {
-                LOG(Media, "CDMSessionClearKey::update(%p) - failed: null keyDictionary", this);
-                continue;
-            }
-
-            String algorithm;
-            if (!keyDictionary.get("alg", algorithm) || !equalIgnoringCase(algorithm, "a128kw")) {
-                LOG(Media, "CDMSessionClearKey::update(%p) - failed: algorithm unsupported", this);
-                continue;
-            }
-
-            String keyType;
-            if (!keyDictionary.get("kty", keyType) || !equalIgnoringCase(keyType, "oct")) {
-                LOG(Media, "CDMSessionClearKey::update(%p) - failed: keyType unsupported", this);
-                continue;
-            }
-
-            String keyId;
-            if (!keyDictionary.get("kid", keyId) || keyId.isEmpty()) {
-                LOG(Media, "CDMSessionClearKey::update(%p) - failed: keyId missing or empty", this);
-                continue;
-            }
-
-            String rawKeyData;
-            if (!keyDictionary.get("k", rawKeyData) || rawKeyData.isEmpty())  {
-                LOG(Media, "CDMSessionClearKey::update(%p) - failed: key missing or empty", this);
-                continue;
-            }
-
-            Vector<uint8_t> keyData;
-            if (!base64Decode(rawKeyData, keyData) ||  keyData.isEmpty()) {
-                LOG(Media, "CDMSessionClearKey::update(%p) - failed: unable to base64 decode key", this);
-                continue;
-            }
-
-            m_cachedKeys.set(keyId, WTF::move(keyData));
-            foundValidKey = true;
-        }
-
-        if (foundValidKey)
-            return true;
-
-    } while (false);
-
-    errorCode = MediaKeyError::MEDIA_KEYERR_CLIENT;
-    return false;
-}
-
-RefPtr<ArrayBuffer> CDMSessionClearKey::cachedKeyForKeyID(const String& keyId) const
-{
-    if (!m_cachedKeys.contains(keyId))
-        return nullptr;
-
-    auto keyData = m_cachedKeys.get(keyId);
-    RefPtr<Uint8Array> keyDataArray = Uint8Array::create(keyData.data(), keyData.size());
-    return keyDataArray->buffer();
-}
-
-}
-
-#endif

Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.h (179053 => 179054)


--- trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.h	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.h	2015-01-24 03:05:36 UTC (rev 179054)
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef CDMSessionClearKey_h
-#define CDMSessionClearKey_h
-
-#include "CDMSession.h"
-#include <wtf/HashMap.h>
-
-#if ENABLE(ENCRYPTED_MEDIA_V2)
-
-namespace WebCore {
-
-class CDMSessionClearKey : public CDMSession {
-public:
-    CDMSessionClearKey();
-    virtual ~CDMSessionClearKey();
-
-    // CDMSessionPrivate
-    virtual CDMSessionType type() override { return CDMSessionTypeClearKey; }
-    virtual void setClient(CDMSessionClient* client) override { m_client = client; }
-    virtual const String& sessionId() const override { return m_sessionId; }
-    virtual PassRefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array*, String&, unsigned short&, unsigned long&) override;
-    virtual void releaseKeys() override;
-    virtual bool update(Uint8Array*, RefPtr<Uint8Array>&, unsigned short&, unsigned long&) override;
-    virtual RefPtr<ArrayBuffer> cachedKeyForKeyID(const String&) const override;
-
-protected:
-    CDMSessionClient* m_client;
-    RefPtr<Uint8Array> m_initData;
-    HashMap<String, Vector<uint8_t>> m_cachedKeys;
-    String m_sessionId;
-};
-
-}
-
-#endif // ENABLE(ENCRYPTED_MEDIA_V2)
-
-#endif // CDMSessionClearKey_h

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp (179053 => 179054)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp	2015-01-24 03:05:36 UTC (rev 179054)
@@ -80,11 +80,6 @@
         m_session->releaseKeys();
 }
 
-RefPtr<ArrayBuffer> MediaKeySession::cachedKeyForKeyId(const String& keyId) const
-{
-    return m_session ? m_session->cachedKeyForKeyID(keyId) : nullptr;
-}
-
 const String& MediaKeySession::sessionId() const
 {
     return m_session->sessionId();
@@ -189,8 +184,6 @@
             RefPtr<Event> keyaddedEvent = Event::create(eventNames().webkitkeyaddedEvent, false, false);
             keyaddedEvent->setTarget(this);
             m_asyncEventQueue.enqueueEvent(keyaddedEvent.release());
-
-            keys()->keyAdded();
         }
 
         // 2.8. If any of the preceding steps in the task failed

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h (179053 => 179054)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h	2015-01-24 03:05:36 UTC (rev 179054)
@@ -66,8 +66,6 @@
     bool isClosed() const { return !m_session; }
     void close();
 
-    RefPtr<ArrayBuffer> cachedKeyForKeyId(const String& keyId) const;
-
     using RefCounted<MediaKeySession>::ref;
     using RefCounted<MediaKeySession>::deref;
 

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp (179053 => 179054)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp	2015-01-24 03:05:36 UTC (rev 179054)
@@ -160,22 +160,6 @@
     return 0;
 }
 
-void MediaKeys::keyAdded()
-{
-    if (m_mediaElement)
-        m_mediaElement->keyAdded();
-
 }
 
-RefPtr<ArrayBuffer> MediaKeys::cachedKeyForKeyId(const String& keyId) const
-{
-    for (auto& session : m_sessions) {
-        if (RefPtr<ArrayBuffer> key = session->cachedKeyForKeyId(keyId))
-            return key;
-    }
-    return nullptr;
-}
-
-}
-
 #endif

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h (179053 => 179054)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h	2015-01-24 03:05:36 UTC (rev 179054)
@@ -57,9 +57,6 @@
     HTMLMediaElement* mediaElement() const { return m_mediaElement; }
     void setMediaElement(HTMLMediaElement*);
 
-    void keyAdded();
-    RefPtr<ArrayBuffer> cachedKeyForKeyId(const String& keyId) const;
-
 protected:
     // CDMClient:
     virtual MediaPlayer* cdmMediaPlayer(const CDM*) const override;

Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (179053 => 179054)


--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj	2015-01-24 03:05:36 UTC (rev 179054)
@@ -6788,8 +6788,6 @@
     </ClCompile>
     <ClCompile Include="..\Modules\encryptedmedia\CDM.cpp" />
     <ClCompile Include="..\Modules\encryptedmedia\CDMPrivateMediaPlayer.cpp" />
-    <ClCompile Include="..\Modules\encryptedmedia\CDMPrivateClearKey.cpp" />
-    <ClCompile Include="..\Modules\encryptedmedia\CDMSessionClearKey.cpp" />
     <ClCompile Include="..\Modules\encryptedmedia\MediaKeyMessageEvent.cpp" />
     <ClCompile Include="..\Modules\encryptedmedia\MediaKeyNeededEvent.cpp" />
     <ClCompile Include="..\Modules\encryptedmedia\MediaKeys.cpp" />
@@ -19007,8 +19005,6 @@
     <ClInclude Include="..\Modules\encryptedmedia\CDM.h" />
     <ClInclude Include="..\Modules\encryptedmedia\CDMPrivate.h" />
     <ClInclude Include="..\Modules\encryptedmedia\CDMPrivateMediaPlayer.h" />
-    <ClInclude Include="..\Modules\encryptedmedia\CDMPrivateClearKey.h" />
-    <ClInclude Include="..\Modules\encryptedmedia\CDMSessionClearKey.h" />
     <ClInclude Include="..\Modules\encryptedmedia\MediaKeyMessageEvent.h" />
     <ClInclude Include="..\Modules\encryptedmedia\MediaKeyNeededEvent.h" />
     <ClInclude Include="..\Modules\encryptedmedia\MediaKeys.h" />

Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (179053 => 179054)


--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters	2015-01-24 03:05:36 UTC (rev 179054)
@@ -6922,12 +6922,6 @@
     <ClCompile Include="..\Modules\encryptedmedia\CDMPrivateMediaPlayer.cpp">
       <Filter>Modules\encryptedmedia</Filter>
     </ClCompile>
-    <ClCompile Include="..\Modules\encryptedmedia\CDMPrivateClearKey.cpp">
-      <Filter>Modules\encryptedmedia</Filter>
-    </ClCompile>
-    <ClCompile Include="..\Modules\encryptedmedia\CDMSessionClearKey.cpp">
-      <Filter>Modules\encryptedmedia</Filter>
-    </ClCompile>
     <ClCompile Include="..\Modules\encryptedmedia\MediaKeyMessageEvent.cpp">
       <Filter>Modules\encryptedmedia</Filter>
     </ClCompile>
@@ -14288,12 +14282,6 @@
     <ClInclude Include="..\Modules\encryptedmedia\CDMPrivateMediaPlayer.h">
       <Filter>Modules\encryptedmedia</Filter>
     </ClInclude>
-    <ClInclude Include="..\Modules\encryptedmedia\CDMPrivateClearKey.h">
-      <Filter>Modules\encryptedmedia</Filter>
-    </ClInclude>
-    <ClInclude Include="..\Modules\encryptedmedia\CDMSessionClearKey.h">
-      <Filter>Modules\encryptedmedia</Filter>
-    </ClInclude>
     <ClInclude Include="..\Modules\encryptedmedia\MediaKeyMessageEvent.h">
       <Filter>Modules\encryptedmedia</Filter>
     </ClInclude>

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (179053 => 179054)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-01-24 03:05:36 UTC (rev 179054)
@@ -5750,10 +5750,6 @@
 		CDE83DB1183C44060031EAA3 /* VideoPlaybackQuality.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDE83DAF183C44060031EAA3 /* VideoPlaybackQuality.cpp */; };
 		CDE83DB2183C44060031EAA3 /* VideoPlaybackQuality.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE83DB0183C44060031EAA3 /* VideoPlaybackQuality.h */; };
 		CDE83DB6183D352A0031EAA3 /* JSVideoPlaybackQuality.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDE83DB4183D352A0031EAA3 /* JSVideoPlaybackQuality.cpp */; };
-		CDE8B5EC1A69777300B4B66A /* CDMPrivateClearKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDE8B5EA1A69777300B4B66A /* CDMPrivateClearKey.cpp */; };
-		CDE8B5ED1A69777300B4B66A /* CDMPrivateClearKey.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE8B5EB1A69777300B4B66A /* CDMPrivateClearKey.h */; };
-		CDE8B5F01A69778B00B4B66A /* CDMSessionClearKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDE8B5EE1A69778B00B4B66A /* CDMSessionClearKey.cpp */; };
-		CDE8B5F11A69778B00B4B66A /* CDMSessionClearKey.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE8B5EF1A69778B00B4B66A /* CDMSessionClearKey.h */; };
 		CDEA763014608A53008B31F1 /* PlatformClockCA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEA762E146084DE008B31F1 /* PlatformClockCA.cpp */; };
 		CDEA76341460B56F008B31F1 /* ClockGeneric.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEA76321460AE29008B31F1 /* ClockGeneric.cpp */; };
 		CDEA76351460B71A008B31F1 /* Clock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEA76331460B462008B31F1 /* Clock.cpp */; };
@@ -13256,10 +13252,6 @@
 		CDE83DB3183C441E0031EAA3 /* VideoPlaybackQuality.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = VideoPlaybackQuality.idl; sourceTree = "<group>"; };
 		CDE83DB4183D352A0031EAA3 /* JSVideoPlaybackQuality.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVideoPlaybackQuality.cpp; sourceTree = "<group>"; };
 		CDE83DB5183D352A0031EAA3 /* JSVideoPlaybackQuality.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVideoPlaybackQuality.h; sourceTree = "<group>"; };
-		CDE8B5EA1A69777300B4B66A /* CDMPrivateClearKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CDMPrivateClearKey.cpp; sourceTree = "<group>"; };
-		CDE8B5EB1A69777300B4B66A /* CDMPrivateClearKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMPrivateClearKey.h; sourceTree = "<group>"; };
-		CDE8B5EE1A69778B00B4B66A /* CDMSessionClearKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CDMSessionClearKey.cpp; sourceTree = "<group>"; };
-		CDE8B5EF1A69778B00B4B66A /* CDMSessionClearKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMSessionClearKey.h; sourceTree = "<group>"; };
 		CDEA762C14608224008B31F1 /* Clock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Clock.h; sourceTree = "<group>"; };
 		CDEA762E146084DE008B31F1 /* PlatformClockCA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformClockCA.cpp; sourceTree = "<group>"; };
 		CDEA762F146084EE008B31F1 /* PlatformClockCA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformClockCA.h; sourceTree = "<group>"; };
@@ -21664,10 +21656,6 @@
 				CDA98DC716014F2C00FEA3B1 /* MediaKeySession.cpp */,
 				CDA98DC816014F2C00FEA3B1 /* MediaKeySession.h */,
 				CDA98DC916014F4000FEA3B1 /* MediaKeySession.idl */,
-				CDE8B5EA1A69777300B4B66A /* CDMPrivateClearKey.cpp */,
-				CDE8B5EB1A69777300B4B66A /* CDMPrivateClearKey.h */,
-				CDE8B5EE1A69778B00B4B66A /* CDMSessionClearKey.cpp */,
-				CDE8B5EF1A69778B00B4B66A /* CDMSessionClearKey.h */,
 			);
 			path = encryptedmedia;
 			sourceTree = "<group>";
@@ -25770,7 +25758,6 @@
 				D23CA56C0AB0EB8D005108A5 /* RangeException.h in Headers */,
 				F55B3DCE1251F12D003EF269 /* RangeInputType.h in Headers */,
 				6E84E9E117668BF100815B68 /* RasterShape.h in Headers */,
-				CDE8B5F11A69778B00B4B66A /* CDMSessionClearKey.h in Headers */,
 				A84D827C11D333ED00972990 /* RawDataDocumentParser.h in Headers */,
 				FD31603C12B0267600C1A359 /* RealtimeAnalyser.h in Headers */,
 				BC4368E80C226E32005EFB5F /* Rect.h in Headers */,
@@ -26553,7 +26540,6 @@
 				E4C91A0E1802343100A17F6D /* TextPaintStyle.h in Headers */,
 				930FC68A1072B9280045293E /* TextRenderingMode.h in Headers */,
 				93F198F608245E59001E9ABC /* TextResourceDecoder.h in Headers */,
-				CDE8B5ED1A69777300B4B66A /* CDMPrivateClearKey.h in Headers */,
 				A824B4650E2EF2EA0081A7B7 /* TextRun.h in Headers */,
 				448B1B7A0F3A2F9B0047A9E2 /* TextSizeAdjustment.h in Headers */,
 				B2C3DA4B0D006C1D00EF6F26 /* TextStream.h in Headers */,
@@ -28358,7 +28344,6 @@
 				590E1B4B11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp in Sources */,
 				BCE438A2140C0DC0005E437E /* JSDictionary.cpp in Sources */,
 				659DDC8209E198BA001BF3C6 /* JSDocument.cpp in Sources */,
-				CDE8B5F01A69778B00B4B66A /* CDMSessionClearKey.cpp in Sources */,
 				49C7BA8D1042F5B10009D447 /* JSDocumentCustom.cpp in Sources */,
 				1A494EDE0A123F4C00FDAFC1 /* JSDocumentFragment.cpp in Sources */,
 				65DF31F509D1CC60000BE325 /* JSDocumentType.cpp in Sources */,
@@ -28740,7 +28725,6 @@
 				08A48A6E0E86CF6D00E225DD /* JSSVGElementInstanceCustom.cpp in Sources */,
 				8542A79A0AE5C94400DF58DF /* JSSVGElementWrapperFactory.cpp in Sources */,
 				B2FA3D680AB75A6F000E5AC4 /* JSSVGEllipseElement.cpp in Sources */,
-				CDE8B5EC1A69777300B4B66A /* CDMPrivateClearKey.cpp in Sources */,
 				B266CD4D0C3AEC6500EB08D2 /* JSSVGException.cpp in Sources */,
 				B2FA3D6A0AB75A6F000E5AC4 /* JSSVGFEBlendElement.cpp in Sources */,
 				B2FA3D6C0AB75A6F000E5AC4 /* JSSVGFEColorMatrixElement.cpp in Sources */,

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (179053 => 179054)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2015-01-24 03:05:36 UTC (rev 179054)
@@ -2182,11 +2182,6 @@
 #endif
 
 #if ENABLE(ENCRYPTED_MEDIA_V2)
-RefPtr<ArrayBuffer> HTMLMediaElement::mediaPlayerCachedKeyForKeyId(const String& keyId) const
-{
-    return m_mediaKeys ? m_mediaKeys->cachedKeyForKeyId(keyId) : nullptr;
-}
-
 bool HTMLMediaElement::mediaPlayerKeyNeeded(MediaPlayer*, Uint8Array* initData)
 {
     if (!hasEventListeners("webkitneedkey")) {
@@ -2235,12 +2230,6 @@
     if (m_mediaKeys)
         m_mediaKeys->setMediaElement(this);
 }
-
-void HTMLMediaElement::keyAdded()
-{
-    if (m_player)
-        m_player->keyAdded();
-}
 #endif
 
 void HTMLMediaElement::progressEventTimerFired()

Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (179053 => 179054)


--- trunk/Source/WebCore/html/HTMLMediaElement.h	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h	2015-01-24 03:05:36 UTC (rev 179054)
@@ -242,8 +242,6 @@
 #if ENABLE(ENCRYPTED_MEDIA_V2)
     MediaKeys* keys() const { return m_mediaKeys.get(); }
     void setMediaKeys(MediaKeys*);
-
-    void keyAdded();
 #endif
 
 // controls
@@ -565,7 +563,6 @@
 #endif
 
 #if ENABLE(ENCRYPTED_MEDIA_V2)
-    virtual RefPtr<ArrayBuffer> mediaPlayerCachedKeyForKeyId(const String& keyId) const override;
     virtual bool mediaPlayerKeyNeeded(MediaPlayer*, Uint8Array*) override;
     virtual String mediaPlayerMediaKeysStorageDirectory() const override;
 #endif

Modified: trunk/Source/WebCore/platform/graphics/CDMSession.h (179053 => 179054)


--- trunk/Source/WebCore/platform/graphics/CDMSession.h	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/platform/graphics/CDMSession.h	2015-01-24 03:05:36 UTC (rev 179054)
@@ -56,7 +56,6 @@
 
 enum CDMSessionType {
     CDMSessionTypeUnknown,
-    CDMSessionTypeClearKey,
     CDMSessionTypeAVFoundationObjC,
     CDMSessionTypeMediaSourceAVFObjC,
 };
@@ -72,7 +71,6 @@
     virtual PassRefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, unsigned long& systemCode) = 0;
     virtual void releaseKeys() = 0;
     virtual bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode) = 0;
-    virtual RefPtr<ArrayBuffer> cachedKeyForKeyID(const String&) const { return nullptr; }
 };
 
 }

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (179053 => 179054)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2015-01-24 03:05:36 UTC (rev 179054)
@@ -504,11 +504,6 @@
 {
     m_private->setCDMSession(session);
 }
-
-void MediaPlayer::keyAdded()
-{
-    m_private->keyAdded();
-}
 #endif
     
 MediaTime MediaPlayer::duration() const
@@ -1124,11 +1119,6 @@
 #endif
 
 #if ENABLE(ENCRYPTED_MEDIA_V2)
-RefPtr<ArrayBuffer> MediaPlayer::cachedKeyForKeyId(const String& keyId) const
-{
-    return m_client.mediaPlayerCachedKeyForKeyId(keyId);
-}
-
 bool MediaPlayer::keyNeeded(Uint8Array* initData)
 {
     return m_client.mediaPlayerKeyNeeded(this, initData);

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (179053 => 179054)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2015-01-24 03:05:36 UTC (rev 179054)
@@ -210,7 +210,6 @@
 #endif
 
 #if ENABLE(ENCRYPTED_MEDIA_V2)
-    virtual RefPtr<ArrayBuffer> mediaPlayerCachedKeyForKeyId(const String&) const { return nullptr; }
     virtual bool mediaPlayerKeyNeeded(MediaPlayer*, Uint8Array*) { return false; }
     virtual String mediaPlayerMediaKeysStorageDirectory() const { return emptyString(); }
 #endif
@@ -351,7 +350,6 @@
 #if ENABLE(ENCRYPTED_MEDIA_V2)
     std::unique_ptr<CDMSession> createSession(const String& keySystem);
     void setCDMSession(CDMSession*);
-    void keyAdded();
 #endif
 
     bool paused() const;
@@ -518,7 +516,6 @@
 #endif
 
 #if ENABLE(ENCRYPTED_MEDIA_V2)
-    RefPtr<ArrayBuffer> cachedKeyForKeyId(const String& keyId) const;
     bool keyNeeded(Uint8Array* initData);
     String mediaKeysStorageDirectory() const;
 #endif

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (179053 => 179054)


--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2015-01-24 03:05:36 UTC (rev 179054)
@@ -225,7 +225,6 @@
 #if ENABLE(ENCRYPTED_MEDIA_V2)
     virtual std::unique_ptr<CDMSession> createSession(const String&) { return nullptr; }
     virtual void setCDMSession(CDMSession*) { }
-    virtual void keyAdded() { }
 #endif
 
 #if ENABLE(VIDEO_TRACK)

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (179053 => 179054)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2015-01-24 03:05:36 UTC (rev 179054)
@@ -91,7 +91,6 @@
 
 #if ENABLE(ENCRYPTED_MEDIA_V2)
     RetainPtr<AVAssetResourceLoadingRequest> takeRequestForKeyURI(const String&);
-    virtual void keyAdded() override;
 #endif
 
     void playerItemStatusDidChange(int);

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (179053 => 179054)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2015-01-24 02:34:18 UTC (rev 179053)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2015-01-24 03:05:36 UTC (rev 179054)
@@ -52,7 +52,6 @@
 #import "SecurityOrigin.h"
 #import "SerializedPlatformRepresentationMac.h"
 #import "SoftLinking.h"
-#import "TextEncoding.h"
 #import "TextTrackRepresentation.h"
 #import "UUID.h"
 #import "VideoTrackPrivateAVFObjC.h"
@@ -1508,7 +1507,7 @@
 #if ENABLE(ENCRYPTED_MEDIA) || ENABLE(ENCRYPTED_MEDIA_V2)
 static bool keySystemIsSupported(const String& keySystem)
 {
-    if (equalIgnoringCase(keySystem, "com.apple.fps") || equalIgnoringCase(keySystem, "com.apple.fps.1_0") || equalIgnoringCase(keySystem, "org.w3c.clearkey"))
+    if (equalIgnoringCase(keySystem, "com.apple.fps") || equalIgnoringCase(keySystem, "com.apple.fps.1_0"))
         return true;
     return false;
 }
@@ -1523,10 +1522,6 @@
     // 1. Check whether the Key System is supported with the specified container and codec type(s) by following the steps for the first matching condition from the following list:
     //    If keySystem is null, continue to the next step.
     if (!parameters.keySystem.isNull() && !parameters.keySystem.isEmpty()) {
-        // "Clear Key" is only supported with HLS:
-        if (equalIgnoringCase(parameters.keySystem, "org.w3c.clearkey") && !parameters.type.isEmpty() && !equalIgnoringCase(parameters.type, "application/x-mpegurl"))
-            return MediaPlayer::IsNotSupported;
-
         // If keySystem contains an unrecognized or unsupported Key System, return the empty string
         if (!keySystemIsSupported(parameters.keySystem))
             return MediaPlayer::IsNotSupported;
@@ -1559,10 +1554,6 @@
 {
 #if ENABLE(ENCRYPTED_MEDIA) || ENABLE(ENCRYPTED_MEDIA_V2)
     if (!keySystem.isEmpty()) {
-        // "Clear Key" is only supported with HLS:
-        if (equalIgnoringCase(keySystem, "org.w3c.clearkey") && !mimeType.isEmpty() && !equalIgnoringCase(mimeType, "application/x-mpegurl"))
-            return MediaPlayer::IsNotSupported;
-
         if (!keySystemIsSupported(keySystem))
             return false;
 
@@ -1579,35 +1570,6 @@
 }
 
 #if HAVE(AVFOUNDATION_LOADER_DELEGATE)
-#if ENABLE(ENCRYPTED_MEDIA_V2)
-static void fulfillRequestWithKeyData(AVAssetResourceLoadingRequest *request, ArrayBuffer* keyData)
-{
-    if (AVAssetResourceLoadingContentInformationRequest *infoRequest = [request contentInformationRequest]) {
-        [infoRequest setContentLength:keyData->byteLength()];
-        [infoRequest setByteRangeAccessSupported:YES];
-    }
-
-    if (AVAssetResourceLoadingDataRequest *dataRequest = [request dataRequest]) {
-        long start = [dataRequest currentOffset];
-        long long end = std::min<long long>(keyData->byteLength(), [dataRequest currentOffset] + [dataRequest requestedLength]);
-
-        ASSERT(start <= std::numeric_limits<int>::max());
-        ASSERT(end <= std::numeric_limits<int>::max());
-
-        if (start < 0 || end < 0 || start >= keyData->byteLength()) {
-            [request finishLoadingWithError:nil];
-            return;
-        }
-
-        RefPtr<ArrayBuffer> requestedKeyData = keyData->slice(start, end);
-        RetainPtr<NSData> nsData = adoptNS([[NSData alloc] initWithBytes:requestedKeyData->data() length:requestedKeyData->byteLength()]);
-        [dataRequest respondWithData:nsData.get()];
-    }
-
-    [request finishLoading];
-}
-#endif
-
 bool MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource(AVAssetResourceLoadingRequest* avRequest)
 {
     String scheme = [[[avRequest request] URL] scheme];
@@ -1635,27 +1597,6 @@
 
         m_keyURIToRequestMap.set(keyURI, avRequest);
         return true;
-#if ENABLE(ENCRYPTED_MEDIA_V2)
-    } else if (scheme == "clearkey") {
-        String keyID = [[[avRequest request] URL] resourceSpecifier];
-        StringView keyIDView(keyID);
-        CString utf8EncodedKeyId = UTF8Encoding().encode(keyIDView, URLEncodedEntitiesForUnencodables);
-
-        RefPtr<Uint8Array> initData = Uint8Array::create(utf8EncodedKeyId.length());
-        initData->setRange((JSC::Uint8Adaptor::Type*)utf8EncodedKeyId.data(), utf8EncodedKeyId.length(), 0);
-
-        auto keyData = player()->cachedKeyForKeyId(keyID);
-        if (keyData) {
-            fulfillRequestWithKeyData(avRequest, keyData.get());
-            return false;
-        }
-
-        if (!player()->keyNeeded(initData.get()))
-            return false;
-
-        m_keyURIToRequestMap.set(keyID, avRequest);
-        return true;
-#endif
     }
 #endif
 
@@ -2352,26 +2293,6 @@
     return m_keyURIToRequestMap.take(keyURI);
 }
 
-void MediaPlayerPrivateAVFoundationObjC::keyAdded()
-{
-    Vector<String> fulfilledKeyIds;
-
-    for (auto& pair : m_keyURIToRequestMap) {
-        const String& keyId = pair.key;
-        const RetainPtr<AVAssetResourceLoadingRequest>& request = pair.value;
-
-        auto keyData = player()->cachedKeyForKeyId(keyId);
-        if (!keyData)
-            continue;
-
-        fulfillRequestWithKeyData(request.get(), keyData.get());
-        fulfilledKeyIds.append(keyId);
-    }
-
-    for (auto& keyId : fulfilledKeyIds)
-        m_keyURIToRequestMap.remove(keyId);
-}
-
 std::unique_ptr<CDMSession> MediaPlayerPrivateAVFoundationObjC::createSession(const String& keySystem)
 {
     if (!keySystemIsSupported(keySystem))
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to