Chromium Code Reviews| Index: ios/web/web_thread_impl.cc |
| diff --git a/ios/web/web_thread_impl.cc b/ios/web/web_thread_impl.cc |
| index 38f4a33ac3ee76c6912e5a568be897214de3d0c3..4e5e58fcfb57df3b89d84328b52c767616d57a6b 100644 |
| --- a/ios/web/web_thread_impl.cc |
| +++ b/ios/web/web_thread_impl.cc |
| @@ -115,7 +115,7 @@ WebThreadImpl::WebThreadImpl(ID identifier) |
| } |
| WebThreadImpl::WebThreadImpl(ID identifier, base::MessageLoop* message_loop) |
| - : Thread(message_loop->thread_name()), identifier_(identifier) { |
| + : Thread(message_loop->GetThreadName()), identifier_(identifier) { |
|
gab
2016/06/13 18:57:35
Is |message_loop| already running at this point?
alokp
2016/06/14 12:31:22
Good catch. This constructor seems to be used in u
|
| set_message_loop(message_loop); |
| Initialize(); |
| } |
| @@ -379,14 +379,10 @@ static const char* GetThreadName(WebThread::ID thread) { |
| // static |
| std::string WebThread::GetDCheckCurrentlyOnErrorMessage(ID expected) { |
| - const base::MessageLoop* message_loop = base::MessageLoop::current(); |
| - ID actual_web_thread; |
| - const char* actual_name = "Unknown Thread"; |
| - if (message_loop && !message_loop->thread_name().empty()) { |
| - actual_name = message_loop->thread_name().c_str(); |
| - } else if (GetCurrentThreadIdentifier(&actual_web_thread)) { |
| - actual_name = GetThreadName(actual_web_thread); |
| - } |
| + std::string actual_name = base::PlatformThread::GetName(); |
| + if (actual_name.empty()) |
| + actual_name = "Unknown Thread"; |
| + |
| std::string result = "Must be called on "; |
| result += GetThreadName(expected); |
| result += "; actually called on "; |