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 18 matching lines...) Expand all Loading... |
29 #include "bindings/core/v8/ActiveScriptWrappable.h" | 29 #include "bindings/core/v8/ActiveScriptWrappable.h" |
30 #include "bindings/core/v8/ScriptPromiseProperty.h" | 30 #include "bindings/core/v8/ScriptPromiseProperty.h" |
31 #include "core/dom/ActiveDOMObject.h" | 31 #include "core/dom/ActiveDOMObject.h" |
32 #include "core/dom/DOMArrayPiece.h" | 32 #include "core/dom/DOMArrayPiece.h" |
33 #include "modules/EventTargetModules.h" | 33 #include "modules/EventTargetModules.h" |
34 #include "modules/encryptedmedia/MediaKeyStatusMap.h" | 34 #include "modules/encryptedmedia/MediaKeyStatusMap.h" |
35 #include "platform/Timer.h" | 35 #include "platform/Timer.h" |
36 #include "platform/heap/Handle.h" | 36 #include "platform/heap/Handle.h" |
37 #include "public/platform/WebContentDecryptionModuleSession.h" | 37 #include "public/platform/WebContentDecryptionModuleSession.h" |
38 #include "public/platform/WebEncryptedMediaTypes.h" | 38 #include "public/platform/WebEncryptedMediaTypes.h" |
39 #include <memory> | |
40 | 39 |
41 namespace blink { | 40 namespace blink { |
42 | 41 |
43 class DOMException; | 42 class DOMException; |
44 class GenericEventQueue; | 43 class GenericEventQueue; |
45 class MediaKeys; | 44 class MediaKeys; |
46 | 45 |
47 // References are held by JS only. However, even if all JS references are | 46 // References are held by JS only. However, even if all JS references are |
48 // dropped, it won't be garbage collected until close event received or | 47 // dropped, it won't be garbage collected until close event received or |
49 // MediaKeys goes away (as determined by a WeakMember reference). This allows | 48 // MediaKeys goes away (as determined by a WeakMember reference). This allows |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 void expirationChanged(double updatedExpiryTimeInMS) override; | 111 void expirationChanged(double updatedExpiryTimeInMS) override; |
113 void keysStatusesChange(const WebVector<WebEncryptedMediaKeyInformation>&, b
ool hasAdditionalUsableKey) override; | 112 void keysStatusesChange(const WebVector<WebEncryptedMediaKeyInformation>&, b
ool hasAdditionalUsableKey) override; |
114 | 113 |
115 // Called by NewSessionResult when the new session has been created. | 114 // Called by NewSessionResult when the new session has been created. |
116 void finishGenerateRequest(); | 115 void finishGenerateRequest(); |
117 | 116 |
118 // Called by LoadSessionResult when the session has been loaded. | 117 // Called by LoadSessionResult when the session has been loaded. |
119 void finishLoad(); | 118 void finishLoad(); |
120 | 119 |
121 Member<GenericEventQueue> m_asyncEventQueue; | 120 Member<GenericEventQueue> m_asyncEventQueue; |
122 std::unique_ptr<WebContentDecryptionModuleSession> m_session; | 121 OwnPtr<WebContentDecryptionModuleSession> m_session; |
123 | 122 |
124 // Used to determine if MediaKeys is still active. | 123 // Used to determine if MediaKeys is still active. |
125 WeakMember<MediaKeys> m_mediaKeys; | 124 WeakMember<MediaKeys> m_mediaKeys; |
126 | 125 |
127 // Session properties. | 126 // Session properties. |
128 WebEncryptedMediaSessionType m_sessionType; | 127 WebEncryptedMediaSessionType m_sessionType; |
129 double m_expiration; | 128 double m_expiration; |
130 Member<MediaKeyStatusMap> m_keyStatusesMap; | 129 Member<MediaKeyStatusMap> m_keyStatusesMap; |
131 | 130 |
132 // Session states. | 131 // Session states. |
133 bool m_isUninitialized; | 132 bool m_isUninitialized; |
134 bool m_isCallable; | 133 bool m_isCallable; |
135 bool m_isClosed; // Is the CDM finished with this session? | 134 bool m_isClosed; // Is the CDM finished with this session? |
136 | 135 |
137 // Keep track of the closed promise. | 136 // Keep track of the closed promise. |
138 typedef ScriptPromiseProperty<Member<MediaKeySession>, ToV8UndefinedGenerato
r, Member<DOMException>> ClosedPromise; | 137 typedef ScriptPromiseProperty<Member<MediaKeySession>, ToV8UndefinedGenerato
r, Member<DOMException>> ClosedPromise; |
139 Member<ClosedPromise> m_closedPromise; | 138 Member<ClosedPromise> m_closedPromise; |
140 | 139 |
141 HeapDeque<Member<PendingAction>> m_pendingActions; | 140 HeapDeque<Member<PendingAction>> m_pendingActions; |
142 Timer<MediaKeySession> m_actionTimer; | 141 Timer<MediaKeySession> m_actionTimer; |
143 }; | 142 }; |
144 | 143 |
145 } // namespace blink | 144 } // namespace blink |
146 | 145 |
147 #endif // MediaKeySession_h | 146 #endif // MediaKeySession_h |
OLD | NEW |