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

Unified Diff: ipc/mojo/ipc_mojo_bootstrap.cc

Issue 671513011: Add a guard in MojoBootstrap::OnClientLaunched() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/mojo/ipc_mojo_bootstrap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/mojo/ipc_mojo_bootstrap.cc
diff --git a/ipc/mojo/ipc_mojo_bootstrap.cc b/ipc/mojo/ipc_mojo_bootstrap.cc
index 7233de0fa2d0259b5389f5e1306397b81f9683fa..30c33a89f7c0f4409b4181e718b496f78b0f0d8d 100644
--- a/ipc/mojo/ipc_mojo_bootstrap.cc
+++ b/ipc/mojo/ipc_mojo_bootstrap.cc
@@ -84,6 +84,9 @@ void MojoServerBootstrap::SendClientPipeIfReady() {
}
void MojoServerBootstrap::OnClientLaunched(base::ProcessHandle process) {
+ if (HasFailed())
+ return;
+
DCHECK_EQ(state(), STATE_INITIALIZED);
DCHECK_NE(process, base::kNullProcessHandle);
client_process_ = process;
@@ -202,6 +205,10 @@ void MojoBootstrap::Fail() {
delegate()->OnBootstrapError();
}
+bool MojoBootstrap::HasFailed() const {
+ return state() == STATE_ERROR;
+}
+
bool MojoBootstrap::Send(Message* message) {
return channel_->Send(message);
}
« no previous file with comments | « ipc/mojo/ipc_mojo_bootstrap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698