Index: ipc/ipc_channel_mojo.cc |
diff --git a/ipc/ipc_channel_mojo.cc b/ipc/ipc_channel_mojo.cc |
index 80bbfb5627d562803885933a417241d70041ca1b..d4fdca56b72edb6f3faef345e53aa6d77ac6b7db 100644 |
--- a/ipc/ipc_channel_mojo.cc |
+++ b/ipc/ipc_channel_mojo.cc |
@@ -282,14 +282,6 @@ ChannelMojo::~ChannelMojo() { |
} |
bool ChannelMojo::Connect() { |
- if (!ConnectPaused()) |
- return false; |
- |
- Unpause(true); |
- return true; |
-} |
- |
-bool ChannelMojo::ConnectPaused() { |
WillConnect(); |
DCHECK(!task_runner_); |
@@ -300,14 +292,12 @@ bool ChannelMojo::ConnectPaused() { |
return true; |
} |
-void ChannelMojo::Unpause(bool flush) { |
- bootstrap_->Start(); |
- |
- // Ensure that no matter what messages have been queued so far, the first |
- // message we send is always the peer PID. |
- DCHECK(message_reader_); |
- message_reader_->sender()->SetPeerPid(GetSelfPID()); |
+void ChannelMojo::Pause() { |
+ bootstrap_->Pause(); |
+} |
+void ChannelMojo::Unpause(bool flush) { |
+ bootstrap_->Unpause(); |
if (flush) |
Flush(); |
} |
@@ -330,6 +320,7 @@ void ChannelMojo::Close() { |
// MojoBootstrap::Delegate implementation |
void ChannelMojo::OnPipesAvailable(mojom::ChannelAssociatedPtr sender, |
mojom::ChannelAssociatedRequest receiver) { |
+ sender->SetPeerPid(GetSelfPID()); |
message_reader_.reset(new internal::MessagePipeReader( |
pipe_, std::move(sender), std::move(receiver), this)); |
} |