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

Unified Diff: base/threading/thread.h

Issue 2136563002: Remove calls to MessageLoop::current() in base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: restore dns_config_service_posix_unittest.cc Created 4 years, 5 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 | « base/power_monitor/power_monitor_device_source_win.cc ('k') | base/threading/thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/thread.h
diff --git a/base/threading/thread.h b/base/threading/thread.h
index c9a77d7323ecd2477933a67b3b6af4282df3b66c..475f92c9bdcf9c8ff56b121b0844262e7093c808 100644
--- a/base/threading/thread.h
+++ b/base/threading/thread.h
@@ -24,6 +24,7 @@
namespace base {
class MessagePump;
+class RunLoop;
// A simple thread abstraction that establishes a MessageLoop on a new thread.
// The consumer uses the MessageLoop of the thread to cause code to execute on
@@ -190,8 +191,8 @@ class BASE_EXPORT Thread : PlatformThread::Delegate {
// Called just prior to starting the message loop
virtual void Init() {}
- // Called to start the message loop
- virtual void Run(MessageLoop* message_loop);
+ // Called to start the run loop
+ virtual void Run(RunLoop* run_loop);
// Called just after the message loop ends
virtual void CleanUp() {}
@@ -215,6 +216,8 @@ class BASE_EXPORT Thread : PlatformThread::Delegate {
// PlatformThread::Delegate methods:
void ThreadMain() override;
+ void ThreadQuitHelper();
+
#if defined(OS_WIN)
// Whether this thread needs to initialize COM, and if so, in what mode.
ComStatus com_status_;
@@ -238,9 +241,10 @@ class BASE_EXPORT Thread : PlatformThread::Delegate {
PlatformThreadId id_;
mutable WaitableEvent id_event_; // Protects |id_|.
- // The thread's message loop. Valid only while the thread is alive. Set
- // by the created thread.
+ // The thread's MessageLoop and RunLoop. Valid only while the thread is alive.
+ // Set by the created thread.
MessageLoop* message_loop_;
+ RunLoop* run_loop_;
gab 2016/07/21 19:10:51 Note: this turns out to not be relevant in this sp
// Stores Options::timer_slack_ until the message loop has been bound to
// a thread.
@@ -252,8 +256,6 @@ class BASE_EXPORT Thread : PlatformThread::Delegate {
// Signaled when the created thread gets ready to use the message loop.
mutable WaitableEvent start_event_;
- friend void ThreadQuitHelper();
-
DISALLOW_COPY_AND_ASSIGN(Thread);
};
« no previous file with comments | « base/power_monitor/power_monitor_device_source_win.cc ('k') | base/threading/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698