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

Unified Diff: content/gpu/gpu_child_thread.cc

Issue 2104553002: Migrate GpuProcess to use MojoChild/ShellConnection for the Shell handshake (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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/public/app/BUILD.gn » ('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 2f05bb5f907bf75231814ff39e672059ecfef92f..c79f49bccef75fcf605fe73b0f1b1061054a3514 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -135,6 +135,7 @@ ChildThreadImpl::Options GetOptions(
if (message_filter)
builder.AddStartupFilter(message_filter);
#endif
+ builder.UseMojoShellConnection(true);
return builder.Build();
}
@@ -174,6 +175,7 @@ GpuChildThread::GpuChildThread(
.InBrowserProcess(params)
.AddStartupFilter(new GpuMemoryBufferMessageFilter(
gpu_memory_buffer_factory))
+ .UseMojoShellConnection(true)
.Build()),
gpu_preferences_(gpu_preferences),
dead_on_arrival_(false),
@@ -220,16 +222,8 @@ void GpuChildThread::Init(const base::Time& process_start_time) {
// Only set once per process instance.
process_control_.reset(new GpuProcessControlImpl());
- // Use of base::Unretained(this) is safe here because |service_registry()|
- // will be destroyed before GpuChildThread is destructed.
- GetInterfaceRegistry()->AddInterface(base::Bind(
- &GpuChildThread::BindProcessControlRequest, base::Unretained(this)));
-
- if (GetContentClient()->gpu()) { // NULL in tests.
+ if (GetContentClient()->gpu()) // NULL in tests.
GetContentClient()->gpu()->Initialize(this);
- GetContentClient()->gpu()->ExposeInterfacesToBrowser(
- GetInterfaceRegistry());
- }
}
void GpuChildThread::OnFieldTrialGroupFinalized(const std::string& trial_name,
@@ -297,6 +291,27 @@ bool GpuChildThread::OnMessageReceived(const IPC::Message& msg) {
return false;
}
+bool GpuChildThread::AcceptConnection(shell::Connection* connection) {
+ // Use of base::Unretained(this) is safe here because |service_registry()|
+ // will be destroyed before GpuChildThread is destructed.
+ connection->GetInterfaceRegistry()->AddInterface(base::Bind(
+ &GpuChildThread::BindProcessControlRequest, base::Unretained(this)));
+
+ if (GetContentClient()->gpu()) { // NULL in tests.
+ GetContentClient()->gpu()->ExposeInterfacesToBrowser(
+ connection->GetInterfaceRegistry());
+ }
+ return true;
+}
+
+shell::InterfaceRegistry* GpuChildThread::GetInterfaceRegistryForConnection() {
+ return nullptr;
+}
+
+shell::InterfaceProvider* GpuChildThread::GetInterfaceProviderForConnection() {
+ return nullptr;
+}
+
void GpuChildThread::SetActiveURL(const GURL& url) {
GetContentClient()->SetActiveURL(url);
}
« no previous file with comments | « content/gpu/gpu_child_thread.h ('k') | content/public/app/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698