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

Unified Diff: ipc/mojo/ipc_channel_mojo.h

Issue 553283002: IPC::ChannelMojo: Introduce IPC::MojoBootstrap for Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing windows build error Created 6 years, 3 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
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_;

Powered by Google App Engine
This is Rietveld 408576698