Index: base/message_loop.h |
diff --git a/base/message_loop.h b/base/message_loop.h |
index 9d500d7dd898a0e8e344328b310352823f8c6392..df349c8a7d6f67ef4299c558f3ecdca2961c325a 100644 |
--- a/base/message_loop.h |
+++ b/base/message_loop.h |
@@ -107,7 +107,8 @@ class BASE_API MessageLoop : public base::MessagePump::Delegate { |
// Normally, it is not necessary to instantiate a MessageLoop. Instead, it |
// is typical to make use of the current thread's MessageLoop instance. |
- explicit MessageLoop(Type type = TYPE_DEFAULT); |
+ explicit MessageLoop(Type type = TYPE_DEFAULT, |
+ const char* thread_name = NULL); |
virtual ~MessageLoop(); |
// Returns the MessageLoop object for the current thread, or null if none. |
@@ -255,11 +256,7 @@ class BASE_API MessageLoop : public base::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; |
- } |
+ // Returns the name associated with this message loop's thread. |
const std::string& thread_name() const { return thread_name_; } |
// Enables or disables the recursive task processing. This happens in the case |
@@ -569,7 +566,8 @@ class BASE_API MessageLoop : public base::MessagePump::Delegate { |
// |
class BASE_API MessageLoopForUI : public MessageLoop { |
public: |
- MessageLoopForUI() : MessageLoop(TYPE_UI) { |
+ MessageLoopForUI(const char* thread_name) |
+ : MessageLoop(thread_name, TYPE_UI) { |
} |
// Returns the MessageLoopForUI of the current thread. |
@@ -631,7 +629,8 @@ class BASE_API MessageLoopForIO : public MessageLoop { |
#endif |
- MessageLoopForIO() : MessageLoop(TYPE_IO) { |
+ MessageLoopForIO(const char* thread_name) |
+ : MessageLoop(thread_name, TYPE_IO) { |
} |
// Returns the MessageLoopForIO of the current thread. |