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

Unified Diff: content/gpu/gpu_child_thread.cc

Issue 1837143002: media: Pass MediaPermission to MediaDrmBridge Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More plumbing Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/gpu/gpu_child_thread.h ('k') | content/gpu/gpu_process_control_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/gpu_child_thread.cc
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
index 2dec918da27a80a69e43d0e90400f99686d7e22e..8ad8301f3dba46397062e1fcc877db4628f80517 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -21,6 +21,7 @@
#include "content/common/gpu/media/gpu_video_encode_accelerator.h"
#include "content/common/gpu/media/media_service.h"
#include "content/common/gpu_host_messages.h"
+#include "content/common/media/media_permission_dispatcher.h"
#include "content/gpu/gpu_process_control_impl.h"
#include "content/gpu/gpu_watchdog_thread.h"
#include "content/public/common/content_client.h"
@@ -221,7 +222,7 @@ void GpuChildThread::Shutdown() {
void GpuChildThread::Init(const base::Time& process_start_time) {
process_start_time_ = process_start_time;
- process_control_.reset(new GpuProcessControlImpl());
+ process_control_.reset(new GpuProcessControlImpl(GetMediaPermission()));
// Use of base::Unretained(this) is safe here because |service_registry()|
// will be destroyed before GpuChildThread is destructed.
service_registry()->AddService(base::Bind(
@@ -577,6 +578,23 @@ void GpuChildThread::OnLoseAllContexts() {
}
}
+template <typename Interface>
+void GpuChildThread::GetInterface(mojo::InterfaceRequest<Interface> request) {
+ service_registry()->ConnectToRemoteService(std::move(request));
+}
+
+media::MediaPermission* GpuChildThread::GetMediaPermission() {
+ if (!media_permission_dispatcher_) {
+ // Use of base::Unretained(this) is safe here because
+ // |media_permission_dispatcher_| will be destroyed before GpuChildThread
+ // is destructed.
+ media_permission_dispatcher_.reset(new MediaPermissionDispatcher(base::Bind(
+ &GpuChildThread::GetInterface<blink::mojom::PermissionService>,
+ base::Unretained(this))));
+ }
+ return media_permission_dispatcher_.get();
+}
+
void GpuChildThread::BindProcessControlRequest(
mojo::InterfaceRequest<mojom::ProcessControl> request) {
DVLOG(1) << "GPU: Binding ProcessControl request";
« no previous file with comments | « content/gpu/gpu_child_thread.h ('k') | content/gpu/gpu_process_control_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698