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

Unified Diff: content/browser/mojo/mojo_child_connection.h

Issue 2111353002: Move content's shell connections to the IO thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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/browser/gpu/gpu_process_host.cc ('k') | content/browser/mojo/mojo_child_connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/mojo/mojo_child_connection.h
diff --git a/content/browser/mojo/mojo_child_connection.h b/content/browser/mojo/mojo_child_connection.h
index 9ed83da4ae977308fed1604f176ec8eb025917aa..c51f67e40b5e6806baaf60de6f94356b0b85b47e 100644
--- a/content/browser/mojo/mojo_child_connection.h
+++ b/content/browser/mojo/mojo_child_connection.h
@@ -9,7 +9,12 @@
#include <string>
#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "base/process/process_handle.h"
+#include "base/sequenced_task_runner.h"
+#include "services/shell/public/cpp/interface_provider.h"
+#include "services/shell/public/cpp/interface_registry.h"
#include "services/shell/public/interfaces/connector.mojom.h"
#if defined(OS_ANDROID)
@@ -35,11 +40,16 @@ class MojoChildConnection {
MojoChildConnection(const std::string& application_name,
const std::string& instance_id,
const std::string& child_token,
- shell::Connector* connector);
+ shell::Connector* connector,
+ scoped_refptr<base::SequencedTaskRunner> io_task_runner);
~MojoChildConnection();
- shell::Connection* connection() const {
- return connection_.get();
+ shell::InterfaceRegistry* GetInterfaceRegistry() {
+ return &interface_registry_;
+ }
+
+ shell::InterfaceProvider* GetRemoteInterfaces() {
+ return &remote_interfaces_;
}
// A token which must be passed to the child process via
@@ -59,13 +69,24 @@ class MojoChildConnection {
#endif
private:
+ class IOThreadContext;
+
+ void GetInterface(const mojo::String& interface_name,
+ mojo::ScopedMessagePipeHandle request_handle);
+
+ scoped_refptr<IOThreadContext> context_;
+
const std::string service_token_;
- std::unique_ptr<shell::Connection> connection_;
- shell::mojom::PIDReceiverPtr pid_receiver_;
+
+ shell::InterfaceRegistry interface_registry_;
+ shell::InterfaceProvider remote_interfaces_;
+
#if defined(OS_ANDROID)
std::unique_ptr<ServiceRegistryAndroid> service_registry_android_;
#endif
+ base::WeakPtrFactory<MojoChildConnection> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(MojoChildConnection);
};
« no previous file with comments | « content/browser/gpu/gpu_process_host.cc ('k') | content/browser/mojo/mojo_child_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698