Title: [219678] trunk/Source/WebCore
Revision
219678
Author
[email protected]
Date
2017-07-19 23:09:56 -0700 (Wed, 19 Jul 2017)

Log Message

[EME] Push CDMInstance, CDMPrivate and associated types into the Platform layer
https://bugs.webkit.org/show_bug.cgi?id=174496

Reviewed by Xabier Rodriguez-Calvar.

Move the CDMInstance and CDMPrivate interfaces into the platform layer, enabling
implementations of specific key systems at that level, as well as integration with
the MediaPlayerPrivate stack without any layering violations.

While the platform layer still uses the WebCore namespace, the two interface files
have now been moved under the platform/encryptedmedia/ directory and out of the
Modules/encryptedmedia/ directory where the Web-facing API implementation resides.

The two interfaces integrated closely with the Web-facing enumerations and
dictionaries: MediaKeyMessageType, MediaKeySessionType, MediaKeyStatus,
MediaKeySystemConfiguration, MediaKeySystemCapability, MediaKeysRequirement
and MediaKeysRestrictions. Definitions of these types are also moved to the
platform layer without any changes (apart from renaming), and the previous
types now alias against the types now located in the platform layer.

No new tests -- no change in behavior.

* CMakeLists.txt:
* Modules/encryptedmedia/CDM.cpp:
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/MediaKeyMessageType.h:
* Modules/encryptedmedia/MediaKeySessionType.h:
* Modules/encryptedmedia/MediaKeyStatus.h:
* Modules/encryptedmedia/MediaKeySystemAccess.cpp:
* Modules/encryptedmedia/MediaKeySystemAccess.h:
* Modules/encryptedmedia/MediaKeySystemConfiguration.h:
* Modules/encryptedmedia/MediaKeySystemMediaCapability.h:
* Modules/encryptedmedia/MediaKeysRequirement.h:
* Modules/encryptedmedia/MediaKeysRestrictions.h:
* platform/encryptedmedia/CDMInstance.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMInstance.h.
* platform/encryptedmedia/CDMKeyStatus.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyStatus.h.
* platform/encryptedmedia/CDMKeySystemConfiguration.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySystemConfiguration.h.
* platform/encryptedmedia/CDMMediaCapability.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySystemMediaCapability.h.
* platform/encryptedmedia/CDMMessageType.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageType.h.
* platform/encryptedmedia/CDMPrivate.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivate.h.
* platform/encryptedmedia/CDMRequirement.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeysRequirement.h.
* platform/encryptedmedia/CDMRestrictions.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeysRestrictions.h.
* platform/encryptedmedia/CDMSessionType.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySessionType.h.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (219677 => 219678)


--- trunk/Source/WebCore/CMakeLists.txt	2017-07-20 06:08:28 UTC (rev 219677)
+++ trunk/Source/WebCore/CMakeLists.txt	2017-07-20 06:09:56 UTC (rev 219678)
@@ -83,6 +83,7 @@
     "${WEBCORE_DIR}/platform/animation"
     "${WEBCORE_DIR}/platform/audio"
     "${WEBCORE_DIR}/platform/crypto"
+    "${WEBCORE_DIR}/platform/encryptedmedia"
     "${WEBCORE_DIR}/platform/gamepad"
     "${WEBCORE_DIR}/platform/gamepad/deprecated"
     "${WEBCORE_DIR}/platform/gamepad/linux"

Modified: trunk/Source/WebCore/ChangeLog (219677 => 219678)


--- trunk/Source/WebCore/ChangeLog	2017-07-20 06:08:28 UTC (rev 219677)
+++ trunk/Source/WebCore/ChangeLog	2017-07-20 06:09:56 UTC (rev 219678)
@@ -1,5 +1,51 @@
 2017-07-19  Zan Dobersek  <[email protected]>
 
