OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/media/cdm/browser_cdm_manager.h" | 5 #include "content/browser/media/cdm/browser_cdm_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 : BrowserMessageFilter(CdmMsgStart), | 179 : BrowserMessageFilter(CdmMsgStart), |
180 render_process_id_(render_process_id), | 180 render_process_id_(render_process_id), |
181 task_runner_(task_runner), | 181 task_runner_(task_runner), |
182 weak_ptr_factory_(this) { | 182 weak_ptr_factory_(this) { |
183 DVLOG(1) << __FUNCTION__ << ": " << render_process_id_; | 183 DVLOG(1) << __FUNCTION__ << ": " << render_process_id_; |
184 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 184 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
185 | 185 |
186 new BrowserCdmManagerProcessWatcher(render_process_id, this); | 186 new BrowserCdmManagerProcessWatcher(render_process_id, this); |
187 | 187 |
188 if (!task_runner_.get()) { | 188 if (!task_runner_.get()) { |
189 task_runner_ = | 189 task_runner_ = BrowserThread::GetTaskRunnerForThread(BrowserThread::UI); |
190 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI); | |
191 } | 190 } |
192 } | 191 } |
193 | 192 |
194 BrowserCdmManager::~BrowserCdmManager() { | 193 BrowserCdmManager::~BrowserCdmManager() { |
195 DVLOG(1) << __FUNCTION__ << ": " << render_process_id_; | 194 DVLOG(1) << __FUNCTION__ << ": " << render_process_id_; |
196 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 195 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
197 } | 196 } |
198 | 197 |
199 // Makes sure BrowserCdmManager is always deleted on the Browser UI thread. | 198 // Makes sure BrowserCdmManager is always deleted on the Browser UI thread. |
200 void BrowserCdmManager::OnDestruct() const { | 199 void BrowserCdmManager::OnDestruct() const { |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 scoped_refptr<MediaKeys> cdm = GetCdm(render_frame_id, cdm_id); | 729 scoped_refptr<MediaKeys> cdm = GetCdm(render_frame_id, cdm_id); |
731 if (!cdm) { | 730 if (!cdm) { |
732 promise->reject(MediaKeys::INVALID_STATE_ERROR, 0, "CDM not found."); | 731 promise->reject(MediaKeys::INVALID_STATE_ERROR, 0, "CDM not found."); |
733 return; | 732 return; |
734 } | 733 } |
735 | 734 |
736 cdm->LoadSession(session_type, session_id, std::move(promise)); | 735 cdm->LoadSession(session_type, session_id, std::move(promise)); |
737 } | 736 } |
738 | 737 |
739 } // namespace content | 738 } // namespace content |
OLD | NEW |