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

Side by Side Diff: components/proximity_auth/bluetooth_connection_finder.cc

Issue 1144153004: components: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (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
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 "components/proximity_auth/bluetooth_connection_finder.h" 5 #include "components/proximity_auth/bluetooth_connection_finder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/single_thread_task_runner.h"
11 #include "base/thread_task_runner_handle.h"
11 #include "components/proximity_auth/bluetooth_connection.h" 12 #include "components/proximity_auth/bluetooth_connection.h"
12 #include "device/bluetooth/bluetooth_adapter_factory.h" 13 #include "device/bluetooth/bluetooth_adapter_factory.h"
13 14
14 using device::BluetoothAdapter; 15 using device::BluetoothAdapter;
15 16
16 namespace proximity_auth { 17 namespace proximity_auth {
17 18
18 BluetoothConnectionFinder::BluetoothConnectionFinder( 19 BluetoothConnectionFinder::BluetoothConnectionFinder(
19 const RemoteDevice& remote_device, 20 const RemoteDevice& remote_device,
20 const device::BluetoothUUID& uuid, 21 const device::BluetoothUUID& uuid,
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 if (connection_->IsConnected()) { 128 if (connection_->IsConnected()) {
128 base::TimeDelta elapsed = base::TimeTicks::Now() - start_time_; 129 base::TimeDelta elapsed = base::TimeTicks::Now() - start_time_;
129 VLOG(1) << "[BCF] Connection found! Elapsed Time: " 130 VLOG(1) << "[BCF] Connection found! Elapsed Time: "
130 << elapsed.InMilliseconds() << "ms."; 131 << elapsed.InMilliseconds() << "ms.";
131 UnregisterAsObserver(); 132 UnregisterAsObserver();
132 connection_callback_.Run(connection_.Pass()); 133 connection_callback_.Run(connection_.Pass());
133 } else if (old_status == Connection::IN_PROGRESS) { 134 } else if (old_status == Connection::IN_PROGRESS) {
134 VLOG(1) << "[BCF] Connection failed! Scheduling another polling iteration."; 135 VLOG(1) << "[BCF] Connection failed! Scheduling another polling iteration.";
135 connection_.reset(); 136 connection_.reset();
136 has_delayed_poll_scheduled_ = true; 137 has_delayed_poll_scheduled_ = true;
137 base::MessageLoopProxy::current()->PostDelayedTask( 138 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
138 FROM_HERE, 139 FROM_HERE, base::Bind(&BluetoothConnectionFinder::DelayedPollIfReady,
139 base::Bind(&BluetoothConnectionFinder::DelayedPollIfReady, 140 weak_ptr_factory_.GetWeakPtr()),
140 weak_ptr_factory_.GetWeakPtr()),
141 polling_interval_); 141 polling_interval_);
142 } 142 }
143 } 143 }
144 144
145 } // namespace proximity_auth 145 } // namespace proximity_auth
OLDNEW
« no previous file with comments | « components/proximity_auth/bluetooth_connection.cc ('k') | components/rappor/log_uploader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698