+        [EME] Push CDMInstance, CDMPrivate and associated types into the Platform layer
+        https://bugs.webkit.org/show_bug.cgi?id=174496
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Move the CDMInstance and CDMPrivate interfaces into the platform layer, enabling
+        implementations of specific key systems at that level, as well as integration with
+        the MediaPlayerPrivate stack without any layering violations.
+
+        While the platform layer still uses the WebCore namespace, the two interface files
+        have now been moved under the platform/encryptedmedia/ directory and out of the
+        Modules/encryptedmedia/ directory where the Web-facing API implementation resides.
+
+        The two interfaces integrated closely with the Web-facing enumerations and
+        dictionaries: MediaKeyMessageType, MediaKeySessionType, MediaKeyStatus,
+        MediaKeySystemConfiguration, MediaKeySystemCapability, MediaKeysRequirement
+        and MediaKeysRestrictions. Definitions of these types are also moved to the
+        platform layer without any changes (apart from renaming), and the previous
+        types now alias against the types now located in the platform layer.
+
+        No new tests -- no change in behavior.
+
+        * CMakeLists.txt:
+        * Modules/encryptedmedia/CDM.cpp:
+        * Modules/encryptedmedia/CDM.h:
+        * Modules/encryptedmedia/MediaKeyMessageType.h:
+        * Modules/encryptedmedia/MediaKeySessionType.h:
+        * Modules/encryptedmedia/MediaKeyStatus.h:
+        * Modules/encryptedmedia/MediaKeySystemAccess.cpp:
+        * Modules/encryptedmedia/MediaKeySystemAccess.h:
+        * Modules/encryptedmedia/MediaKeySystemConfiguration.h:
+        * Modules/encryptedmedia/MediaKeySystemMediaCapability.h:
+        * Modules/encryptedmedia/MediaKeysRequirement.h:
+        * Modules/encryptedmedia/MediaKeysRestrictions.h:
+        * platform/encryptedmedia/CDMInstance.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMInstance.h.
+        * platform/encryptedmedia/CDMKeyStatus.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyStatus.h.
+        * platform/encryptedmedia/CDMKeySystemConfiguration.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySystemConfiguration.h.
+        * platform/encryptedmedia/CDMMediaCapability.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySystemMediaCapability.h.
+        * platform/encryptedmedia/CDMMessageType.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageType.h.
+        * platform/encryptedmedia/CDMPrivate.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivate.h.
+        * platform/encryptedmedia/CDMRequirement.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeysRequirement.h.
+        * platform/encryptedmedia/CDMRestrictions.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeysRestrictions.h.
+        * platform/encryptedmedia/CDMSessionType.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySessionType.h.
+
+2017-07-19  Zan Dobersek  <[email protected]>
+
         Unreviewed follow-up to r219674.
 
         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:

Modified: trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp (219677 => 219678)


--- trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp	2017-07-20 06:08:28 UTC (rev 219677)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp	2017-07-20 06:09:56 UTC (rev 219678)
@@ -31,7 +31,7 @@
 #include "CDMPrivate.h"
 #include "Document.h"
 #include "InitDataRegistry.h"
-#include "MediaKeysRestrictions.h"
+#include "MediaKeysRequirement.h"
 #include "MediaPlayer.h"
 #include "NotImplemented.h"
 #include "ParsedContentType.h"

Modified: trunk/Source/WebCore/Modules/encryptedmedia/CDM.h (219677 => 219678)


--- trunk/Source/WebCore/Modules/encryptedmedia/CDM.h	2017-07-20 06:08:28 UTC (rev 219677)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDM.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -28,7 +28,10 @@
 #if ENABLE(ENCRYPTED_MEDIA)
 
 #include "ContextDestructionObserver.h"
+#include "MediaKeySessionType.h"
 #include "MediaKeySystemConfiguration.h"
+#include "MediaKeySystemMediaCapability.h"
+#include "MediaKeysRestrictions.h"
 #include "SharedBuffer.h"
 #include <wtf/Function.h>
 #include <wtf/HashSet.h>
@@ -46,8 +49,6 @@
 class ScriptExecutionContext;
 class SharedBuffer;
 
