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

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: DeviceWin return SDRWin to avoid cast 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
« no previous file with comments | « device/bluetooth/bluetooth_device_win.h ('k') | device/bluetooth/bluetooth_profile.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3924c24a47e342765ba37c3d0dec426f333e35b0 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"
@@ -52,7 +51,7 @@ BluetoothDeviceWin::BluetoothDeviceWin(
std::copy((*iter)->sdp_bytes.begin(),
(*iter)->sdp_bytes.end(),
sdp_bytes_buffer);
- BluetoothServiceRecord* service_record = new BluetoothServiceRecordWin(
+ BluetoothServiceRecordWin* service_record = new BluetoothServiceRecordWin(
(*iter)->name,
(*iter)->address,
(*iter)->sdp_bytes.size(),
@@ -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(
@@ -226,7 +221,7 @@ void BluetoothDeviceWin::StartConnectionMonitor(
NOTIMPLEMENTED();
}
-const BluetoothServiceRecord* BluetoothDeviceWin::GetServiceRecord(
+const BluetoothServiceRecordWin* BluetoothDeviceWin::GetServiceRecord(
const device::BluetoothUUID& uuid) const {
for (ServiceRecordList::const_iterator iter = service_record_list_.begin();
iter != service_record_list_.end();
« no previous file with comments | « device/bluetooth/bluetooth_device_win.h ('k') | device/bluetooth/bluetooth_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698