| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef HTMLMediaElementEncryptedMedia_h | 5 #ifndef HTMLMediaElementEncryptedMedia_h |
| 6 #define HTMLMediaElementEncryptedMedia_h | 6 #define HTMLMediaElementEncryptedMedia_h |
| 7 | 7 |
| 8 #include "core/EventTypeNames.h" | 8 #include "core/EventTypeNames.h" |
| 9 #include "core/dom/DOMTypedArray.h" | 9 #include "core/dom/DOMTypedArray.h" |
| 10 #include "core/events/EventTarget.h" | 10 #include "core/events/EventTarget.h" |
| 11 #include "modules/ModulesExport.h" | 11 #include "modules/ModulesExport.h" |
| 12 #include "platform/Supplementable.h" | 12 #include "platform/Supplementable.h" |
| 13 #include "platform/heap/Handle.h" | 13 #include "platform/heap/Handle.h" |
| 14 #include "public/platform/WebEncryptedMediaTypes.h" | 14 #include "public/platform/WebEncryptedMediaTypes.h" |
| 15 #include "public/platform/WebMediaPlayerEncryptedMediaClient.h" | 15 #include "public/platform/WebMediaPlayerEncryptedMediaClient.h" |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 class ExceptionState; | 19 class ExceptionState; |
| 20 class HTMLMediaElement; | 20 class HTMLMediaElement; |
| 21 class MediaKeys; | 21 class MediaKeys; |
| 22 class ScriptPromise; | 22 class ScriptPromise; |
| 23 class ScriptState; | 23 class ScriptState; |
| 24 class WebContentDecryptionModule; | 24 class WebContentDecryptionModule; |
| 25 class WebMediaPlayer; | 25 class WebMediaPlayer; |
| 26 | 26 |
| 27 class MODULES_EXPORT HTMLMediaElementEncryptedMedia final : public NoBaseWillBeG
arbageCollectedFinalized<HTMLMediaElementEncryptedMedia>, public WillBeHeapSuppl
ement<HTMLMediaElement>, public WebMediaPlayerEncryptedMediaClient { | 27 class MODULES_EXPORT HTMLMediaElementEncryptedMedia final : public GarbageCollec
tedFinalized<HTMLMediaElementEncryptedMedia>, public HeapSupplement<HTMLMediaEle
ment>, public WebMediaPlayerEncryptedMediaClient { |
| 28 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementEncryptedMedia); | 28 USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementEncryptedMedia); |
| 29 USING_FAST_MALLOC_WILL_BE_REMOVED(HTMLMediaElementEncryptedMedia); | |
| 30 public: | 29 public: |
| 31 static MediaKeys* mediaKeys(HTMLMediaElement&); | 30 static MediaKeys* mediaKeys(HTMLMediaElement&); |
| 32 static ScriptPromise setMediaKeys(ScriptState*, HTMLMediaElement&, MediaKeys
*); | 31 static ScriptPromise setMediaKeys(ScriptState*, HTMLMediaElement&, MediaKeys
*); |
| 33 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(encrypted); | 32 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(encrypted); |
| 34 | 33 |
| 35 // WebMediaPlayerEncryptedMediaClient methods | 34 // WebMediaPlayerEncryptedMediaClient methods |
| 36 void encrypted(WebEncryptedMediaInitDataType, const unsigned char* initData,
unsigned initDataLength) final; | 35 void encrypted(WebEncryptedMediaInitDataType, const unsigned char* initData,
unsigned initDataLength) final; |
| 37 void didBlockPlaybackWaitingForKey() final; | 36 void didBlockPlaybackWaitingForKey() final; |
| 38 void didResumePlaybackBlockedForKey() final; | 37 void didResumePlaybackBlockedForKey() final; |
| 39 WebContentDecryptionModule* contentDecryptionModule(); | 38 WebContentDecryptionModule* contentDecryptionModule(); |
| 40 | 39 |
| 41 static HTMLMediaElementEncryptedMedia& from(HTMLMediaElement&); | 40 static HTMLMediaElementEncryptedMedia& from(HTMLMediaElement&); |
| 42 static const char* supplementName(); | 41 static const char* supplementName(); |
| 43 | 42 |
| 44 ~HTMLMediaElementEncryptedMedia(); | 43 ~HTMLMediaElementEncryptedMedia(); |
| 45 | 44 |
| 46 DECLARE_VIRTUAL_TRACE(); | 45 DECLARE_VIRTUAL_TRACE(); |
| 47 | 46 |
| 48 private: | 47 private: |
| 49 friend class SetMediaKeysHandler; | 48 friend class SetMediaKeysHandler; |
| 50 | 49 |
| 51 HTMLMediaElementEncryptedMedia(HTMLMediaElement&); | 50 HTMLMediaElementEncryptedMedia(HTMLMediaElement&); |
| 52 | 51 |
| 53 // EventTarget | 52 // EventTarget |
| 54 bool setAttributeEventListener(const AtomicString& eventType, PassRefPtrWill
BeRawPtr<EventListener>); | 53 bool setAttributeEventListener(const AtomicString& eventType, RawPtr<EventLi
stener>); |
| 55 EventListener* getAttributeEventListener(const AtomicString& eventType); | 54 EventListener* getAttributeEventListener(const AtomicString& eventType); |
| 56 | 55 |
| 57 RawPtrWillBeMember<HTMLMediaElement> m_mediaElement; | 56 Member<HTMLMediaElement> m_mediaElement; |
| 58 | 57 |
| 59 // Internal values specified by the EME spec: | 58 // Internal values specified by the EME spec: |
| 60 // http://w3c.github.io/encrypted-media/#idl-def-HTMLMediaElement | 59 // http://w3c.github.io/encrypted-media/#idl-def-HTMLMediaElement |
| 61 // The following internal values are added to the HTMLMediaElement: | 60 // The following internal values are added to the HTMLMediaElement: |
| 62 // - waiting for key, which shall have a boolean value | 61 // - waiting for key, which shall have a boolean value |
| 63 // - attaching media keys, which shall have a boolean value | 62 // - attaching media keys, which shall have a boolean value |
| 64 bool m_isWaitingForKey; | 63 bool m_isWaitingForKey; |
| 65 bool m_isAttachingMediaKeys; | 64 bool m_isAttachingMediaKeys; |
| 66 | 65 |
| 67 PersistentWillBeMember<MediaKeys> m_mediaKeys; | 66 Member<MediaKeys> m_mediaKeys; |
| 68 }; | 67 }; |
| 69 | 68 |
| 70 } // namespace blink | 69 } // namespace blink |
| 71 | 70 |
| 72 #endif | 71 #endif |
| OLD | NEW |