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

Unified Diff: ipc/ipc_channel_mojo.cc

Issue 2316963005: Reworks Channel pausing behavior (Closed)
Patch Set: Created 4 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
« no previous file with comments | « ipc/ipc_channel_mojo.h ('k') | ipc/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
« no previous file with comments | « ipc/ipc_channel_mojo.h ('k') | ipc/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698