-struct MediaKeysRestrictions;
-
 class CDMFactory {
 public:
     virtual ~CDMFactory() { };

Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDMInstance.h (219677 => 219678)


--- trunk/Source/WebCore/Modules/encryptedmedia/CDMInstance.h	2017-07-20 06:08:28 UTC (rev 219677)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMInstance.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2017 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.
- */
-
-#pragma once
-
-#if ENABLE(ENCRYPTED_MEDIA)
-
-#include "MediaKeyMessageType.h"
-#include "MediaKeySessionType.h"
-#include "MediaKeyStatus.h"
-#include <utility>
-#include <wtf/Forward.h>
-#include <wtf/Optional.h>
-#include <wtf/RefCounted.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-struct MediaKeySystemConfiguration;
-class SharedBuffer;
-
-class CDMInstance : public RefCounted<CDMInstance> {
-public:
-    virtual ~CDMInstance() { }
-
-    enum SuccessValue {
-        Failed,
-        Succeeded,
-    };
-
-    using LicenseType = MediaKeySessionType;
-    using KeyStatus = MediaKeyStatus;
-    using MessageType = MediaKeyMessageType;
-
-    virtual SuccessValue initializeWithConfiguration(const MediaKeySystemConfiguration&) = 0;
-    virtual SuccessValue setDistinctiveIdentifiersAllowed(bool) = 0;
-    virtual SuccessValue setPersistentStateAllowed(bool) = 0;
-    virtual SuccessValue setServerCertificate(Ref<SharedBuffer>&&) = 0;
-
-    using LicenseCallback = Function<void(Ref<SharedBuffer>&& message, const String& sessionId, bool needsIndividualization, SuccessValue succeeded)>;
-    virtual void requestLicense(LicenseType, const AtomicString& initDataType, Ref<SharedBuffer>&& initData, LicenseCallback) = 0;
-
-    using KeyStatusVector = Vector<std::pair<Ref<SharedBuffer>, KeyStatus>>;
-    using Message = std::pair<MessageType, Ref<SharedBuffer>>;
-    using LicenseUpdateCallback = Function<void(bool sessionWasClosed, std::optional<KeyStatusVector>&& changedKeys, std::optional<double>&& changedExpiration, std::optional<Message>&& message, SuccessValue succeeded)>;
-    virtual void updateLicense(const String& sessionId, LicenseType, const SharedBuffer& response, LicenseUpdateCallback) = 0;
-
-    enum class SessionLoadFailure {
-        None,
-        NoSessionData,
-        MismatchedSessionType,
-        QuotaExceeded,
-        Other,
-    };
-
-    using LoadSessionCallback = Function<void(std::optional<KeyStatusVector>&&, std::optional<double>&&, std::optional<Message>&&, SuccessValue, SessionLoadFailure)>;
-    virtual void loadSession(LicenseType, const String& sessionId, const String& origin, LoadSessionCallback) = 0;
-
-    using CloseSessionCallback = Function<void()>;
-    virtual void closeSession(const String& sessionId, CloseSessionCallback) = 0;
-
-    using RemoveSessionDataCallback = Function<void(KeyStatusVector&&, std::optional<Ref<SharedBuffer>>&&, SuccessValue)>;
-    virtual void removeSessionData(const String& sessionId, LicenseType, RemoveSessionDataCallback) = 0;
-
-    virtual void storeRecordOfKeyUsage(const String& sessionId) = 0;
-};
-
-}
-
-#endif

Deleted: trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivate.h (219677 => 219678)


--- trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivate.h	2017-07-20 06:08:28 UTC (rev 219677)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMPrivate.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-#pragma once
-
-#if ENABLE(ENCRYPTED_MEDIA)
-
-#include "CDMInstance.h"
-#include "MediaKeySessionType.h"
-#include "MediaKeysRequirement.h"
-#include <wtf/Forward.h>
-
-namespace WebCore {
-
-struct MediaKeySystemConfiguration;
-struct MediaKeysRestrictions;
-
-class CDMPrivate {
-public:
-    virtual ~CDMPrivate() { }
-
-    virtual bool supportsInitDataType(const AtomicString&) const = 0;
-    virtual bool supportsConfiguration(const MediaKeySystemConfiguration&) const = 0;
-    virtual bool supportsConfigurationWithRestrictions(const MediaKeySystemConfiguration&, const MediaKeysRestrictions&) const = 0;
-    virtual bool supportsSessionTypeWithConfiguration(MediaKeySessionType&, const MediaKeySystemConfiguration&) const = 0;
-    virtual bool supportsRobustness(const String&) const = 0;
-    virtual MediaKeysRequirement distinctiveIdentifiersRequirement(const MediaKeySystemConfiguration&, const MediaKeysRestrictions&) const = 0;
-    virtual MediaKeysRequirement persistentStateRequirement(const MediaKeySystemConfiguration&, const MediaKeysRestrictions&) const = 0;
-    virtual bool distinctiveIdentifiersAreUniquePerOriginAndClearable(const MediaKeySystemConfiguration&) const = 0;
-    virtual RefPtr<CDMInstance> createInstance() = 0;
-    virtual void loadAndInitialize() = 0;
-    virtual bool supportsServerCertificates() const = 0;
-    virtual bool supportsSessions() const = 0;
-    virtual bool supportsInitData(const AtomicString&, const SharedBuffer&) const = 0;
-    virtual RefPtr<SharedBuffer> sanitizeResponse(const SharedBuffer&) const = 0;
-    virtual std::optional<String> sanitizeSessionId(const String&) const = 0;
-};
-
-}
-
-#endif

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageType.h (219677 => 219678)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageType.h	2017-07-20 06:08:28 UTC (rev 219677)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageType.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -30,14 +30,11 @@
 
 #if ENABLE(ENCRYPTED_MEDIA)
 
