OLD | NEW |
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 <utility> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/location.h" | 10 #include "base/location.h" |
9 #include "base/logging.h" | 11 #include "base/logging.h" |
10 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
11 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
12 #include "components/proximity_auth/bluetooth_connection.h" | 14 #include "components/proximity_auth/bluetooth_connection.h" |
13 #include "components/proximity_auth/logging/logging.h" | 15 #include "components/proximity_auth/logging/logging.h" |
14 #include "device/bluetooth/bluetooth_adapter_factory.h" | 16 #include "device/bluetooth/bluetooth_adapter_factory.h" |
15 | 17 |
16 using device::BluetoothAdapter; | 18 using device::BluetoothAdapter; |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 FROM_HERE, base::Bind(&BluetoothConnectionFinder::InvokeCallbackAsync, | 193 FROM_HERE, base::Bind(&BluetoothConnectionFinder::InvokeCallbackAsync, |
192 weak_ptr_factory_.GetWeakPtr())); | 194 weak_ptr_factory_.GetWeakPtr())); |
193 } else if (old_status == Connection::IN_PROGRESS) { | 195 } else if (old_status == Connection::IN_PROGRESS) { |
194 PA_LOG(WARNING) | 196 PA_LOG(WARNING) |
195 << "Connection failed! Scheduling another polling iteration."; | 197 << "Connection failed! Scheduling another polling iteration."; |
196 PostDelayedPoll(); | 198 PostDelayedPoll(); |
197 } | 199 } |
198 } | 200 } |
199 | 201 |
200 void BluetoothConnectionFinder::InvokeCallbackAsync() { | 202 void BluetoothConnectionFinder::InvokeCallbackAsync() { |
201 connection_callback_.Run(connection_.Pass()); | 203 connection_callback_.Run(std::move(connection_)); |
202 } | 204 } |
203 | 205 |
204 } // namespace proximity_auth | 206 } // namespace proximity_auth |
OLD | NEW |