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

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

Issue 379343003: Set callback interface on WebCDMSession after creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | public/platform/WebContentDecryptionModule.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 { 64 {
65 MediaKeySession* session = adoptRefCountedGarbageCollectedWillBeNoop(new Med iaKeySession(context, cdm, keys)); 65 MediaKeySession* session = adoptRefCountedGarbageCollectedWillBeNoop(new Med iaKeySession(context, cdm, keys));
66 session->suspendIfNeeded(); 66 session->suspendIfNeeded();
67 return session; 67 return session;
68 } 68 }
69 69
70 MediaKeySession::MediaKeySession(ExecutionContext* context, blink::WebContentDec ryptionModule* cdm, MediaKeys* keys) 70 MediaKeySession::MediaKeySession(ExecutionContext* context, blink::WebContentDec ryptionModule* cdm, MediaKeys* keys)
71 : ActiveDOMObject(context) 71 : ActiveDOMObject(context)
72 , m_keySystem(keys->keySystem()) 72 , m_keySystem(keys->keySystem())
73 , m_asyncEventQueue(GenericEventQueue::create(this)) 73 , m_asyncEventQueue(GenericEventQueue::create(this))
74 , m_session(adoptPtr(cdm->createSession(this))) 74 , m_session(adoptPtr(cdm->createSession()))
75 , m_keys(keys) 75 , m_keys(keys)
76 , m_isClosed(false) 76 , m_isClosed(false)
77 , m_actionTimer(this, &MediaKeySession::actionTimerFired) 77 , m_actionTimer(this, &MediaKeySession::actionTimerFired)
78 { 78 {
79 WTF_LOG(Media, "MediaKeySession::MediaKeySession"); 79 WTF_LOG(Media, "MediaKeySession::MediaKeySession");
80 ScriptWrappable::init(this); 80 ScriptWrappable::init(this);
81 ASSERT(m_session); 81 m_session->setClientInterface(this);
ddorwin 2014/07/10 23:22:30 The point of this change is to allow refactoring.
jrummell 2014/07/11 00:55:53 Without promises implemented, all responses come b
82 } 82 }
83 83
84 MediaKeySession::~MediaKeySession() 84 MediaKeySession::~MediaKeySession()
85 { 85 {
86 m_session.clear(); 86 m_session.clear();
87 #if !ENABLE(OILPAN) 87 #if !ENABLE(OILPAN)
88 // MediaKeySession and m_asyncEventQueue always become unreachable 88 // MediaKeySession and m_asyncEventQueue always become unreachable
89 // together. So MediaKeySession and m_asyncEventQueue are destructed in the 89 // together. So MediaKeySession and m_asyncEventQueue are destructed in the
90 // same GC. We don't need to call cancelAllEvents explicitly in Oilpan. 90 // same GC. We don't need to call cancelAllEvents explicitly in Oilpan.
91 m_asyncEventQueue->cancelAllEvents(); 91 m_asyncEventQueue->cancelAllEvents();
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 298
299 void MediaKeySession::trace(Visitor* visitor) 299 void MediaKeySession::trace(Visitor* visitor)
300 { 300 {
301 visitor->trace(m_error); 301 visitor->trace(m_error);
302 visitor->trace(m_asyncEventQueue); 302 visitor->trace(m_asyncEventQueue);
303 visitor->trace(m_keys); 303 visitor->trace(m_keys);
304 EventTargetWithInlineData::trace(visitor); 304 EventTargetWithInlineData::trace(visitor);
305 } 305 }
306 306
307 } 307 }
OLDNEW
« no previous file with comments | « no previous file | public/platform/WebContentDecryptionModule.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698