+#include "CDMMessageType.h"
+
 namespace WebCore {
 
-enum class MediaKeyMessageType {
-    LicenseRequest,
-    LicenseRenewal,
-    LicenseRelease,
-    IndividualizationRequest
-};
+using MediaKeyMessageType = CDMMessageType;
 
 } // namespace WebCore
 

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySessionType.h (219677 => 219678)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySessionType.h	2017-07-20 06:08:28 UTC (rev 219677)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySessionType.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -30,13 +30,11 @@
 
 #if ENABLE(ENCRYPTED_MEDIA)
 
+#include "CDMSessionType.h"
+
 namespace WebCore {
 
-enum class MediaKeySessionType {
-    Temporary,
-    PersistentUsageRecord,
-    PersistentLicense
-};
+using MediaKeySessionType = CDMSessionType;
 
 } // namespace WebCore
 

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyStatus.h (219677 => 219678)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyStatus.h	2017-07-20 06:08:28 UTC (rev 219677)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyStatus.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -30,17 +30,11 @@
 
 #if ENABLE(ENCRYPTED_MEDIA)
 
+#include "CDMKeyStatus.h"
+
 namespace WebCore {
 
-enum class MediaKeyStatus {
-    Usable,
-    Expired,
-    Released,
-    OutputRestricted,
-    OutputDownscaled,
-    StatusPending,
-    InternalError
-};
+using MediaKeyStatus = CDMKeyStatus;
 
 } // namespace WebCore
 

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySystemAccess.cpp (219677 => 219678)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySystemAccess.cpp	2017-07-20 06:08:28 UTC (rev 219677)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySystemAccess.cpp	2017-07-20 06:09:56 UTC (rev 219678)
@@ -34,8 +34,8 @@
 #include "CDM.h"
 #include "CDMInstance.h"
 #include "JSMediaKeys.h"
-#include "MediaKeySystemConfiguration.h"
 #include "MediaKeys.h"
+#include "MediaKeysRequirement.h"
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySystemAccess.h (219677 => 219678)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySystemAccess.h	2017-07-20 06:08:28 UTC (rev 219677)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySystemAccess.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -32,6 +32,7 @@
 
 #include "GenericTaskQueue.h"
 #include "JSDOMPromiseDeferred.h"
+#include "MediaKeySystemConfiguration.h"
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
 
@@ -40,8 +41,6 @@
 class CDM;
 class MediaKeys;
 
