OLD | NEW |
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 "device/bluetooth/bluetooth_adapter_win.h" | 5 #include "device/bluetooth/bluetooth_adapter_win.h" |
6 | 6 |
7 #include <hash_set> | 7 #include <hash_set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 STLDeleteValues(&devices_); | 200 STLDeleteValues(&devices_); |
201 for (ScopedVector<BluetoothTaskManagerWin::DeviceState>::const_iterator iter = | 201 for (ScopedVector<BluetoothTaskManagerWin::DeviceState>::const_iterator iter = |
202 devices.begin(); | 202 devices.begin(); |
203 iter != devices.end(); | 203 iter != devices.end(); |
204 ++iter) { | 204 ++iter) { |
205 devices_[(*iter)->address] = new BluetoothDeviceWin( | 205 devices_[(*iter)->address] = new BluetoothDeviceWin( |
206 **iter, ui_task_runner_, socket_thread_, NULL, net::NetLog::Source()); | 206 **iter, ui_task_runner_, socket_thread_, NULL, net::NetLog::Source()); |
207 } | 207 } |
208 } | 208 } |
209 | 209 |
| 210 scoped_refptr<base::SequencedTaskRunner> |
| 211 BluetoothAdapterWin::ui_task_runner() { |
| 212 return ui_task_runner_; |
| 213 } |
| 214 |
| 215 scoped_refptr<BluetoothSocketThreadWin> BluetoothAdapterWin::socket_thread() { |
| 216 return socket_thread_; |
| 217 } |
| 218 |
210 // If the method is called when |discovery_status_| is DISCOVERY_STOPPING, | 219 // If the method is called when |discovery_status_| is DISCOVERY_STOPPING, |
211 // starting again is handled by BluetoothAdapterWin::DiscoveryStopped(). | 220 // starting again is handled by BluetoothAdapterWin::DiscoveryStopped(). |
212 void BluetoothAdapterWin::AddDiscoverySession( | 221 void BluetoothAdapterWin::AddDiscoverySession( |
213 const base::Closure& callback, | 222 const base::Closure& callback, |
214 const ErrorCallback& error_callback) { | 223 const ErrorCallback& error_callback) { |
215 if (discovery_status_ == DISCOVERING) { | 224 if (discovery_status_ == DISCOVERING) { |
216 num_discovery_listeners_++; | 225 num_discovery_listeners_++; |
217 callback.Run(); | 226 callback.Run(); |
218 return; | 227 return; |
219 } | 228 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 num_discovery_listeners_ -= on_stop_discovery_callbacks_.size(); | 283 num_discovery_listeners_ -= on_stop_discovery_callbacks_.size(); |
275 on_stop_discovery_callbacks_.clear(); | 284 on_stop_discovery_callbacks_.clear(); |
276 return; | 285 return; |
277 } | 286 } |
278 | 287 |
279 discovery_status_ = DISCOVERY_STOPPING; | 288 discovery_status_ = DISCOVERY_STOPPING; |
280 task_manager_->PostStopDiscoveryTask(); | 289 task_manager_->PostStopDiscoveryTask(); |
281 } | 290 } |
282 | 291 |
283 } // namespace device | 292 } // namespace device |
OLD | NEW |