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

Side by Side Diff: base/message_loop/message_loop_task_runner.cc

Issue 1942053002: Deletes base::MessageLoop::set_thread_name(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed media_unittests 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 unified diff | Download patch
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/message_loop/message_loop_task_runner.h" 5 #include "base/message_loop/message_loop_task_runner.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/incoming_task_queue.h" 9 #include "base/message_loop/incoming_task_queue.h"
10 #include "base/threading/thread_id_name_manager.h"
10 11
11 namespace base { 12 namespace base {
12 namespace internal { 13 namespace internal {
13 14
14 MessageLoopTaskRunner::MessageLoopTaskRunner( 15 MessageLoopTaskRunner::MessageLoopTaskRunner(
15 scoped_refptr<IncomingTaskQueue> incoming_queue) 16 scoped_refptr<IncomingTaskQueue> incoming_queue)
16 : incoming_queue_(incoming_queue), valid_thread_id_(kInvalidThreadId) { 17 : incoming_queue_(incoming_queue), valid_thread_id_(kInvalidThreadId) {
17 } 18 }
18 19
19 void MessageLoopTaskRunner::BindToCurrentThread() { 20 void MessageLoopTaskRunner::BindToCurrentThread() {
(...skipping 16 matching lines...) Expand all
36 base::TimeDelta delay) { 37 base::TimeDelta delay) {
37 DCHECK(!task.is_null()) << from_here.ToString(); 38 DCHECK(!task.is_null()) << from_here.ToString();
38 return incoming_queue_->AddToIncomingQueue(from_here, task, delay, false); 39 return incoming_queue_->AddToIncomingQueue(from_here, task, delay, false);
39 } 40 }
40 41
41 bool MessageLoopTaskRunner::RunsTasksOnCurrentThread() const { 42 bool MessageLoopTaskRunner::RunsTasksOnCurrentThread() const {
42 AutoLock lock(valid_thread_id_lock_); 43 AutoLock lock(valid_thread_id_lock_);
43 return valid_thread_id_ == PlatformThread::CurrentId(); 44 return valid_thread_id_ == PlatformThread::CurrentId();
44 } 45 }
45 46
47 std::string MessageLoopTaskRunner::GetThreadName() const {
48 AutoLock lock(valid_thread_id_lock_);
49 return ThreadIdNameManager::GetInstance()->GetName(valid_thread_id_);
50 }
51
46 MessageLoopTaskRunner::~MessageLoopTaskRunner() { 52 MessageLoopTaskRunner::~MessageLoopTaskRunner() {
47 } 53 }
48 54
49 } // namespace internal 55 } // namespace internal
50 56
51 } // namespace base 57 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698