-struct MediaKeySystemConfiguration;
-
 class MediaKeySystemAccess : public RefCounted<MediaKeySystemAccess> {
 public:
     static Ref<MediaKeySystemAccess> create(const String& keySystem, MediaKeySystemConfiguration&&, Ref<CDM>&&);

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySystemConfiguration.h (219677 => 219678)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySystemConfiguration.h	2017-07-20 06:08:28 UTC (rev 219677)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySystemConfiguration.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -30,26 +30,12 @@
 
 #if ENABLE(ENCRYPTED_MEDIA)
 
-#include "MediaKeySessionType.h"
-#include "MediaKeySystemMediaCapability.h"
-#include "MediaKeysRequirement.h"
-#include <wtf/Vector.h>
-#include <wtf/text/WTFString.h>
+#include "CDMKeySystemConfiguration.h"
 
 namespace WebCore {
 
-struct MediaKeySystemConfiguration {
-    using KeysRequirement = MediaKeysRequirement;
+using MediaKeySystemConfiguration = CDMKeySystemConfiguration;
 
-    String label;
-    Vector<String> initDataTypes;
-    Vector<MediaKeySystemMediaCapability> audioCapabilities;
-    Vector<MediaKeySystemMediaCapability> videoCapabilities;
-    MediaKeysRequirement distinctiveIdentifier;
-    MediaKeysRequirement persistentState;
-    Vector<MediaKeySessionType> sessionTypes;
-};
-
 } // namespace WebCore
 
 #endif // ENABLE(ENCRYPTED_MEDIA)

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySystemMediaCapability.h (219677 => 219678)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySystemMediaCapability.h	2017-07-20 06:08:28 UTC (rev 219677)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySystemMediaCapability.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -30,14 +30,11 @@
 
 #if ENABLE(ENCRYPTED_MEDIA)
 
-#include <wtf/text/WTFString.h>
+#include "CDMMediaCapability.h"
 
 namespace WebCore {
 
-struct MediaKeySystemMediaCapability {
-    String contentType;
-    String robustness;
-};
+using MediaKeySystemMediaCapability = CDMMediaCapability;
 
 } // namespace WebCore
 

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeysRequirement.h (219677 => 219678)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeysRequirement.h	2017-07-20 06:08:28 UTC (rev 219677)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeysRequirement.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -30,13 +30,11 @@
 
 #if ENABLE(ENCRYPTED_MEDIA)
 
+#include "CDMRequirement.h"
+
 namespace WebCore {
 
-enum class MediaKeysRequirement {
-    Required,
-    Optional,
-    NotAllowed
-};
+using MediaKeysRequirement = CDMRequirement;
 
 } // namespace WebCore
 

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeysRestrictions.h (219677 => 219678)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeysRestrictions.h	2017-07-20 06:08:28 UTC (rev 219677)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeysRestrictions.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -27,15 +27,11 @@
 
 #if ENABLE(ENCRYPTED_MEDIA)
 
-#include <wtf/HashSet.h>
+#include "CDMRestrictions.h"
 
 namespace WebCore {
 
-struct MediaKeysRestrictions {
-    bool distinctiveIdentifierDenied { false };
-    bool persistentStateDenied { false };
-    HashSet<String> deniedSessionTypes;
-};
+using MediaKeysRestrictions = CDMRestrictions;
 
 } // namespace WebCore
 

Added: trunk/Source/WebCore/platform/encryptedmedia/CDMInstance.h (0 => 219678)


--- trunk/Source/WebCore/platform/encryptedmedia/CDMInstance.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/encryptedmedia/CDMInstance.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+#pragma once
+
+#if ENABLE(ENCRYPTED_MEDIA)
+
+#include "CDMKeyStatus.h"
+#include "CDMMessageType.h"
+#include "CDMSessionType.h"
+#include <utility>
+#include <wtf/Forward.h>
+#include <wtf/Optional.h>
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class SharedBuffer;
+
+struct CDMKeySystemConfiguration;
+
+class CDMInstance : public RefCounted<CDMInstance> {
+public:
+    virtual ~CDMInstance() { }
+
+    enum SuccessValue {
+        Failed,
+        Succeeded,
+    };
+
+    using KeyStatus = CDMKeyStatus;
+    using LicenseType = CDMSessionType;
+    using MessageType = CDMMessageType;
+
+    virtual SuccessValue initializeWithConfiguration(const CDMKeySystemConfiguration&) = 0;
+    virtual SuccessValue setDistinctiveIdentifiersAllowed(bool) = 0;
+    virtual SuccessValue setPersistentStateAllowed(bool) = 0;
+    virtual SuccessValue setServerCertificate(Ref<SharedBuffer>&&) = 0;
+
+    using LicenseCallback = Function<void(Ref<SharedBuffer>&& message, const String& sessionId, bool needsIndividualization, SuccessValue succeeded)>;
+    virtual void requestLicense(LicenseType, const AtomicString& initDataType, Ref<SharedBuffer>&& initData, LicenseCallback) = 0;
+
+    using KeyStatusVector = Vector<std::pair<Ref<SharedBuffer>, KeyStatus>>;
+    using Message = std::pair<MessageType, Ref<SharedBuffer>>;
+    using LicenseUpdateCallback = Function<void(bool sessionWasClosed, std::optional<KeyStatusVector>&& changedKeys, std::optional<double>&& changedExpiration, std::optional<Message>&& message, SuccessValue succeeded)>;
+    virtual void updateLicense(const String& sessionId, LicenseType, const SharedBuffer& response, LicenseUpdateCallback) = 0;
+
+    enum class SessionLoadFailure {
+        None,
+        NoSessionData,
+        MismatchedSessionType,
+        QuotaExceeded,
+        Other,
+    };
+
+    using LoadSessionCallback = Function<void(std::optional<KeyStatusVector>&&, std::optional<double>&&, std::optional<Message>&&, SuccessValue, SessionLoadFailure)>;
+    virtual void loadSession(LicenseType, const String& sessionId, const String& origin, LoadSessionCallback) = 0;
+
+    using CloseSessionCallback = Function<void()>;
+    virtual void closeSession(const String& sessionId, CloseSessionCallback) = 0;
+
+    using RemoveSessionDataCallback = Function<void(KeyStatusVector&&, std::optional<Ref<SharedBuffer>>&&, SuccessValue)>;
+    virtual void removeSessionData(const String& sessionId, LicenseType, RemoveSessionDataCallback) = 0;
+
+    virtual void storeRecordOfKeyUsage(const String& sessionId) = 0;
+};
+
+} // namespace WebCore
+
+#endif

