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 15 matching lines...) Expand all Loading... |
26 #ifndef MediaKeySession_h | 26 #ifndef MediaKeySession_h |
27 #define MediaKeySession_h | 27 #define MediaKeySession_h |
28 | 28 |
29 #include "bindings/core/v8/ScriptPromiseProperty.h" | 29 #include "bindings/core/v8/ScriptPromiseProperty.h" |
30 #include "core/dom/ActiveDOMObject.h" | 30 #include "core/dom/ActiveDOMObject.h" |
31 #include "core/dom/DOMException.h" | 31 #include "core/dom/DOMException.h" |
32 #include "modules/EventTargetModules.h" | 32 #include "modules/EventTargetModules.h" |
33 #include "platform/Timer.h" | 33 #include "platform/Timer.h" |
34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
35 #include "public/platform/WebContentDecryptionModuleSession.h" | 35 #include "public/platform/WebContentDecryptionModuleSession.h" |
36 #include "wtf/Forward.h" | |
37 | 36 |
38 namespace blink { | 37 namespace blink { |
39 | 38 |
40 class ScriptPromise; | 39 class DOMArrayBuffer; |
41 class ScriptState; | 40 class DOMArrayBufferView; |
42 class GenericEventQueue; | 41 class GenericEventQueue; |
43 class MediaKeyError; | 42 class MediaKeyError; |
44 class MediaKeys; | 43 class MediaKeys; |
| 44 class ScriptPromise; |
| 45 class ScriptState; |
45 class WebContentDecryptionModule; | 46 class WebContentDecryptionModule; |
46 class WebString; | 47 class WebString; |
47 | 48 |
48 // References are held by JS only. However, even if all JS references are | 49 // References are held by JS only. However, even if all JS references are |
49 // dropped, it won't be garbage collected until close event received or | 50 // dropped, it won't be garbage collected until close event received or |
50 // MediaKeys goes away (as determined by the validity of a WeakPtr). This allows | 51 // MediaKeys goes away (as determined by the validity of a WeakPtr). This allows |
51 // the CDM to continue to fire events for this session, as long as the session | 52 // the CDM to continue to fire events for this session, as long as the session |
52 // is open. | 53 // is open. |
53 // | 54 // |
54 // WeakPtr<MediaKeys> is used instead of having MediaKeys and MediaKeySession | 55 // WeakPtr<MediaKeys> is used instead of having MediaKeys and MediaKeySession |
(...skipping 11 matching lines...) Expand all Loading... |
66 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeySession); | 67 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeySession); |
67 public: | 68 public: |
68 static MediaKeySession* create(ScriptState*, MediaKeys*, const String& sessi
onType); | 69 static MediaKeySession* create(ScriptState*, MediaKeys*, const String& sessi
onType); |
69 virtual ~MediaKeySession(); | 70 virtual ~MediaKeySession(); |
70 | 71 |
71 const String& keySystem() const { return m_keySystem; } | 72 const String& keySystem() const { return m_keySystem; } |
72 String sessionId() const; | 73 String sessionId() const; |
73 double expiration() const { return m_expiration; } | 74 double expiration() const { return m_expiration; } |
74 ScriptPromise closed(ScriptState*); | 75 ScriptPromise closed(ScriptState*); |
75 | 76 |
76 ScriptPromise generateRequest(ScriptState*, const String& initDataType, Arra
yBuffer* initData); | 77 ScriptPromise generateRequest(ScriptState*, const String& initDataType, DOMA
rrayBuffer* initData); |
77 ScriptPromise generateRequest(ScriptState*, const String& initDataType, Arra
yBufferView* initData); | 78 ScriptPromise generateRequest(ScriptState*, const String& initDataType, DOMA
rrayBufferView* initData); |
78 | 79 |
79 void setError(MediaKeyError*); | 80 void setError(MediaKeyError*); |
80 MediaKeyError* error() { return m_error.get(); } | 81 MediaKeyError* error() { return m_error.get(); } |
81 | 82 |
82 ScriptPromise update(ScriptState*, ArrayBuffer* response); | 83 ScriptPromise update(ScriptState*, DOMArrayBuffer* response); |
83 ScriptPromise update(ScriptState*, ArrayBufferView* response); | 84 ScriptPromise update(ScriptState*, DOMArrayBufferView* response); |
84 ScriptPromise close(ScriptState*); | 85 ScriptPromise close(ScriptState*); |
85 ScriptPromise remove(ScriptState*); | 86 ScriptPromise remove(ScriptState*); |
86 | 87 |
87 void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); | 88 void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); |
88 | 89 |
89 // EventTarget | 90 // EventTarget |
90 virtual const AtomicString& interfaceName() const override; | 91 virtual const AtomicString& interfaceName() const override; |
91 virtual ExecutionContext* executionContext() const override; | 92 virtual ExecutionContext* executionContext() const override; |
92 | 93 |
93 // ActiveDOMObject | 94 // ActiveDOMObject |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 typedef ScriptPromiseProperty<Member<MediaKeySession>, V8UndefinedType, RefP
trWillBeMember<DOMException> > ClosedPromise; | 140 typedef ScriptPromiseProperty<Member<MediaKeySession>, V8UndefinedType, RefP
trWillBeMember<DOMException> > ClosedPromise; |
140 Member<ClosedPromise> m_closedPromise; | 141 Member<ClosedPromise> m_closedPromise; |
141 | 142 |
142 HeapDeque<Member<PendingAction> > m_pendingActions; | 143 HeapDeque<Member<PendingAction> > m_pendingActions; |
143 Timer<MediaKeySession> m_actionTimer; | 144 Timer<MediaKeySession> m_actionTimer; |
144 }; | 145 }; |
145 | 146 |
146 } // namespace blink | 147 } // namespace blink |
147 | 148 |
148 #endif // MediaKeySession_h | 149 #endif // MediaKeySession_h |
OLD | NEW |