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

Side by Side Diff: Source/modules/encryptedmedia/MediaKeySession.cpp

Issue 949093002: InlinedVisitor: Migrate encryptedmedia to use inlined tracing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 static PendingAction* CreatePendingRemove(ContentDecryptionModuleResult* res ult) 194 static PendingAction* CreatePendingRemove(ContentDecryptionModuleResult* res ult)
195 { 195 {
196 ASSERT(result); 196 ASSERT(result);
197 return new PendingAction(Remove, result, String(), PassRefPtr<DOMArrayBu ffer>()); 197 return new PendingAction(Remove, result, String(), PassRefPtr<DOMArrayBu ffer>());
198 } 198 }
199 199
200 ~PendingAction() 200 ~PendingAction()
201 { 201 {
202 } 202 }
203 203
204 void trace(Visitor* visitor) 204 DEFINE_INLINE_TRACE()
205 { 205 {
206 visitor->trace(m_result); 206 visitor->trace(m_result);
207 } 207 }
208 208
209 private: 209 private:
210 PendingAction(Type type, ContentDecryptionModuleResult* result, const String & stringData, PassRefPtr<DOMArrayBuffer> data) 210 PendingAction(Type type, ContentDecryptionModuleResult* result, const String & stringData, PassRefPtr<DOMArrayBuffer> data)
211 : m_type(type) 211 : m_type(type)
212 , m_result(result) 212 , m_result(result)
213 , m_stringData(stringData) 213 , m_stringData(stringData)
214 , m_data(data) 214 , m_data(data)
(...skipping 28 matching lines...) Expand all
243 { 243 {
244 if (status != WebContentDecryptionModuleResult::NewSession) { 244 if (status != WebContentDecryptionModuleResult::NewSession) {
245 ASSERT_NOT_REACHED(); 245 ASSERT_NOT_REACHED();
246 reject(InvalidStateError, "Unexpected completion."); 246 reject(InvalidStateError, "Unexpected completion.");
247 } 247 }
248 248
249 m_session->finishGenerateRequest(); 249 m_session->finishGenerateRequest();
250 resolve(); 250 resolve();
251 } 251 }
252 252
253 void trace(Visitor* visitor) 253 DEFINE_INLINE_TRACE()
254 { 254 {
255 visitor->trace(m_session); 255 visitor->trace(m_session);
256 ContentDecryptionModuleResultPromise::trace(visitor); 256 ContentDecryptionModuleResultPromise::trace(visitor);
257 } 257 }
258 258
259 private: 259 private:
260 Member<MediaKeySession> m_session; 260 Member<MediaKeySession> m_session;
261 }; 261 };
262 262
263 // This class wraps the promise resolver used when loading a session 263 // This class wraps the promise resolver used when loading a session
(...skipping 29 matching lines...) Expand all
293 case WebContentDecryptionModuleResult::SessionAlreadyExists: 293 case WebContentDecryptionModuleResult::SessionAlreadyExists:
294 ASSERT_NOT_REACHED(); 294 ASSERT_NOT_REACHED();
295 reject(InvalidStateError, "Unexpected completion."); 295 reject(InvalidStateError, "Unexpected completion.");
296 return; 296 return;
297 } 297 }
298 298
299 m_session->finishLoad(); 299 m_session->finishLoad();
300 resolve(result); 300 resolve(result);
301 } 301 }
302 302
303 void trace(Visitor* visitor) 303 DEFINE_INLINE_TRACE()
304 { 304 {
305 visitor->trace(m_session); 305 visitor->trace(m_session);
306 ContentDecryptionModuleResultPromise::trace(visitor); 306 ContentDecryptionModuleResultPromise::trace(visitor);
307 } 307 }
308 308
309 private: 309 private:
310 Member<MediaKeySession> m_session; 310 Member<MediaKeySession> m_session;
311 }; 311 };
312 312
313 MediaKeySession* MediaKeySession::create(ScriptState* scriptState, MediaKeys* me diaKeys, const String& sessionType) 313 MediaKeySession* MediaKeySession::create(ScriptState* scriptState, MediaKeys* me diaKeys, const String& sessionType)
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 // Stop the CDM from firing any more events for this session. 927 // Stop the CDM from firing any more events for this session.
928 m_session.clear(); 928 m_session.clear();
929 m_isClosed = true; 929 m_isClosed = true;
930 930
931 if (m_actionTimer.isActive()) 931 if (m_actionTimer.isActive())
932 m_actionTimer.stop(); 932 m_actionTimer.stop();
933 m_pendingActions.clear(); 933 m_pendingActions.clear();
934 m_asyncEventQueue->close(); 934 m_asyncEventQueue->close();
935 } 935 }
936 936
937 void MediaKeySession::trace(Visitor* visitor) 937 DEFINE_TRACE(MediaKeySession)
938 { 938 {
939 visitor->trace(m_asyncEventQueue); 939 visitor->trace(m_asyncEventQueue);
940 visitor->trace(m_pendingActions); 940 visitor->trace(m_pendingActions);
941 visitor->trace(m_mediaKeys); 941 visitor->trace(m_mediaKeys);
942 visitor->trace(m_keyStatusesMap); 942 visitor->trace(m_keyStatusesMap);
943 visitor->trace(m_closedPromise); 943 visitor->trace(m_closedPromise);
944 RefCountedGarbageCollectedEventTargetWithInlineData<MediaKeySession>::trace( visitor); 944 RefCountedGarbageCollectedEventTargetWithInlineData<MediaKeySession>::trace( visitor);
945 ActiveDOMObject::trace(visitor); 945 ActiveDOMObject::trace(visitor);
946 } 946 }
947 947
948 } // namespace blink 948 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698