| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 290 |
| 291 #if defined(OS_ANDROID) | 291 #if defined(OS_ANDROID) |
| 292 if (!cdm_factory_) { | 292 if (!cdm_factory_) { |
| 293 // Obtain http request context for the current render process. | 293 // Obtain http request context for the current render process. |
| 294 net::URLRequestContextGetter* context_getter = | 294 net::URLRequestContextGetter* context_getter = |
| 295 BrowserContext::GetDefaultStoragePartition( | 295 BrowserContext::GetDefaultStoragePartition( |
| 296 RenderProcessHost::FromID(render_process_id_)-> | 296 RenderProcessHost::FromID(render_process_id_)-> |
| 297 GetBrowserContext())->GetURLRequestContext(); | 297 GetBrowserContext())->GetURLRequestContext(); |
| 298 DCHECK(context_getter); | 298 DCHECK(context_getter); |
| 299 | 299 |
| 300 // Permission check is done in BrowserCdmManager so just pass in a null |
| 301 // MediaPermission. |
| 300 cdm_factory_.reset(new media::AndroidCdmFactory( | 302 cdm_factory_.reset(new media::AndroidCdmFactory( |
| 301 base::Bind(&CreateProvisionFetcher, context_getter))); | 303 nullptr, base::Bind(&CreateProvisionFetcher, context_getter))); |
| 302 } | 304 } |
| 303 #endif | 305 #endif |
| 304 } | 306 } |
| 305 | 307 |
| 306 return cdm_factory_.get(); | 308 return cdm_factory_.get(); |
| 307 } | 309 } |
| 308 | 310 |
| 309 void BrowserCdmManager::OnSessionMessage(int render_frame_id, | 311 void BrowserCdmManager::OnSessionMessage(int render_frame_id, |
| 310 int cdm_id, | 312 int cdm_id, |
| 311 const std::string& session_id, | 313 const std::string& session_id, |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 scoped_refptr<MediaKeys> cdm = GetCdm(render_frame_id, cdm_id); | 732 scoped_refptr<MediaKeys> cdm = GetCdm(render_frame_id, cdm_id); |
| 731 if (!cdm) { | 733 if (!cdm) { |
| 732 promise->reject(MediaKeys::INVALID_STATE_ERROR, 0, "CDM not found."); | 734 promise->reject(MediaKeys::INVALID_STATE_ERROR, 0, "CDM not found."); |
| 733 return; | 735 return; |
| 734 } | 736 } |
| 735 | 737 |
| 736 cdm->LoadSession(session_type, session_id, std::move(promise)); | 738 cdm->LoadSession(session_type, session_id, std::move(promise)); |
| 737 } | 739 } |
| 738 | 740 |
| 739 } // namespace content | 741 } // namespace content |
| OLD | NEW |