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

Unified Diff: content/gpu/gpu_child_thread.cc

Issue 1297953004: Support mojo applications in GPU process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 5 years, 2 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 1fe92720338bc819404b810e80f00487f9fde67a..2c0d2b2c417667866289b2c427b3831bd4d2ed81 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -12,6 +12,7 @@
#include "content/child/thread_safe_sender.h"
#include "content/common/gpu/gpu_memory_buffer_factory.h"
#include "content/common/gpu/gpu_messages.h"
+#include "content/gpu/gpu_process_control_impl.h"
#include "content/gpu/gpu_watchdog_thread.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
@@ -189,6 +190,12 @@ void GpuChildThread::Shutdown() {
void GpuChildThread::Init(const base::Time& process_start_time) {
process_start_time_ = process_start_time;
+
+ process_control_.reset(new GpuProcessControlImpl());
+ // Use of base::Unretained(this) is safe here because |service_registry()|
+ // will be destroyed before GpuChildThread is destructed.
+ service_registry()->AddService(base::Bind(
+ &GpuChildThread::BindProcessControlRequest, base::Unretained(this)));
}
bool GpuChildThread::Send(IPC::Message* msg) {
@@ -381,4 +388,11 @@ void GpuChildThread::OnGpuSwitched() {
ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched();
}
+void GpuChildThread::BindProcessControlRequest(
+ mojo::InterfaceRequest<ProcessControl> request) {
+ DVLOG(1) << "GPU: Binding ProcessControl request";
+ DCHECK(process_control_);
+ process_control_bindings_.AddBinding(process_control_.get(), request.Pass());
+}
+
} // namespace content
« 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