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 "platform/Supplementable.h" | 11 #include "platform/Supplementable.h" |
12 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
13 #include "public/platform/WebContentDecryptionModule.h" | |
ddorwin
2015/05/08 17:49:41
Can we fwd declare instead?
Srirama
2015/05/19 10:39:47
Done.
| |
13 #include "public/platform/WebEncryptedMediaTypes.h" | 14 #include "public/platform/WebEncryptedMediaTypes.h" |
14 #include "public/platform/WebMediaPlayerClient.h" | 15 #include "public/platform/WebMediaPlayer.h" |
ddorwin
2015/05/08 17:49:41
What is this used for?
Srirama
2015/05/19 10:39:47
WebMediaPlayer is referenced which is being includ
| |
16 #include "public/platform/WebMediaPlayerEncryptedMediaClient.h" | |
15 | 17 |
16 namespace blink { | 18 namespace blink { |
17 | 19 |
18 class ExceptionState; | 20 class ExceptionState; |
19 class HTMLMediaElement; | 21 class HTMLMediaElement; |
20 class MediaKeys; | 22 class MediaKeys; |
21 class ScriptPromise; | 23 class ScriptPromise; |
22 class ScriptState; | 24 class ScriptState; |
23 | 25 |
24 class HTMLMediaElementEncryptedMedia final : public NoBaseWillBeGarbageCollected <HTMLMediaElementEncryptedMedia>, public WillBeHeapSupplement<HTMLMediaElement> { | 26 class HTMLMediaElementEncryptedMedia final : public NoBaseWillBeGarbageCollected <HTMLMediaElementEncryptedMedia>, public WillBeHeapSupplement<HTMLMediaElement>, public WebMediaPlayerEncryptedMediaClient { |
25 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementEncryptedMedia); | 27 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementEncryptedMedia); |
26 DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(HTMLMediaElementEncryptedMe dia); | 28 DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(HTMLMediaElementEncryptedMe dia); |
27 public: | 29 public: |
28 // encrypted media extensions (v0.1b) | 30 // encrypted media extensions (v0.1b) |
29 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&); |
30 static void webkitGenerateKeyRequest(HTMLMediaElement&, const String& keySys tem, ExceptionState&); | 32 static void webkitGenerateKeyRequest(HTMLMediaElement&, const String& keySys tem, ExceptionState&); |
31 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&); |
32 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&); |
33 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&); |
34 | 36 |
35 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(webkitkeyadded); | 37 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(webkitkeyadded); |
36 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(webkitkeyerror); | 38 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(webkitkeyerror); |
37 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(webkitkeymessage); | 39 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(webkitkeymessage); |
38 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(webkitneedkey); | 40 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(webkitneedkey); |
39 | 41 |
40 // encrypted media extensions (WD) | 42 // encrypted media extensions (WD) |
41 static MediaKeys* mediaKeys(HTMLMediaElement&); | 43 static MediaKeys* mediaKeys(HTMLMediaElement&); |
42 static ScriptPromise setMediaKeys(ScriptState*, HTMLMediaElement&, MediaKeys *); | 44 static ScriptPromise setMediaKeys(ScriptState*, HTMLMediaElement&, MediaKeys *); |
43 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(encrypted); | 45 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(encrypted); |
44 | 46 |
45 static void keyAdded(HTMLMediaElement&, const String& keySystem, const Strin g& sessionId); | 47 // WebMediaPlayerEncryptedMediaClient methods |
46 static void keyError(HTMLMediaElement&, const String& keySystem, const Strin g& sessionId, WebMediaPlayerClient::MediaKeyErrorCode, unsigned short systemCode ); | 48 virtual void keyAdded(WebMediaPlayerClient*, const WebString& keySystem, con st WebString& sessionId) override final; |
47 static void keyMessage(HTMLMediaElement&, const String& keySystem, const Str ing& sessionId, const unsigned char* message, unsigned messageLength, const WebU RL& defaultURL); | 49 virtual void keyError(WebMediaPlayerClient*, const WebString& keySystem, con st WebString& sessionId, WebMediaPlayerEncryptedMediaClient::MediaKeyErrorCode, unsigned short systemCode) override final; |
48 static void encrypted(HTMLMediaElement&, WebEncryptedMediaInitDataType, cons t unsigned char* initData, unsigned initDataLength); | 50 virtual void keyMessage(WebMediaPlayerClient*, const WebString& keySystem, c onst WebString& sessionId, const unsigned char* message, unsigned messageLength, const WebURL& defaultURL) override final; |
49 static void didBlockPlaybackWaitingForKey(HTMLMediaElement&); | 51 virtual void encrypted(WebMediaPlayerClient*, WebEncryptedMediaInitDataType, const unsigned char* initData, unsigned initDataLength) override final; |
50 static void didResumePlaybackBlockedForKey(HTMLMediaElement&); | 52 virtual void didBlockPlaybackWaitingForKey(WebMediaPlayerClient*) override f inal; |
53 virtual void didResumePlaybackBlockedForKey(WebMediaPlayerClient*) override final; | |
51 static WebContentDecryptionModule* contentDecryptionModule(HTMLMediaElement& ); | 54 static WebContentDecryptionModule* contentDecryptionModule(HTMLMediaElement& ); |
ddorwin
2015/05/08 17:49:42
Why is this still static? The call site makes the
Srirama
2015/05/19 10:39:47
Done.
| |
52 | 55 |
53 static HTMLMediaElementEncryptedMedia& from(HTMLMediaElement&); | 56 static HTMLMediaElementEncryptedMedia& from(HTMLMediaElement&); |
54 static const char* supplementName(); | 57 static const char* supplementName(); |
55 | 58 |
56 DECLARE_VIRTUAL_TRACE(); | 59 DECLARE_VIRTUAL_TRACE(); |
57 | 60 |
58 private: | 61 private: |
59 friend class SetMediaKeysHandler; | 62 friend class SetMediaKeysHandler; |
60 | 63 |
61 HTMLMediaElementEncryptedMedia(); | 64 HTMLMediaElementEncryptedMedia(); |
(...skipping 20 matching lines...) Expand all Loading... | |
82 EmeMode m_emeMode; | 85 EmeMode m_emeMode; |
83 | 86 |
84 bool m_isWaitingForKey; | 87 bool m_isWaitingForKey; |
85 | 88 |
86 PersistentWillBeMember<MediaKeys> m_mediaKeys; | 89 PersistentWillBeMember<MediaKeys> m_mediaKeys; |
87 }; | 90 }; |
88 | 91 |
89 } // namespace blink | 92 } // namespace blink |
90 | 93 |
91 #endif | 94 #endif |
OLD | NEW |