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 11 matching lines...) Expand all Loading... |
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
23 * THE POSSIBILITY OF SUCH DAMAGE. | 23 * THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
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/DOMArrayPiece.h" | 31 #include "core/dom/DOMArrayPiece.h" |
32 #include "core/dom/DOMException.h" | |
33 #include "modules/EventTargetModules.h" | 32 #include "modules/EventTargetModules.h" |
34 #include "modules/encryptedmedia/MediaKeyStatusMap.h" | 33 #include "modules/encryptedmedia/MediaKeyStatusMap.h" |
35 #include "platform/Timer.h" | 34 #include "platform/Timer.h" |
36 #include "platform/heap/Handle.h" | 35 #include "platform/heap/Handle.h" |
37 #include "public/platform/WebContentDecryptionModuleSession.h" | 36 #include "public/platform/WebContentDecryptionModuleSession.h" |
38 #include "public/platform/WebEncryptedMediaTypes.h" | 37 #include "public/platform/WebEncryptedMediaTypes.h" |
39 | 38 |
40 namespace blink { | 39 namespace blink { |
41 | 40 |
| 41 class DOMException; |
42 class GenericEventQueue; | 42 class GenericEventQueue; |
43 class MediaKeys; | 43 class MediaKeys; |
44 | 44 |
45 // References are held by JS only. However, even if all JS references are | 45 // References are held by JS only. However, even if all JS references are |
46 // dropped, it won't be garbage collected until close event received or | 46 // dropped, it won't be garbage collected until close event received or |
47 // MediaKeys goes away (as determined by a WeakMember reference). This allows | 47 // MediaKeys goes away (as determined by a WeakMember reference). This allows |
48 // the CDM to continue to fire events for this session, as long as the session | 48 // the CDM to continue to fire events for this session, as long as the session |
49 // is open. | 49 // is open. |
50 // | 50 // |
51 // WeakMember<MediaKeys> is used instead of having MediaKeys and MediaKeySession | 51 // WeakMember<MediaKeys> is used instead of having MediaKeys and MediaKeySession |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 WebEncryptedMediaSessionType m_sessionType; | 123 WebEncryptedMediaSessionType m_sessionType; |
124 double m_expiration; | 124 double m_expiration; |
125 Member<MediaKeyStatusMap> m_keyStatusesMap; | 125 Member<MediaKeyStatusMap> m_keyStatusesMap; |
126 | 126 |
127 // Session states. | 127 // Session states. |
128 bool m_isUninitialized; | 128 bool m_isUninitialized; |
129 bool m_isCallable; | 129 bool m_isCallable; |
130 bool m_isClosed; // Is the CDM finished with this session? | 130 bool m_isClosed; // Is the CDM finished with this session? |
131 | 131 |
132 // Keep track of the closed promise. | 132 // Keep track of the closed promise. |
133 typedef ScriptPromiseProperty<Member<MediaKeySession>, ToV8UndefinedGenerato
r, RefPtrWillBeMember<DOMException>> ClosedPromise; | 133 typedef ScriptPromiseProperty<Member<MediaKeySession>, ToV8UndefinedGenerato
r, Member<DOMException>> ClosedPromise; |
134 Member<ClosedPromise> m_closedPromise; | 134 Member<ClosedPromise> m_closedPromise; |
135 | 135 |
136 HeapDeque<Member<PendingAction>> m_pendingActions; | 136 HeapDeque<Member<PendingAction>> m_pendingActions; |
137 Timer<MediaKeySession> m_actionTimer; | 137 Timer<MediaKeySession> m_actionTimer; |
138 }; | 138 }; |
139 | 139 |
140 } // namespace blink | 140 } // namespace blink |
141 | 141 |
142 #endif // MediaKeySession_h | 142 #endif // MediaKeySession_h |
OLD | NEW |