| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_chromeos.h" | 5 #include "device/bluetooth/bluetooth_adapter_chromeos.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 233 |
| 234 void BluetoothAdapterChromeOS::CreateRfcommService( | 234 void BluetoothAdapterChromeOS::CreateRfcommService( |
| 235 const BluetoothUUID& uuid, | 235 const BluetoothUUID& uuid, |
| 236 const ServiceOptions& options, | 236 const ServiceOptions& options, |
| 237 const CreateServiceCallback& callback, | 237 const CreateServiceCallback& callback, |
| 238 const CreateServiceErrorCallback& error_callback) { | 238 const CreateServiceErrorCallback& error_callback) { |
| 239 VLOG(1) << object_path_.value() << ": Creating RFCOMM service: " | 239 VLOG(1) << object_path_.value() << ": Creating RFCOMM service: " |
| 240 << uuid.canonical_value(); | 240 << uuid.canonical_value(); |
| 241 scoped_refptr<BluetoothSocketChromeOS> socket = | 241 scoped_refptr<BluetoothSocketChromeOS> socket = |
| 242 BluetoothSocketChromeOS::CreateBluetoothSocket( | 242 BluetoothSocketChromeOS::CreateBluetoothSocket( |
| 243 ui_task_runner_, | 243 ui_task_runner_, socket_thread_); |
| 244 socket_thread_, | |
| 245 NULL, | |
| 246 net::NetLog::Source()); | |
| 247 socket->Listen(this, | 244 socket->Listen(this, |
| 248 BluetoothSocketChromeOS::kRfcomm, | 245 BluetoothSocketChromeOS::kRfcomm, |
| 249 uuid, | 246 uuid, |
| 250 options, | 247 options, |
| 251 base::Bind(callback, socket), | 248 base::Bind(callback, socket), |
| 252 error_callback); | 249 error_callback); |
| 253 } | 250 } |
| 254 | 251 |
| 255 void BluetoothAdapterChromeOS::CreateL2capService( | 252 void BluetoothAdapterChromeOS::CreateL2capService( |
| 256 const BluetoothUUID& uuid, | 253 const BluetoothUUID& uuid, |
| 257 const ServiceOptions& options, | 254 const ServiceOptions& options, |
| 258 const CreateServiceCallback& callback, | 255 const CreateServiceCallback& callback, |
| 259 const CreateServiceErrorCallback& error_callback) { | 256 const CreateServiceErrorCallback& error_callback) { |
| 260 VLOG(1) << object_path_.value() << ": Creating L2CAP service: " | 257 VLOG(1) << object_path_.value() << ": Creating L2CAP service: " |
| 261 << uuid.canonical_value(); | 258 << uuid.canonical_value(); |
| 262 scoped_refptr<BluetoothSocketChromeOS> socket = | 259 scoped_refptr<BluetoothSocketChromeOS> socket = |
| 263 BluetoothSocketChromeOS::CreateBluetoothSocket( | 260 BluetoothSocketChromeOS::CreateBluetoothSocket( |
| 264 ui_task_runner_, | 261 ui_task_runner_, socket_thread_); |
| 265 socket_thread_, | |
| 266 NULL, | |
| 267 net::NetLog::Source()); | |
| 268 socket->Listen(this, | 262 socket->Listen(this, |
| 269 BluetoothSocketChromeOS::kL2cap, | 263 BluetoothSocketChromeOS::kL2cap, |
| 270 uuid, | 264 uuid, |
| 271 options, | 265 options, |
| 272 base::Bind(callback, socket), | 266 base::Bind(callback, socket), |
| 273 error_callback); | 267 error_callback); |
| 274 } | 268 } |
| 275 | 269 |
| 276 void BluetoothAdapterChromeOS::RemovePairingDelegateInternal( | 270 void BluetoothAdapterChromeOS::RemovePairingDelegateInternal( |
| 277 BluetoothDevice::PairingDelegate* pairing_delegate) { | 271 BluetoothDevice::PairingDelegate* pairing_delegate) { |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 | 943 |
| 950 // If the queued request resulted in a pending call, then let it | 944 // If the queued request resulted in a pending call, then let it |
| 951 // asynchonously process the remaining queued requests once the pending | 945 // asynchonously process the remaining queued requests once the pending |
| 952 // call returns. | 946 // call returns. |
| 953 if (discovery_request_pending_) | 947 if (discovery_request_pending_) |
| 954 return; | 948 return; |
| 955 } | 949 } |
| 956 } | 950 } |
| 957 | 951 |
| 958 } // namespace chromeos | 952 } // namespace chromeos |
| OLD | NEW |