| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chrome/browser/media/android/cdm/media_drm_storage_factory.h" | 5 #include "chrome/browser/media/android/cdm/media_drm_storage_factory.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "components/cdm/browser/media_drm_storage_impl.h" | 12 #include "components/cdm/browser/media_drm_storage_impl.h" |
| 13 #include "components/prefs/pref_service.h" | 13 #include "components/prefs/pref_service.h" |
| 14 #include "content/public/browser/browser_context.h" | 14 #include "content/public/browser/browser_context.h" |
| 15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 #include "content/public/browser/render_frame_host.h" | 16 #include "content/public/browser/render_frame_host.h" |
| 17 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 18 #include "mojo/public/cpp/bindings/strong_binding.h" | 18 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 19 | 19 |
| 20 namespace chrome { | 20 namespace chrome { |
| 21 | 21 |
| 22 void CreateMediaDrmStorage(content::RenderFrameHost* render_frame_host, | 22 void CreateMediaDrmStorage(content::RenderFrameHost* render_frame_host, |
| 23 const service_manager::BindSourceInfo& source_info, |
| 23 media::mojom::MediaDrmStorageRequest request) { | 24 media::mojom::MediaDrmStorageRequest request) { |
| 24 DVLOG(1) << __func__; | 25 DVLOG(1) << __func__; |
| 25 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 26 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 26 DCHECK(render_frame_host); | 27 DCHECK(render_frame_host); |
| 27 | 28 |
| 28 content::WebContents* web_contents = | 29 content::WebContents* web_contents = |
| 29 content::WebContents::FromRenderFrameHost(render_frame_host); | 30 content::WebContents::FromRenderFrameHost(render_frame_host); |
| 30 DCHECK(web_contents) << "WebContents not available."; | 31 DCHECK(web_contents) << "WebContents not available."; |
| 31 | 32 |
| 32 content::BrowserContext* browser_context = web_contents->GetBrowserContext(); | 33 content::BrowserContext* browser_context = web_contents->GetBrowserContext(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 44 return; | 45 return; |
| 45 } | 46 } |
| 46 | 47 |
| 47 // The object will be deleted on connection error, or when the frame navigates | 48 // The object will be deleted on connection error, or when the frame navigates |
| 48 // away. | 49 // away. |
| 49 new cdm::MediaDrmStorageImpl(render_frame_host, pref_service, origin, | 50 new cdm::MediaDrmStorageImpl(render_frame_host, pref_service, origin, |
| 50 std::move(request)); | 51 std::move(request)); |
| 51 } | 52 } |
| 52 | 53 |
| 53 } // namespace chrome | 54 } // namespace chrome |
| OLD | NEW |