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

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: 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 22c56a9e6894643e51f6f3838131dc6da513c8ce..f0b724e2afd549baf05eca6d5ace95998c52761c 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.h"
#include "mojo/public/cpp/system/core.h"
namespace mojo {
@@ -55,7 +56,8 @@ class MessageReader;
// 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 MojoBootstrap::Delegate {
public:
// Create ChannelMojo. A bootstrap channel is created as well.
static scoped_ptr<ChannelMojo> Create(
@@ -77,6 +79,7 @@ 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;
@@ -92,6 +95,11 @@ class IPC_MOJO_EXPORT ChannelMojo : public Channel {
#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);
@@ -115,9 +123,10 @@ class IPC_MOJO_EXPORT ChannelMojo : public Channel {
// notifications invoked by them.
typedef internal::MessagePipeReader::DelayedDeleter ReaderDeleter;
- 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