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); |
}; |