| Index: ipc/mojo/ipc_channel_mojo.h
|
| diff --git a/ipc/mojo/ipc_channel_mojo.h b/ipc/mojo/ipc_channel_mojo.h
|
| index dd57bc8bf9aa45d3ed57581cc0fc2ab19d1e2e26..51be845a952bda4ffccae977810134281f821e38 100644
|
| --- a/ipc/mojo/ipc_channel_mojo.h
|
| +++ b/ipc/mojo/ipc_channel_mojo.h
|
| @@ -14,6 +14,7 @@
|
| #include "ipc/ipc_channel_factory.h"
|
| #include "ipc/ipc_export.h"
|
| #include "ipc/mojo/ipc_message_pipe_reader.h"
|
| +#include "ipc/mojo/ipc_mojo_bootstrap_delegate.h"
|
| #include "mojo/public/cpp/system/core.h"
|
|
|
| namespace mojo {
|
| @@ -24,6 +25,8 @@ struct ChannelInfo;
|
|
|
| namespace IPC {
|
|
|
| +class MojoBootstrap;
|
| +
|
| // Mojo-based IPC::Channel implementation over a platform handle.
|
| //
|
| // ChannelMojo builds Mojo MessagePipe using underlying pipe given by
|
| @@ -48,7 +51,8 @@ namespace IPC {
|
| // TODO(morrita): Add APIs to create extra MessagePipes to let
|
| // Mojo-based objects talk over this Channel.
|
| //
|
| -class IPC_MOJO_EXPORT ChannelMojo : public Channel {
|
| +class IPC_MOJO_EXPORT ChannelMojo : public Channel,
|
| + public MojoBootstrapDelegate {
|
| public:
|
| // Create ChannelMojo. A bootstrap channel is created as well.
|
| static scoped_ptr<ChannelMojo> Create(
|
| @@ -70,12 +74,18 @@ class IPC_MOJO_EXPORT ChannelMojo : public Channel {
|
| virtual base::ProcessId GetPeerPID() const OVERRIDE;
|
| virtual base::ProcessId GetSelfPID() const OVERRIDE;
|
| virtual ChannelHandle TakePipeHandle() OVERRIDE;
|
| + virtual void OnClientLaunched(base::ProcessHandle handle) OVERRIDE;
|
|
|
| #if defined(OS_POSIX) && !defined(OS_NACL)
|
| virtual int GetClientFileDescriptor() const OVERRIDE;
|
| virtual int TakeClientFileDescriptor() OVERRIDE;
|
| #endif // defined(OS_POSIX) && !defined(OS_NACL)
|
|
|
| + // MojoBootstrapDelegate implementation
|
| + virtual void OnPipeAvailable(
|
| + mojo::embedder::ScopedPlatformHandle handle) OVERRIDE;
|
| + virtual void OnBootstrapError() OVERRIDE;
|
| +
|
| // Called from MessagePipeReader implementations
|
| void OnMessageReceived(Message& message);
|
| void OnConnected(mojo::ScopedMessagePipeHandle pipe);
|
| @@ -98,12 +108,15 @@ class IPC_MOJO_EXPORT ChannelMojo : public Channel {
|
| class ClientControlReader;
|
| class MessageReader;
|
|
|
| - ChannelMojo(scoped_ptr<Channel> bootstrap, Mode mode, Listener* listener,
|
| + ChannelMojo(ChannelHandle handle,
|
| + Mode mode,
|
| + Listener* listener,
|
| scoped_refptr<base::TaskRunner> io_thread_task_runner);
|
|
|
| - void InitOnIOThread();
|
| + void InitBootstrap(ChannelHandle handle);
|
| + void InitControlReader(mojo::embedder::ScopedPlatformHandle handle);
|
|
|
| - scoped_ptr<Channel> bootstrap_;
|
| + scoped_ptr<MojoBootstrap> bootstrap_;
|
| Mode mode_;
|
| Listener* listener_;
|
| base::ProcessId peer_pid_;
|
|
|