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

Unified Diff: mojo/embedder/embedder.cc

Issue 472603002: Mojo: Add the ability to notify a Mojo Channel that it's going to be destroyed soon. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
Index: mojo/embedder/embedder.cc
diff --git a/mojo/embedder/embedder.cc b/mojo/embedder/embedder.cc
index 674e7c205073565d53748956f5321622f85ecffe..a9f70c5ef09cc70dd270baccccf1f407a9ccf5ee 100644
--- a/mojo/embedder/embedder.cc
+++ b/mojo/embedder/embedder.cc
@@ -173,10 +173,21 @@ void DestroyChannel(ChannelInfo* channel_info) {
DCHECK(channel_info);
DCHECK(channel_info->io_thread_task_runner);
+ if (!channel_info->channel) {
+ // Presumably, |Init()| on the channel failed.
+ return;
+ }
+
+ channel_info->channel->WillShutdownSoon();
channel_info->io_thread_task_runner->PostTask(
FROM_HERE, base::Bind(&DestroyChannelOnIOThread, channel_info));
}
+void WillDestroyChannelSoon(ChannelInfo* channel_info) {
+ DCHECK(channel_info);
+ channel_info->channel->WillShutdownSoon();
+}
+
MojoResult CreatePlatformHandleWrapper(
ScopedPlatformHandle platform_handle,
MojoHandle* platform_handle_wrapper_handle) {

Powered by Google App Engine
This is Rietveld 408576698