OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2013 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 13 matching lines...) Expand all Loading... |
24 */ | 24 */ |
25 | 25 |
26 #ifndef MediaKeys_h | 26 #ifndef MediaKeys_h |
27 #define MediaKeys_h | 27 #define MediaKeys_h |
28 | 28 |
29 #include "bindings/core/v8/ScriptPromise.h" | 29 #include "bindings/core/v8/ScriptPromise.h" |
30 #include "bindings/core/v8/ScriptWrappable.h" | 30 #include "bindings/core/v8/ScriptWrappable.h" |
31 #include "core/dom/ContextLifecycleObserver.h" | 31 #include "core/dom/ContextLifecycleObserver.h" |
32 #include "core/dom/DOMArrayPiece.h" | 32 #include "core/dom/DOMArrayPiece.h" |
33 #include "platform/Timer.h" | 33 #include "platform/Timer.h" |
| 34 #include "public/platform/WebString.h" |
| 35 #include "public/platform/WebVector.h" |
34 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
35 #include "wtf/text/WTFString.h" | 37 #include "wtf/text/WTFString.h" |
36 | 38 |
37 namespace blink { | 39 namespace blink { |
38 | 40 |
39 class ExceptionState; | 41 class ExceptionState; |
40 class ExecutionContext; | 42 class ExecutionContext; |
41 class MediaKeySession; | 43 class MediaKeySession; |
42 class ScriptState; | 44 class ScriptState; |
43 class WebContentDecryptionModule; | 45 class WebContentDecryptionModule; |
44 | 46 |
45 // References are held by JS and HTMLMediaElement. | 47 // References are held by JS and HTMLMediaElement. |
46 // The WebContentDecryptionModule has the same lifetime as this object. | 48 // The WebContentDecryptionModule has the same lifetime as this object. |
47 class MediaKeys : public GarbageCollectedFinalized<MediaKeys>, public ContextLif
ecycleObserver, public ScriptWrappable { | 49 class MediaKeys : public GarbageCollectedFinalized<MediaKeys>, public ContextLif
ecycleObserver, public ScriptWrappable { |
48 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeys); | 50 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeys); |
49 DEFINE_WRAPPERTYPEINFO(); | 51 DEFINE_WRAPPERTYPEINFO(); |
50 public: | 52 public: |
51 MediaKeys(ExecutionContext*, const String& keySystem, PassOwnPtr<WebContentD
ecryptionModule>); | 53 MediaKeys(ExecutionContext*, const String& keySystem, const blink::WebVector
<blink::WebString>& supportedSessionTypes, PassOwnPtr<WebContentDecryptionModule
>); |
52 virtual ~MediaKeys(); | 54 virtual ~MediaKeys(); |
53 | 55 |
54 // FIXME: This should be removed after crbug.com/425186 is fully | 56 // FIXME: This should be removed after crbug.com/425186 is fully |
55 // implemented. | 57 // implemented. |
56 const String& keySystem() const { return m_keySystem; } | 58 const String& keySystem() const { return m_keySystem; } |
57 | 59 |
58 MediaKeySession* createSession(ScriptState*, const String& sessionType, Exce
ptionState&); | 60 MediaKeySession* createSession(ScriptState*, const String& sessionType, Exce
ptionState&); |
59 | 61 |
60 ScriptPromise setServerCertificate(ScriptState*, const DOMArrayPiece& server
Certificate); | 62 ScriptPromise setServerCertificate(ScriptState*, const DOMArrayPiece& server
Certificate); |
61 | 63 |
62 blink::WebContentDecryptionModule* contentDecryptionModule(); | 64 blink::WebContentDecryptionModule* contentDecryptionModule(); |
63 | 65 |
64 virtual void trace(Visitor*) override; | 66 virtual void trace(Visitor*) override; |
65 | 67 |
66 // ContextLifecycleObserver | 68 // ContextLifecycleObserver |
67 virtual void contextDestroyed() override; | 69 virtual void contextDestroyed() override; |
68 | 70 |
69 private: | 71 private: |
70 class PendingAction; | 72 class PendingAction; |
71 | 73 |
72 void timerFired(Timer<MediaKeys>*); | 74 void timerFired(Timer<MediaKeys>*); |
73 | 75 |
74 const String m_keySystem; | 76 const String m_keySystem; |
| 77 const blink::WebVector<blink::WebString> m_supportedSessionTypes; |
75 OwnPtr<blink::WebContentDecryptionModule> m_cdm; | 78 OwnPtr<blink::WebContentDecryptionModule> m_cdm; |
76 | 79 |
77 HeapDeque<Member<PendingAction>> m_pendingActions; | 80 HeapDeque<Member<PendingAction>> m_pendingActions; |
78 Timer<MediaKeys> m_timer; | 81 Timer<MediaKeys> m_timer; |
79 }; | 82 }; |
80 | 83 |
81 } // namespace blink | 84 } // namespace blink |
82 | 85 |
83 #endif // MediaKeys_h | 86 #endif // MediaKeys_h |
OLD | NEW |