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

Unified Diff: mojo/system/channel.h

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: comment fix 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
« no previous file with comments | « mojo/embedder/embedder.cc ('k') | mojo/system/channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/channel.h
diff --git a/mojo/system/channel.h b/mojo/system/channel.h
index 89c3a40f33746bccaa1da2f56c0615bbd773d3a4..61895d6bcfe0e0a85b4759c7fa676f7761a58375 100644
--- a/mojo/system/channel.h
+++ b/mojo/system/channel.h
@@ -67,6 +67,12 @@ class MOJO_SYSTEM_IMPL_EXPORT Channel
// happen on any thread).
void Shutdown();
+ // Signals that |Shutdown()| will be called soon (this may be called from any
+ // thread, unlike |Shutdown()|). Warnings will be issued if, e.g., messages
+ // are written after this is called; other warnings may be suppressed. (This
+ // may be called multiple times, or not at all.)
+ void WillShutdownSoon();
+
// Attaches the given message pipe/port's endpoint (which must be a
// |ProxyMessagePipeEndpoint|) to this channel. This assigns it a local ID,
// which it returns. The first message pipe endpoint attached will always have
@@ -172,8 +178,6 @@ class MOJO_SYSTEM_IMPL_EXPORT Channel
MessageInTransit::EndpointId source_id,
MessageInTransit::EndpointId destination_id);
- bool is_running_no_lock() const { return is_running_; }
-
base::ThreadChecker creation_thread_checker_;
// Note: |MessagePipe|s MUST NOT be used under |lock_|. I.e., |lock_| can only
@@ -185,6 +189,8 @@ class MOJO_SYSTEM_IMPL_EXPORT Channel
scoped_ptr<RawChannel> raw_channel_;
bool is_running_;
+ // Set when |WillShutdownSoon()| is called.
+ bool is_shutting_down_;
typedef base::hash_map<MessageInTransit::EndpointId, EndpointInfo>
IdToEndpointInfoMap;
« no previous file with comments | « mojo/embedder/embedder.cc ('k') | mojo/system/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698