Chromium Code Reviews| Index: base/message_loop.h |
| diff --git a/base/message_loop.h b/base/message_loop.h |
| index 9d500d7dd898a0e8e344328b310352823f8c6392..1dcc2b739b3d6e54f62d2c91e6aeea7ff1b187aa 100644 |
| --- a/base/message_loop.h |
| +++ b/base/message_loop.h |
| @@ -107,7 +107,7 @@ 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(const char* thread_name, Type type = TYPE_DEFAULT); |
|
nduca
2011/08/02 01:26:39
I'm fine making the thread_name optional, if you t
|
| virtual ~MessageLoop(); |
| // Returns the MessageLoop object for the current thread, or null if none. |
| @@ -255,11 +255,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 +565,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 +628,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. |