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

Side by Side Diff: device/bluetooth/bluetooth_socket_thread.cc

Issue 1179163002: Migrate callers of message_loop_proxy() to task_runner() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 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 | « dbus/test_server.cc ('k') | jingle/notifier/base/xmpp_connection_unittest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "device/bluetooth/bluetooth_socket_thread.h" 5 #include "device/bluetooth/bluetooth_socket_thread.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/sequenced_task_runner.h" 8 #include "base/sequenced_task_runner.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 void BluetoothSocketThread::EnsureStarted() { 57 void BluetoothSocketThread::EnsureStarted() {
58 DCHECK(thread_checker_.CalledOnValidThread()); 58 DCHECK(thread_checker_.CalledOnValidThread());
59 if (thread_) 59 if (thread_)
60 return; 60 return;
61 61
62 base::Thread::Options thread_options; 62 base::Thread::Options thread_options;
63 thread_options.message_loop_type = base::MessageLoop::TYPE_IO; 63 thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
64 thread_.reset(new base::Thread("BluetoothSocketThread")); 64 thread_.reset(new base::Thread("BluetoothSocketThread"));
65 thread_->StartWithOptions(thread_options); 65 thread_->StartWithOptions(thread_options);
66 task_runner_ = thread_->message_loop_proxy(); 66 task_runner_ = thread_->task_runner();
67 } 67 }
68 68
69 scoped_refptr<base::SequencedTaskRunner> BluetoothSocketThread::task_runner() 69 scoped_refptr<base::SequencedTaskRunner> BluetoothSocketThread::task_runner()
70 const { 70 const {
71 DCHECK(active_socket_count_ > 0); 71 DCHECK(active_socket_count_ > 0);
72 DCHECK(thread_); 72 DCHECK(thread_);
73 DCHECK(task_runner_.get()); 73 DCHECK(task_runner_.get());
74 74
75 return task_runner_; 75 return task_runner_;
76 } 76 }
77 77
78 } // namespace device 78 } // namespace device
OLDNEW
« no previous file with comments | « dbus/test_server.cc ('k') | jingle/notifier/base/xmpp_connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698