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

Unified Diff: mojo/common/message_pump_mojo.h

Issue 506353002: Make HandleWatcher watch on the same thread if the thread is running a MessagePumpMojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix mac/win linkng 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/common/handle_watcher_unittest.cc ('k') | mojo/common/message_pump_mojo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/message_pump_mojo.h
diff --git a/mojo/common/message_pump_mojo.h b/mojo/common/message_pump_mojo.h
index 7b2c1703162dbef35cf4b13a8a71412e20b6418d..8b71316bf79d9e0facc09e5232ec5e9344481944 100644
--- a/mojo/common/message_pump_mojo.h
+++ b/mojo/common/message_pump_mojo.h
@@ -29,6 +29,11 @@ class MOJO_COMMON_EXPORT MessagePumpMojo : public base::MessagePump {
// using |base::Bind()|).
static scoped_ptr<base::MessagePump> Create();
+ // Returns the MessagePumpMojo instance of the current thread, if it exists.
+ static MessagePumpMojo* current();
+
+ static bool IsCurrent() { return !!current(); }
+
// Registers a MessagePumpMojoHandler for the specified handle. Only one
// handler can be registered for a specified handle.
// NOTE: a value of 0 for |deadline| indicates an indefinite timeout.
« no previous file with comments | « mojo/common/handle_watcher_unittest.cc ('k') | mojo/common/message_pump_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698