Index: content/child/child_thread_impl.h |
diff --git a/content/child/child_thread_impl.h b/content/child/child_thread_impl.h |
index 1ca22473af0e79fe55861880ed6af5aa256e4c8f..a59ca84b6d99a3561b6d1533a1ad6a3d56127346 100644 |
--- a/content/child/child_thread_impl.h |
+++ b/content/child/child_thread_impl.h |
@@ -24,6 +24,7 @@ |
#include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. |
#include "ipc/ipc_platform_file.h" |
#include "ipc/message_router.h" |
+#include "services/shell/public/cpp/shell_client.h" |
namespace base { |
class MessageLoop; |
@@ -68,7 +69,8 @@ struct RequestInfo; |
// The main thread of a child process derives from this class. |
class CONTENT_EXPORT ChildThreadImpl |
: public IPC::Listener, |
- virtual public ChildThread { |
+ virtual public ChildThread, |
+ public NON_EXPORTED_BASE(shell::ShellClient){ |
public: |
struct CONTENT_EXPORT Options; |
@@ -96,9 +98,14 @@ class CONTENT_EXPORT ChildThreadImpl |
#endif |
void RecordAction(const base::UserMetricsAction& action) override; |
void RecordComputedAction(const std::string& action) override; |
+ MojoShellConnection* GetMojoShellConnection() override; |
shell::InterfaceRegistry* GetInterfaceRegistry() override; |
shell::InterfaceProvider* GetRemoteInterfaces() override; |
+ // shell::ShellClient: |
+ shell::InterfaceRegistry* GetInterfaceRegistryForConnection() override; |
+ shell::InterfaceProvider* GetInterfaceProviderForConnection() override; |
+ |
IPC::SyncChannel* channel() { return channel_.get(); } |
IPC::MessageRouter* GetRouter(); |
@@ -247,7 +254,11 @@ class CONTENT_EXPORT ChildThreadImpl |
void EnsureConnected(); |
std::unique_ptr<mojo::edk::ScopedIPCSupport> mojo_ipc_support_; |
+ bool use_mojo_shell_connection_ = false; |
std::unique_ptr<MojoApplication> mojo_application_; |
+ std::unique_ptr<MojoShellConnection> mojo_shell_connection_; |
+ std::unique_ptr<shell::InterfaceRegistry> interface_registry_; |
+ std::unique_ptr<shell::InterfaceProvider> remote_interfaces_; |
std::string channel_name_; |
std::unique_ptr<IPC::SyncChannel> channel_; |
@@ -318,6 +329,7 @@ struct ChildThreadImpl::Options { |
std::vector<IPC::MessageFilter*> startup_filters; |
std::string in_process_ipc_token; |
std::string in_process_application_token; |
+ bool use_mojo_shell_connection = false; |
private: |
Options(); |
@@ -331,6 +343,7 @@ class ChildThreadImpl::Options::Builder { |
Builder& UseMojoChannel(bool use_mojo_channel); |
Builder& WithChannelName(const std::string& channel_name); |
Builder& AddStartupFilter(IPC::MessageFilter* filter); |
+ Builder& UseMojoShellConnection(bool use_mojo_shell_connection); |
Options Build(); |