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

Unified Diff: mojo/message_pump/handle_watcher.cc

Issue 1501343002: Prepare chrome to use the new Mojo EDK by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable turning on in this cl Created 5 years 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: mojo/message_pump/handle_watcher.cc
diff --git a/mojo/message_pump/handle_watcher.cc b/mojo/message_pump/handle_watcher.cc
index dc3b9b9f37a8990600e0540acf941dfb9ca01eb8..73c423e45e17db07d7e7d7cdc271d8fc740ffd46 100644
--- a/mojo/message_pump/handle_watcher.cc
+++ b/mojo/message_pump/handle_watcher.cc
@@ -271,6 +271,12 @@ void WatcherThreadManager::AddRequest(const RequestData& data) {
if (!was_empty)
return;
}
+
+ // With the new Mojo EDK, the MojoMessagePump will destruct when it sees that
+ // the IO thread has gone away. So at shutdown this can be null.
+ if (!thread_.task_runner())
+ return;
+
// We outlive |thread_|, so it's safe to use Unretained() here.
thread_.task_runner()->PostTask(
FROM_HERE,

Powered by Google App Engine
This is Rietveld 408576698