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

Unified Diff: content/gpu/gpu_child_thread.cc

Issue 2108343002: Defer Mojo interface binding in the gpu process until OnInitialize (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') | services/shell/public/cpp/interface_registry.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 804daefbe5a1b279e92e8f1ea3164012d86b5efd..b0783c4df312e8b52c5ec32eb6199e1a1f7920d3 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -8,6 +8,7 @@
#include <utility>
#include "base/bind.h"
+#include "base/callback_helpers.h"
#include "base/lazy_instance.h"
#include "base/strings/string_number_conversions.h"
#include "base/threading/thread_local.h"
@@ -299,6 +300,14 @@ bool GpuChildThread::AcceptConnection(shell::Connection* connection) {
GetContentClient()->gpu()->ExposeInterfacesToBrowser(
connection->GetInterfaceRegistry());
}
+
+ // We don't want to process any incoming interface requests until
+ // OnInitialize().
+ connection->GetInterfaceRegistry()->PauseBinding();
+ resume_interface_bindings_callback_ = base::Bind(
+ &shell::InterfaceRegistry::ResumeBinding,
+ connection->GetInterfaceRegistry()->GetWeakPtr());
+
return true;
}
@@ -353,6 +362,9 @@ void GpuChildThread::StoreShaderToDisk(int32_t client_id,
}
void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) {
+ if (!resume_interface_bindings_callback_.is_null())
+ base::ResetAndReturn(&resume_interface_bindings_callback_).Run();
+
gpu_preferences_ = gpu_preferences;
gpu_info_.video_decode_accelerator_capabilities =
« no previous file with comments | « content/gpu/gpu_child_thread.h ('k') | services/shell/public/cpp/interface_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698