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

Unified Diff: base/message_loop/message_loop.h

Issue 1942053002: Deletes base::MessageLoop::set_thread_name(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: implements MessageLoop::GetThreadName Created 4 years, 7 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 | « no previous file | base/message_loop/message_loop.cc » ('j') | base/message_loop/message_loop.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | base/message_loop/message_loop.cc » ('j') | base/message_loop/message_loop.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698