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

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

Issue 276573004: Bluetooth: Implement new socket API for Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix DCHECK nits Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 const ErrorCallback& error_callback) { 236 const ErrorCallback& error_callback) {
237 error_callback.Run(); 237 error_callback.Run();
238 } 238 }
239 239
240 void BluetoothAdapterChromeOS::CreateRfcommService( 240 void BluetoothAdapterChromeOS::CreateRfcommService(
241 const BluetoothUUID& uuid, 241 const BluetoothUUID& uuid,
242 int channel, 242 int channel,
243 bool insecure, 243 bool insecure,
244 const CreateServiceCallback& callback, 244 const CreateServiceCallback& callback,
245 const CreateServiceErrorCallback& error_callback) { 245 const CreateServiceErrorCallback& error_callback) {
246 // TODO(keybuk): implement. 246 VLOG(1) << object_path_.value() << ": Creating RFCOMM service: "
247 NOTIMPLEMENTED(); 247 << uuid.canonical_value();
248 scoped_refptr<BluetoothSocketChromeOS> socket =
249 BluetoothSocketChromeOS::CreateBluetoothSocket(
250 ui_task_runner_,
251 socket_thread_,
252 NULL,
253 net::NetLog::Source());
254 socket->Listen(this,
255 BluetoothSocketChromeOS::kRfcomm,
256 uuid,
257 channel,
258 insecure,
259 base::Bind(callback, socket),
260 error_callback);
248 } 261 }
249 262
250 void BluetoothAdapterChromeOS::CreateL2capService( 263 void BluetoothAdapterChromeOS::CreateL2capService(
251 const BluetoothUUID& uuid, 264 const BluetoothUUID& uuid,
252 int psm, 265 int psm,
253 const CreateServiceCallback& callback, 266 const CreateServiceCallback& callback,
254 const CreateServiceErrorCallback& error_callback) { 267 const CreateServiceErrorCallback& error_callback) {
255 // TODO(keybuk): implement. 268 VLOG(1) << object_path_.value() << ": Creating L2CAP service: "
256 NOTIMPLEMENTED(); 269 << uuid.canonical_value();
270 scoped_refptr<BluetoothSocketChromeOS> socket =
271 BluetoothSocketChromeOS::CreateBluetoothSocket(
272 ui_task_runner_,
273 socket_thread_,
274 NULL,
275 net::NetLog::Source());
276 socket->Listen(this,
277 BluetoothSocketChromeOS::kL2cap,
278 uuid,
279 psm,
280 false,
281 base::Bind(callback, socket),
282 error_callback);
257 } 283 }
258 284
259 void BluetoothAdapterChromeOS::RemovePairingDelegateInternal( 285 void BluetoothAdapterChromeOS::RemovePairingDelegateInternal(
260 BluetoothDevice::PairingDelegate* pairing_delegate) { 286 BluetoothDevice::PairingDelegate* pairing_delegate) {
261 // Before removing a pairing delegate make sure that there aren't any devices 287 // Before removing a pairing delegate make sure that there aren't any devices
262 // currently using it; if there are, clear the pairing context which will 288 // currently using it; if there are, clear the pairing context which will
263 // make any responses no-ops. 289 // make any responses no-ops.
264 for (DevicesMap::iterator iter = devices_.begin(); 290 for (DevicesMap::iterator iter = devices_.begin();
265 iter != devices_.end(); ++iter) { 291 iter != devices_.end(); ++iter) {
266 BluetoothDeviceChromeOS* device_chromeos = 292 BluetoothDeviceChromeOS* device_chromeos =
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 933
908 // If the queued request resulted in a pending call, then let it 934 // If the queued request resulted in a pending call, then let it
909 // asynchonously process the remaining queued requests once the pending 935 // asynchonously process the remaining queued requests once the pending
910 // call returns. 936 // call returns.
911 if (discovery_request_pending_) 937 if (discovery_request_pending_)
912 return; 938 return;
913 } 939 }
914 } 940 }
915 941
916 } // namespace chromeos 942 } // namespace chromeos
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter_chromeos.h ('k') | device/bluetooth/bluetooth_device_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698