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

Unified Diff: base/message_pump_dispatcher.h

Issue 10143001: Work in progress: Adds MessagePumpDispatcher::ShouldExit(). This is used to handle the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | « ash/accelerators/nested_dispatcher_controller_unittest.cc ('k') | base/message_pump_glib.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_pump_dispatcher.h
diff --git a/base/message_pump_dispatcher.h b/base/message_pump_dispatcher.h
index 685e92be7d8ee7c8708341363a2ef5c0736181fd..d9860c05e393a01890e401af85c49ce6491a946f 100644
--- a/base/message_pump_dispatcher.h
+++ b/base/message_pump_dispatcher.h
@@ -15,11 +15,12 @@ namespace base {
// events when |MessageLoop::RunWithDispatcher| is invoked. If
// |MessageLoop::Run| is invoked, MessageLoop does not dispatch events
// (or invoke TranslateMessage), rather every message is passed to
-// Dispatcher's Dispatch method for dispatch. It is up to the
-// Dispatcher whether or not to dispatch the event.
+// Dispatcher's Dispatch() method for dispatch. It is up to the
+// Dispatcher whether or not to dispatch the event. Additionally, before
+// any Tasks are processed ShouldExit() is invoked.
//
-// The nested loop is exited by either posting a quit, or returning false
-// from Dispatch.
+// The nested loop is exited by either posting a quit, or returning false from
+// Dispatch() or ShouldExit().
class BASE_EXPORT MessagePumpDispatcher {
public:
virtual ~MessagePumpDispatcher() {}
@@ -27,6 +28,10 @@ class BASE_EXPORT MessagePumpDispatcher {
// Dispatches the event. If true is returned processing continues as
// normal. If false is returned, the nested loop exits immediately.
virtual bool Dispatch(const NativeEvent& event) = 0;
+
+ // Returns true if the loop should exit before processing a task.
+ // NOTE: this is currently only wired up on Linux.
+ virtual bool ShouldExit() = 0;
};
} // namespace base
« no previous file with comments | « ash/accelerators/nested_dispatcher_controller_unittest.cc ('k') | base/message_pump_glib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698