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

Unified Diff: mojo/edk/platform/message_loop.h

Issue 1465203003: EDK: Make ConnectionManagerTest not use base::MessageLoop/RunLoop. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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/edk/base_edk/platform_message_loop_impl_unittest.cc ('k') | mojo/edk/system/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/platform/message_loop.h
diff --git a/mojo/edk/platform/message_loop.h b/mojo/edk/platform/message_loop.h
index ad501776cd50f3e586867281b29110409afc63f0..4d6ae15a5d413dc69b1c7ad6c358a3033e54af20 100644
--- a/mojo/edk/platform/message_loop.h
+++ b/mojo/edk/platform/message_loop.h
@@ -28,20 +28,24 @@ class MessageLoop {
public:
virtual ~MessageLoop() {}
- // Runs the message loop until it is told to quit (via |QuitWhenIdle()|).
+ // Runs the message loop until it is told to quit (via |QuitNow() or
+ // |QuitWhenIdle()|).
virtual void Run() = 0;
// Runs the message loop until there are no more tasks available to execute
// immediately (i.e., not including delayed tasks).
virtual void RunUntilIdle() = 0;
- // Quits the message loop when there are no more tasks available to execute
- // immediately. (Note that this includes "future" tasks, i.e., those that are
- // posted as a result of executing other tasks, so this may never quit.
- // However, it does not include delayed tasks.)
- // TODO(vtl): Do we also want a |QuitNow()|?
+ // If running, quits the message loop when there are no more tasks available
+ // to execute immediately. (Note that this includes "future" tasks, i.e.,
+ // those that are posted as a result of executing other tasks, so this may
+ // never quit. However, it does not include delayed tasks.)
virtual void QuitWhenIdle() = 0;
+ // If running, quits the message loop now (i.e., do not process any further
+ // tasks until |Run()| or |RunUntilIdle()|) is called again.
+ virtual void QuitNow() = 0;
+
// Gets the |TaskRunner| for this message loop, which can be used to post
// tasks to it. For a given |MessageLoop| instance, this will always return a
// reference to the same |TaskRunner| (and different |MessageLoop| instances
« no previous file with comments | « mojo/edk/base_edk/platform_message_loop_impl_unittest.cc ('k') | mojo/edk/system/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698