Changeset 219977 in webkit
- Timestamp:
- Jul 27, 2017, 1:13:55 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
platform/encryptedmedia/CDMInstance.h (modified) (3 diffs)
-
testing/MockCDMFactory.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r219976 r219977 1 2017-07-27 Zan Dobersek <zdobersek@igalia.com> 2 3 [EME] Allow CDMInstance type traits specialization 4 https://bugs.webkit.org/show_bug.cgi?id=174886 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 Allow using the trait-based type casting for the CDMInstance class and its 9 derivatives. ImplementationType enumeration values are to be used and 10 returned from the new implementationType() virtual method. This method is 11 leveraged in the type trait specialization that enables using is<>() and 12 downcast<>() helpers for CDMInstance objects. 13 14 This will allow differentiating between CDMInstance implementations once 15 the media playback pipeline has to retrieve any key information that's 16 necessary for playback of encrypted content. 17 18 MockCDMInstance class overrides the implementationType() method, returning 19 the ImplementationType::Mock value. Type trait specializations for this 20 class aren't added since they're not needed anywhere at this point. 21 22 * platform/encryptedmedia/CDMInstance.h: 23 * testing/MockCDMFactory.h: 24 1 25 2017-07-27 Zan Dobersek <zdobersek@igalia.com> 2 26 -
trunk/Source/WebCore/platform/encryptedmedia/CDMInstance.h
r219678 r219977 35 35 #include <wtf/Optional.h> 36 36 #include <wtf/RefCounted.h> 37 #include <wtf/TypeCasts.h> 37 38 #include <wtf/Vector.h> 38 39 … … 46 47 public: 47 48 virtual ~CDMInstance() { } 49 50 enum class ImplementationType { 51 Mock, 52 }; 53 54 virtual ImplementationType implementationType() const = 0; 48 55 49 56 enum SuccessValue { … … 91 98 } // namespace WebCore 92 99 100 #define SPECIALIZE_TYPE_TRAITS_CDM_INSTANCE(ToValueTypeName, ImplementationTypeName) \ 101 SPECIALIZE_TYPE_TRAITS_BEGIN(ToValueTypeName) \ 102 static bool isType(const WebCore::CDMInstance& instance) { return instance.implementationType() == ImplementationTypeName; } \ 103 SPECIALIZE_TYPE_TRAITS_END() 104 93 105 #endif -
trunk/Source/WebCore/testing/MockCDMFactory.h
r212110 r219977 128 128 129 129 private: 130 ImplementationType implementationType() const final { return ImplementationType::Mock; } 130 131 SuccessValue initializeWithConfiguration(const MediaKeySystemConfiguration&) final; 131 132 SuccessValue setDistinctiveIdentifiersAllowed(bool) final;
Note:
See TracChangeset
for help on using the changeset viewer.