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

Side by Side Diff: base/threading/thread.cc

Issue 1942053002: Deletes base::MessageLoop::set_thread_name(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: uses PlatformThread::GetName Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « base/message_loop/message_loop_unittest.cc ('k') | base/trace_event/trace_log.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/threading/thread.h" 5 #include "base/threading/thread.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 id_event_.Signal(); 224 id_event_.Signal();
225 225
226 // Complete the initialization of our Thread object. 226 // Complete the initialization of our Thread object.
227 PlatformThread::SetName(name_.c_str()); 227 PlatformThread::SetName(name_.c_str());
228 ANNOTATE_THREAD_NAME(name_.c_str()); // Tell the name to race detector. 228 ANNOTATE_THREAD_NAME(name_.c_str()); // Tell the name to race detector.
229 229
230 // Lazily initialize the message_loop so that it can run on this thread. 230 // Lazily initialize the message_loop so that it can run on this thread.
231 DCHECK(message_loop_); 231 DCHECK(message_loop_);
232 std::unique_ptr<MessageLoop> message_loop(message_loop_); 232 std::unique_ptr<MessageLoop> message_loop(message_loop_);
233 message_loop_->BindToCurrentThread(); 233 message_loop_->BindToCurrentThread();
234 message_loop_->set_thread_name(name_);
235 message_loop_->SetTimerSlack(message_loop_timer_slack_); 234 message_loop_->SetTimerSlack(message_loop_timer_slack_);
236 235
237 #if defined(OS_WIN) 236 #if defined(OS_WIN)
238 std::unique_ptr<win::ScopedCOMInitializer> com_initializer; 237 std::unique_ptr<win::ScopedCOMInitializer> com_initializer;
239 if (com_status_ != NONE) { 238 if (com_status_ != NONE) {
240 com_initializer.reset((com_status_ == STA) ? 239 com_initializer.reset((com_status_ == STA) ?
241 new win::ScopedCOMInitializer() : 240 new win::ScopedCOMInitializer() :
242 new win::ScopedCOMInitializer(win::ScopedCOMInitializer::kMTA)); 241 new win::ScopedCOMInitializer(win::ScopedCOMInitializer::kMTA));
243 } 242 }
244 #endif 243 #endif
(...skipping 28 matching lines...) Expand all
273 // allow this. 272 // allow this.
274 DCHECK(GetThreadWasQuitProperly()); 273 DCHECK(GetThreadWasQuitProperly());
275 } 274 }
276 275
277 // We can't receive messages anymore. 276 // We can't receive messages anymore.
278 // (The message loop is destructed at the end of this block) 277 // (The message loop is destructed at the end of this block)
279 message_loop_ = nullptr; 278 message_loop_ = nullptr;
280 } 279 }
281 280
282 } // namespace base 281 } // namespace base
OLDNEW
« no previous file with comments | « base/message_loop/message_loop_unittest.cc ('k') | base/trace_event/trace_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698