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

Unified Diff: device/bluetooth/bluetooth_low_energy_win.cc

Issue 1668233004: Refactor bluetooth_task_manager_win to prepare for new Bluetooth test fixture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 10 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_classic_win_fake.cc ('k') | device/bluetooth/bluetooth_task_manager_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_low_energy_win.cc
diff --git a/device/bluetooth/bluetooth_low_energy_win.cc b/device/bluetooth/bluetooth_low_energy_win.cc
index e0a843248f0aa4b1f2e23cf05ba367057232996b..29932b9301e258b97ff4241e14b1148fcff7fbc9 100644
--- a/device/bluetooth/bluetooth_low_energy_win.cc
+++ b/device/bluetooth/bluetooth_low_energy_win.cc
@@ -13,6 +13,8 @@
namespace {
+static device::win::BluetoothLowEnergyWrapper* g_instance_ = nullptr;
+
using device::win::DeviceRegistryPropertyValue;
using device::win::DevicePropertyValue;
using device::win::BluetoothLowEnergyDeviceInfo;
@@ -659,23 +661,22 @@ bool ExtractBluetoothAddressFromDeviceInstanceIdForTesting(
return ExtractBluetoothAddressFromDeviceInstanceId(instance_id, btha, error);
}
-static BluetoothLowEnergyWrapper* instance_ = nullptr;
BluetoothLowEnergyWrapper* BluetoothLowEnergyWrapper::GetInstance() {
- if (instance_ == nullptr) {
- instance_ = new BluetoothLowEnergyWrapper();
+ if (g_instance_ == nullptr) {
+ g_instance_ = new BluetoothLowEnergyWrapper();
}
- return instance_;
+ return g_instance_;
}
void BluetoothLowEnergyWrapper::DeleteInstance() {
- delete instance_;
- instance_ = nullptr;
+ delete g_instance_;
+ g_instance_ = nullptr;
}
void BluetoothLowEnergyWrapper::SetInstanceForTest(
BluetoothLowEnergyWrapper* instance) {
- delete instance_;
- instance_ = instance;
+ delete g_instance_;
+ g_instance_ = instance;
}
BluetoothLowEnergyWrapper::BluetoothLowEnergyWrapper() {}
« no previous file with comments | « device/bluetooth/bluetooth_classic_win_fake.cc ('k') | device/bluetooth/bluetooth_task_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698