Added: trunk/Source/WebCore/platform/encryptedmedia/CDMKeyStatus.h (0 => 219678)


--- trunk/Source/WebCore/platform/encryptedmedia/CDMKeyStatus.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/encryptedmedia/CDMKeyStatus.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2017 Metrological Group B.V.
+ * Copyright (C) 2017 Igalia S.L.
+ *
+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * HOLDER OR 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.
+ */
+
+#pragma once
+
+#if ENABLE(ENCRYPTED_MEDIA)
+
+namespace WebCore {
+
+enum class CDMKeyStatus {
+    Usable,
+    Expired,
+    Released,
+    OutputRestricted,
+    OutputDownscaled,
+    StatusPending,
+    InternalError
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(ENCRYPTED_MEDIA)

Added: trunk/Source/WebCore/platform/encryptedmedia/CDMKeySystemConfiguration.h (0 => 219678)


--- trunk/Source/WebCore/platform/encryptedmedia/CDMKeySystemConfiguration.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/encryptedmedia/CDMKeySystemConfiguration.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2017 Metrological Group B.V.
+ * Copyright (C) 2017 Igalia S.L.
+ *
+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * HOLDER OR 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.
+ */
+
+#pragma once
+
+#if ENABLE(ENCRYPTED_MEDIA)
+
+#include "CDMMediaCapability.h"
+#include "CDMRequirement.h"
+#include "CDMSessionType.h"
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+struct CDMKeySystemConfiguration {
+    using KeysRequirement = CDMRequirement;
+
+    String label;
+    Vector<String> initDataTypes;
+    Vector<CDMMediaCapability> audioCapabilities;
+    Vector<CDMMediaCapability> videoCapabilities;
+    CDMRequirement distinctiveIdentifier;
+    CDMRequirement persistentState;
+    Vector<CDMSessionType> sessionTypes;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(ENCRYPTED_MEDIA)

Added: trunk/Source/WebCore/platform/encryptedmedia/CDMMediaCapability.h (0 => 219678)


--- trunk/Source/WebCore/platform/encryptedmedia/CDMMediaCapability.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/encryptedmedia/CDMMediaCapability.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2017 Metrological Group B.V.
+ * Copyright (C) 2017 Igalia S.L.
+ *
+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * HOLDER OR 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.
+ */
+
+#pragma once
+
+#if ENABLE(ENCRYPTED_MEDIA)
+
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+struct CDMMediaCapability {
+    String contentType;
+    String robustness;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(ENCRYPTED_MEDIA)

Added: trunk/Source/WebCore/platform/encryptedmedia/CDMMessageType.h (0 => 219678)


--- trunk/Source/WebCore/platform/encryptedmedia/CDMMessageType.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/encryptedmedia/CDMMessageType.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2017 Metrological Group B.V.
+ * Copyright (C) 2017 Igalia S.L.
+ *
+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * HOLDER OR 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.
+ */
+
+#pragma once
+
+#if ENABLE(ENCRYPTED_MEDIA)
+
+namespace WebCore {
+
+enum class CDMMessageType {
+    LicenseRequest,
+    LicenseRenewal,
+    LicenseRelease,
+    IndividualizationRequest
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(ENCRYPTED_MEDIA)

Added: trunk/Source/WebCore/platform/encryptedmedia/CDMPrivate.h (0 => 219678)


--- trunk/Source/WebCore/platform/encryptedmedia/CDMPrivate.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/encryptedmedia/CDMPrivate.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#pragma once
+
+#if ENABLE(ENCRYPTED_MEDIA)
+
+#include "CDMInstance.h"
+#include "CDMRequirement.h"
+#include "CDMSessionType.h"
+#include <wtf/Forward.h>
+
+namespace WebCore {
+
+struct CDMKeySystemConfiguration;
+struct CDMRestrictions;
+
+class CDMPrivate {
+public:
+    virtual ~CDMPrivate() { }
+
+    virtual bool supportsInitDataType(const AtomicString&) const = 0;
+    virtual bool supportsConfiguration(const CDMKeySystemConfiguration&) const = 0;
+    virtual bool supportsConfigurationWithRestrictions(const CDMKeySystemConfiguration&, const CDMRestrictions&) const = 0;
+    virtual bool supportsSessionTypeWithConfiguration(CDMSessionType&, const CDMKeySystemConfiguration&) const = 0;
+    virtual bool supportsRobustness(const String&) const = 0;
+    virtual CDMRequirement distinctiveIdentifiersRequirement(const CDMKeySystemConfiguration&, const CDMRestrictions&) const = 0;
+    virtual CDMRequirement persistentStateRequirement(const CDMKeySystemConfiguration&, const CDMRestrictions&) const = 0;
+    virtual bool distinctiveIdentifiersAreUniquePerOriginAndClearable(const CDMKeySystemConfiguration&) const = 0;
+    virtual RefPtr<CDMInstance> createInstance() = 0;
+    virtual void loadAndInitialize() = 0;
+    virtual bool supportsServerCertificates() const = 0;
+    virtual bool supportsSessions() const = 0;
+    virtual bool supportsInitData(const AtomicString&, const SharedBuffer&) const = 0;
+    virtual RefPtr<SharedBuffer> sanitizeResponse(const SharedBuffer&) const = 0;
+    virtual std::optional<String> sanitizeSessionId(const String&) const = 0;
+};
+
+}
+
+#endif

Added: trunk/Source/WebCore/platform/encryptedmedia/CDMRequirement.h (0 => 219678)


--- trunk/Source/WebCore/platform/encryptedmedia/CDMRequirement.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/encryptedmedia/CDMRequirement.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2017 Metrological Group B.V.
+ * Copyright (C) 2017 Igalia S.L.
+ *
+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * HOLDER OR 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.
+ */
+
+#pragma once
+
+#if ENABLE(ENCRYPTED_MEDIA)
+
+namespace WebCore {
+
+enum class CDMRequirement {
+    Required,
+    Optional,
+    NotAllowed
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(ENCRYPTED_MEDIA)

Added: trunk/Source/WebCore/platform/encryptedmedia/CDMRestrictions.h (0 => 219678)


--- trunk/Source/WebCore/platform/encryptedmedia/CDMRestrictions.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/encryptedmedia/CDMRestrictions.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#pragma once
+
+#if ENABLE(ENCRYPTED_MEDIA)
+
+#include <wtf/HashSet.h>
+
+namespace WebCore {
+
+struct CDMRestrictions {
+    bool distinctiveIdentifierDenied { false };
+    bool persistentStateDenied { false };
+    HashSet<String> deniedSessionTypes;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(ENCRYPTED_MEDIA)

Added: trunk/Source/WebCore/platform/encryptedmedia/CDMSessionType.h (0 => 219678)


--- trunk/Source/WebCore/platform/encryptedmedia/CDMSessionType.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/encryptedmedia/CDMSessionType.h	2017-07-20 06:09:56 UTC (rev 219678)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2017 Metrological Group B.V.
+ * Copyright (C) 2017 Igalia S.L.
+ *
+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * HOLDER OR 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.
+ */
+
+#pragma once
+
+#if ENABLE(ENCRYPTED_MEDIA)
+
+namespace WebCore {
+
+enum class CDMSessionType {
+    Temporary,
+    PersistentUsageRecord,
+    PersistentLicense
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(ENCRYPTED_MEDIA)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to