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

Unified Diff: device/bluetooth/bluetooth_task_manager_win.cc

Issue 1646023002: Refactor bluetooth_low_energy_win to prepare for new Bluetooth test fixture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: export class BluetoothLowEnergyWrapper for test Created 4 years, 11 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_low_energy_win_fake.cc ('k') | device/device_tests.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_task_manager_win.cc
diff --git a/device/bluetooth/bluetooth_task_manager_win.cc b/device/bluetooth/bluetooth_task_manager_win.cc
index b34718f3946ecfda315b1e3e521e5eb3449b1b98..302f8a555cda13d4239fc417ff09773401ea873d 100644
--- a/device/bluetooth/bluetooth_task_manager_win.cc
+++ b/device/bluetooth/bluetooth_task_manager_win.cc
@@ -142,6 +142,7 @@ BluetoothTaskManagerWin::BluetoothTaskManagerWin(
}
BluetoothTaskManagerWin::~BluetoothTaskManagerWin() {
+ win::BluetoothLowEnergyWrapper::DeleteInstance();
}
void BluetoothTaskManagerWin::AddObserver(Observer* observer) {
@@ -480,7 +481,8 @@ bool BluetoothTaskManagerWin::SearchLowEnergyDevices(
ScopedVector<win::BluetoothLowEnergyDeviceInfo> btle_devices;
std::string error;
bool success =
- win::EnumerateKnownBluetoothLowEnergyDevices(&btle_devices, &error);
+ win::BluetoothLowEnergyWrapper::GetInstance()
+ ->EnumerateKnownBluetoothLowEnergyDevices(&btle_devices, &error);
if (!success) {
LogPollingError(error.c_str(), 0);
return false;
@@ -637,8 +639,9 @@ bool BluetoothTaskManagerWin::DiscoverLowEnergyDeviceServices(
std::string error;
ScopedVector<win::BluetoothLowEnergyServiceInfo> services;
- bool success = win::EnumerateKnownBluetoothLowEnergyServices(
- device_path, &services, &error);
+ bool success = win::BluetoothLowEnergyWrapper::GetInstance()
+ ->EnumerateKnownBluetoothLowEnergyServices(
+ device_path, &services, &error);
if (!success) {
LogPollingError(error.c_str(), 0);
return false;
@@ -669,8 +672,9 @@ bool BluetoothTaskManagerWin::SearchForGattServiceDevicePaths(
// List all known GATT service devices on the machine.
ScopedVector<win::BluetoothLowEnergyDeviceInfo> gatt_service_devices;
- bool success = win::EnumerateKnownBluetoothLowEnergyGattServiceDevices(
- &gatt_service_devices, &error);
+ bool success = win::BluetoothLowEnergyWrapper::GetInstance()
+ ->EnumerateKnownBluetoothLowEnergyGattServiceDevices(
+ &gatt_service_devices, &error);
if (!success) {
LogPollingError(error.c_str(), 0);
return false;
@@ -685,8 +689,9 @@ bool BluetoothTaskManagerWin::SearchForGattServiceDevicePaths(
// Discover this service device's contained services.
ScopedVector<win::BluetoothLowEnergyServiceInfo> gatt_services;
- if (!win::EnumerateKnownBluetoothLowEnergyServices(
- gatt_service_device->path, &gatt_services, &error)) {
+ if (!win::BluetoothLowEnergyWrapper::GetInstance()
+ ->EnumerateKnownBluetoothLowEnergyServices(
+ gatt_service_device->path, &gatt_services, &error)) {
LogPollingError(error.c_str(), 0);
continue;
}
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_win_fake.cc ('k') | device/device_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698