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
arbageCollected<HTMLMediaElementEncryptedMedia>, public WillBeHeapSupplement<HTM
LMediaElement>, public WebMediaPlayerEncryptedMediaClient { | 27 class MODULES_EXPORT HTMLMediaElementEncryptedMedia final : public NoBaseWillBeG
arbageCollectedFinalized<HTMLMediaElementEncryptedMedia>, public WillBeHeapSuppl
ement<HTMLMediaElement>, public WebMediaPlayerEncryptedMediaClient { |
28 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementEncryptedMedia); | 28 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementEncryptedMedia); |
29 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(HTMLMediaElementEncryptedMedia); | |
30 public: | 29 public: |
31 // encrypted media extensions (v0.1b) | 30 // encrypted media extensions (v0.1b) |
32 static void webkitGenerateKeyRequest(HTMLMediaElement&, const String& keySys
tem, PassRefPtr<DOMUint8Array> initData, ExceptionState&); | 31 static void webkitGenerateKeyRequest(HTMLMediaElement&, const String& keySys
tem, PassRefPtr<DOMUint8Array> initData, ExceptionState&); |
33 static void webkitGenerateKeyRequest(HTMLMediaElement&, const String& keySys
tem, ExceptionState&); | 32 static void webkitGenerateKeyRequest(HTMLMediaElement&, const String& keySys
tem, ExceptionState&); |
34 static void webkitAddKey(HTMLMediaElement&, const String& keySystem, PassRef
Ptr<DOMUint8Array> key, PassRefPtr<DOMUint8Array> initData, const String& sessio
nId, ExceptionState&); | 33 static void webkitAddKey(HTMLMediaElement&, const String& keySystem, PassRef
Ptr<DOMUint8Array> key, PassRefPtr<DOMUint8Array> initData, const String& sessio
nId, ExceptionState&); |
35 static void webkitAddKey(HTMLMediaElement&, const String& keySystem, PassRef
Ptr<DOMUint8Array> key, ExceptionState&); | 34 static void webkitAddKey(HTMLMediaElement&, const String& keySystem, PassRef
Ptr<DOMUint8Array> key, ExceptionState&); |
36 static void webkitCancelKeyRequest(HTMLMediaElement&, const String& keySyste
m, const String& sessionId, ExceptionState&); | 35 static void webkitCancelKeyRequest(HTMLMediaElement&, const String& keySyste
m, const String& sessionId, ExceptionState&); |
37 | 36 |
38 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(webkitkeyadded); | 37 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(webkitkeyadded); |
39 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(webkitkeyerror); | 38 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(webkitkeyerror); |
(...skipping 10 matching lines...) Expand all Loading... |
50 void keyError(const WebString& keySystem, const WebString& sessionId, WebMed
iaPlayerEncryptedMediaClient::MediaKeyErrorCode, unsigned short systemCode) fina
l; | 49 void keyError(const WebString& keySystem, const WebString& sessionId, WebMed
iaPlayerEncryptedMediaClient::MediaKeyErrorCode, unsigned short systemCode) fina
l; |
51 void keyMessage(const WebString& keySystem, const WebString& sessionId, cons
t unsigned char* message, unsigned messageLength, const WebURL& defaultURL) fina
l; | 50 void keyMessage(const WebString& keySystem, const WebString& sessionId, cons
t unsigned char* message, unsigned messageLength, const WebURL& defaultURL) fina
l; |
52 void encrypted(WebEncryptedMediaInitDataType, const unsigned char* initData,
unsigned initDataLength) final; | 51 void encrypted(WebEncryptedMediaInitDataType, const unsigned char* initData,
unsigned initDataLength) final; |
53 void didBlockPlaybackWaitingForKey() final; | 52 void didBlockPlaybackWaitingForKey() final; |
54 void didResumePlaybackBlockedForKey() final; | 53 void didResumePlaybackBlockedForKey() final; |
55 WebContentDecryptionModule* contentDecryptionModule(); | 54 WebContentDecryptionModule* contentDecryptionModule(); |
56 | 55 |
57 static HTMLMediaElementEncryptedMedia& from(HTMLMediaElement&); | 56 static HTMLMediaElementEncryptedMedia& from(HTMLMediaElement&); |
58 static const char* supplementName(); | 57 static const char* supplementName(); |
59 | 58 |
| 59 ~HTMLMediaElementEncryptedMedia(); |
| 60 |
60 DECLARE_VIRTUAL_TRACE(); | 61 DECLARE_VIRTUAL_TRACE(); |
61 | 62 |
62 private: | 63 private: |
63 friend class SetMediaKeysHandler; | 64 friend class SetMediaKeysHandler; |
64 | 65 |
65 HTMLMediaElementEncryptedMedia(HTMLMediaElement&); | 66 HTMLMediaElementEncryptedMedia(HTMLMediaElement&); |
66 void generateKeyRequest(WebMediaPlayer*, const String& keySystem, PassRefPtr
<DOMUint8Array> initData, ExceptionState&); | 67 void generateKeyRequest(WebMediaPlayer*, const String& keySystem, PassRefPtr
<DOMUint8Array> initData, ExceptionState&); |
67 void addKey(WebMediaPlayer*, const String& keySystem, PassRefPtr<DOMUint8Arr
ay> key, PassRefPtr<DOMUint8Array> initData, const String& sessionId, ExceptionS
tate&); | 68 void addKey(WebMediaPlayer*, const String& keySystem, PassRefPtr<DOMUint8Arr
ay> key, PassRefPtr<DOMUint8Array> initData, const String& sessionId, ExceptionS
tate&); |
68 void cancelKeyRequest(WebMediaPlayer*, const String& keySystem, const String
& sessionId, ExceptionState&); | 69 void cancelKeyRequest(WebMediaPlayer*, const String& keySystem, const String
& sessionId, ExceptionState&); |
69 | 70 |
(...skipping 15 matching lines...) Expand all Loading... |
85 EmeMode m_emeMode; | 86 EmeMode m_emeMode; |
86 | 87 |
87 bool m_isWaitingForKey; | 88 bool m_isWaitingForKey; |
88 | 89 |
89 PersistentWillBeMember<MediaKeys> m_mediaKeys; | 90 PersistentWillBeMember<MediaKeys> m_mediaKeys; |
90 }; | 91 }; |
91 | 92 |
92 } // namespace blink | 93 } // namespace blink |
93 | 94 |
94 #endif | 95 #endif |
OLD | NEW |