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

Unified Diff: device/bluetooth/bluetooth_device_win.cc

Issue 320463002: Bluetooth: Implement socket API for Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: handle NULL service_record Created 6 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_device_win.cc
diff --git a/device/bluetooth/bluetooth_device_win.cc b/device/bluetooth/bluetooth_device_win.cc
index 40a8fa87415691f1f908482a60afd7e2e6e91b7e..8be28efccf79680f639cadec3e09d5836a272d80 100644
--- a/device/bluetooth/bluetooth_device_win.cc
+++ b/device/bluetooth/bluetooth_device_win.cc
@@ -11,7 +11,6 @@
#include "base/memory/scoped_vector.h"
#include "base/sequenced_task_runner.h"
#include "base/strings/stringprintf.h"
-#include "device/bluetooth/bluetooth_profile_win.h"
#include "device/bluetooth/bluetooth_service_record_win.h"
#include "device/bluetooth/bluetooth_socket_thread.h"
#include "device/bluetooth/bluetooth_socket_win.h"
@@ -203,21 +202,17 @@ void BluetoothDeviceWin::ConnectToProfile(
const base::Closure& callback,
const ConnectToProfileErrorCallback& error_callback) {
DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
- static_cast<BluetoothProfileWin*>(profile)->Connect(this,
- ui_task_runner_,
- socket_thread_,
- net_log_,
- net_log_source_,
- callback,
- error_callback);
+ error_callback.Run("Removed. Use chrome.bluetoothSocket.connect() instead.");
}
void BluetoothDeviceWin::ConnectToService(
const BluetoothUUID& uuid,
const ConnectToServiceCallback& callback,
const ConnectToServiceErrorCallback& error_callback) {
- // TODO(keybuk): implement
- NOTIMPLEMENTED();
+ scoped_refptr<BluetoothSocketWin> socket(
+ BluetoothSocketWin::CreateBluetoothSocket(
+ ui_task_runner_, socket_thread_, NULL, net::NetLog::Source()));
+ socket->Connect(this, uuid, base::Bind(callback, socket), error_callback);
}
void BluetoothDeviceWin::StartConnectionMonitor(

Powered by Google App Engine
This is Rietveld 408576698