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

Unified Diff: content/common/mojo/mojo_shell_connection_impl.cc

Issue 2100693002: Make RenderProcessHost/RenderThread use MojoChildConnection/MojoShellConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rph2
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/common/mojo/mojo_shell_connection_impl.h ('k') | content/public/child/child_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/mojo/mojo_shell_connection_impl.cc
diff --git a/content/common/mojo/mojo_shell_connection_impl.cc b/content/common/mojo/mojo_shell_connection_impl.cc
index 93ba749fd178f6e4dffcdbda6db118f35ea842f5..6c5ef64a781e49dbfea18901945818a57531d393 100644
--- a/content/common/mojo/mojo_shell_connection_impl.cc
+++ b/content/common/mojo/mojo_shell_connection_impl.cc
@@ -100,6 +100,32 @@ bool MojoShellConnectionImpl::AcceptConnection(shell::Connection* connection) {
return accept;
}
+shell::InterfaceRegistry*
+MojoShellConnectionImpl::GetInterfaceRegistryForConnection() {
+ // TODO(beng): This is really horrible since obviously subject to issues
+ // of ordering, but is no more horrible than this API is in general.
+ shell::InterfaceRegistry* registry = nullptr;
+ for (auto& client : embedded_shell_clients_) {
+ registry = client->GetInterfaceRegistryForConnection();
+ if (registry)
+ return registry;
+ }
+ return nullptr;
+}
+
+shell::InterfaceProvider*
+MojoShellConnectionImpl::GetInterfaceProviderForConnection() {
+ // TODO(beng): This is really horrible since obviously subject to issues
+ // of ordering, but is no more horrible than this API is in general.
+ shell::InterfaceProvider* provider = nullptr;
+ for (auto& client : embedded_shell_clients_) {
+ provider = client->GetInterfaceProviderForConnection();
+ if (provider)
+ return provider;
+ }
+ return nullptr;
+}
+
////////////////////////////////////////////////////////////////////////////////
// MojoShellConnectionImpl,
// shell::InterfaceFactory<shell::mojom::ShellClientFactory> implementation:
@@ -145,7 +171,13 @@ void MojoShellConnectionImpl::SetConnectionLostClosure(
void MojoShellConnectionImpl::AddEmbeddedShellClient(
std::unique_ptr<shell::ShellClient> shell_client) {
- embedded_shell_clients_.push_back(std::move(shell_client));
+ embedded_shell_clients_.push_back(shell_client.get());
+ owned_shell_clients_.push_back(std::move(shell_client));
+}
+
+void MojoShellConnectionImpl::AddEmbeddedShellClient(
+ shell::ShellClient* shell_client) {
+ embedded_shell_clients_.push_back(shell_client);
}
void MojoShellConnectionImpl::AddEmbeddedService(
« no previous file with comments | « content/common/mojo/mojo_shell_connection_impl.h ('k') | content/public/child/child_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698