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

Unified Diff: base/threading/thread.h

Issue 2484283005: Expose Thread::using_external_message_loop() to subclasses. (Closed)
Patch Set: Created 4 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 | « no previous file | base/threading/thread_unittest.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 b8136db8829c172b1a791b372291af4bfffb7ec2..f103e3d22881dec0b0c3b6d6cf423f9b812730f8 100644
--- a/base/threading/thread.h
+++ b/base/threading/thread.h
@@ -244,6 +244,10 @@ class BASE_EXPORT Thread : PlatformThread::Delegate {
// Bind this Thread to an existing MessageLoop instead of starting a new one.
void SetMessageLoop(MessageLoop* message_loop);
+ bool using_external_message_loop() const {
+ return using_external_message_loop_;
+ }
+
private:
#if defined(OS_WIN)
enum ComStatus {
@@ -293,7 +297,9 @@ class BASE_EXPORT Thread : PlatformThread::Delegate {
// True only if |message_loop_| was externally provided by |SetMessageLoop()|
// in which case this Thread has no underlying |thread_| and should merely
- // drop |message_loop_| on Stop().
+ // drop |message_loop_| on Stop(). In that event, this remains true after
+ // Stop() was invoked so that subclasses can use this state to build their own
+ // cleanup logic as required.
bool using_external_message_loop_ = false;
// Stores Options::timer_slack_ until the message loop has been bound to
« no previous file with comments | « no previous file | base/threading/thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698