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

Unified Diff: mojo/edk/system/node_controller.cc

Issue 2072233005: [mojo-edk] Prevent watching an invalid FD on early broker pipe closure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/node_controller.cc
diff --git a/mojo/edk/system/node_controller.cc b/mojo/edk/system/node_controller.cc
index 2368dab2a5ceb22a36d21ea134de3e291fb68aa2..a1fe420ed50a333aa66409375f06b62a6079dea8 100644
--- a/mojo/edk/system/node_controller.cc
+++ b/mojo/edk/system/node_controller.cc
@@ -202,6 +202,14 @@ void NodeController::ConnectToParent(ScopedPlatformHandle platform_handle) {
platform_handle = broker_->GetParentPlatformHandle();
UMA_HISTOGRAM_TIMES("Mojo.System.GetParentPlatformHandleSyncTime",
timer.Elapsed());
+
+ if (!platform_handle.is_valid()) {
+ // Most likely the browser side of the channel has already been closed and
+ // the broker was unable to negotiate a NodeChannel pipe. In this case we
+ // can cancel parent connection.
+ DVLOG(1) << "Cannot connect to invalid parent channel.";
+ return;
+ }
#endif
io_task_runner_->PostTask(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698