Index: base/message_loop/message_loop.h |
diff --git a/base/message_loop/message_loop.h b/base/message_loop/message_loop.h |
index b9517c450ee80e929e8e06e75f80a76f70a4bb4e..9baa849e0de9ef448b622c28e9cba8787fb0193d 100644 |
--- a/base/message_loop/message_loop.h |
+++ b/base/message_loop/message_loop.h |
@@ -291,12 +291,8 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate { |
// Returns the type passed to the constructor. |
Type type() const { return type_; } |
- // Optional call to connect the thread name with this loop. |
- void set_thread_name(const std::string& thread_name) { |
- DCHECK(thread_name_.empty()) << "Should not rename this thread!"; |
- thread_name_ = thread_name; |
- } |
- const std::string& thread_name() const { return thread_name_; } |
+ // Returns the name of the thread this message loop is bound to. |
+ std::string GetThreadName() const; |
// Gets the TaskRunner associated with this message loop. |
const scoped_refptr<SingleThreadTaskRunner>& task_runner() { |
@@ -533,7 +529,6 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate { |
// if type_ is TYPE_CUSTOM and pump_ is null. |
MessagePumpFactoryCallback pump_factory_; |
- std::string thread_name_; |
// A profiling histogram showing the counts of various messages and events. |
HistogramBase* message_histogram_; |
@@ -552,6 +547,9 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate { |
scoped_refptr<SingleThreadTaskRunner> task_runner_; |
std::unique_ptr<ThreadTaskRunnerHandle> thread_task_runner_handle_; |
+ // Id of the thread this message loop is bound to. |
+ PlatformThreadId thread_id_; |
+ |
template <class T, class R> friend class base::subtle::DeleteHelperInternal; |
template <class T, class R> friend class base::subtle::ReleaseHelperInternal; |