Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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>
39 40
40 namespace blink { 41 namespace blink {
41 42
42 class DOMException; 43 class DOMException;
43 class GenericEventQueue; 44 class GenericEventQueue;
44 class MediaKeys; 45 class MediaKeys;
45 46
46 // References are held by JS only. However, even if all JS references are 47 // References are held by JS only. However, even if all JS references are
47 // dropped, it won't be garbage collected until close event received or 48 // dropped, it won't be garbage collected until close event received or
48 // MediaKeys goes away (as determined by a WeakMember reference). This allows 49 // MediaKeys goes away (as determined by a WeakMember reference). This allows
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 void expirationChanged(double updatedExpiryTimeInMS) override; 112 void expirationChanged(double updatedExpiryTimeInMS) override;
112 void keysStatusesChange(const WebVector<WebEncryptedMediaKeyInformation>&, b ool hasAdditionalUsableKey) override; 113 void keysStatusesChange(const WebVector<WebEncryptedMediaKeyInformation>&, b ool hasAdditionalUsableKey) override;
113 114
114 // Called by NewSessionResult when the new session has been created. 115 // Called by NewSessionResult when the new session has been created.
115 void finishGenerateRequest(); 116 void finishGenerateRequest();
116 117
117 // Called by LoadSessionResult when the session has been loaded. 118 // Called by LoadSessionResult when the session has been loaded.
118 void finishLoad(); 119 void finishLoad();
119 120
120 Member<GenericEventQueue> m_asyncEventQueue; 121 Member<GenericEventQueue> m_asyncEventQueue;
121 OwnPtr<WebContentDecryptionModuleSession> m_session; 122 std::unique_ptr<WebContentDecryptionModuleSession> m_session;
122 123
123 // Used to determine if MediaKeys is still active. 124 // Used to determine if MediaKeys is still active.
124 WeakMember<MediaKeys> m_mediaKeys; 125 WeakMember<MediaKeys> m_mediaKeys;
125 126
126 // Session properties. 127 // Session properties.
127 WebEncryptedMediaSessionType m_sessionType; 128 WebEncryptedMediaSessionType m_sessionType;
128 double m_expiration; 129 double m_expiration;
129 Member<MediaKeyStatusMap> m_keyStatusesMap; 130 Member<MediaKeyStatusMap> m_keyStatusesMap;
130 131
131 // Session states. 132 // Session states.
132 bool m_isUninitialized; 133 bool m_isUninitialized;
133 bool m_isCallable; 134 bool m_isCallable;
134 bool m_isClosed; // Is the CDM finished with this session? 135 bool m_isClosed; // Is the CDM finished with this session?
135 136
136 // Keep track of the closed promise. 137 // Keep track of the closed promise.
137 typedef ScriptPromiseProperty<Member<MediaKeySession>, ToV8UndefinedGenerato r, Member<DOMException>> ClosedPromise; 138 typedef ScriptPromiseProperty<Member<MediaKeySession>, ToV8UndefinedGenerato r, Member<DOMException>> ClosedPromise;
138 Member<ClosedPromise> m_closedPromise; 139 Member<ClosedPromise> m_closedPromise;
139 140
140 HeapDeque<Member<PendingAction>> m_pendingActions; 141 HeapDeque<Member<PendingAction>> m_pendingActions;
141 Timer<MediaKeySession> m_actionTimer; 142 Timer<MediaKeySession> m_actionTimer;
142 }; 143 };
143 144
144 } // namespace blink 145 } // namespace blink
145 146
146 #endif // MediaKeySession_h 147 #endif // MediaKeySession_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698