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

Unified Diff: device/bluetooth/bluetooth_classic_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: rename 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.h ('k') | device/bluetooth/bluetooth_classic_win_fake.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_classic_win.cc
diff --git a/device/bluetooth/bluetooth_classic_win.cc b/device/bluetooth/bluetooth_classic_win.cc
new file mode 100644
index 0000000000000000000000000000000000000000..875f687953add8349cf950e94beb9c5fc71adadb
--- /dev/null
+++ b/device/bluetooth/bluetooth_classic_win.cc
@@ -0,0 +1,78 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "device/bluetooth/bluetooth_classic_win.h"
+
+namespace device {
+namespace win {
+
+static BluetoothClassicWrapper* instance_ = nullptr;
scheib 2016/02/04 23:36:39 use g_ prefix on the global. Place the global in
gogerald1 2016/02/04 23:48:59 Done.
+BluetoothClassicWrapper* BluetoothClassicWrapper::GetInstance() {
+ if (instance_ == nullptr) {
+ instance_ = new BluetoothClassicWrapper();
+ }
+ return instance_;
+}
+
+void BluetoothClassicWrapper::DeleteInstance() {
+ delete instance_;
+ instance_ = nullptr;
+}
+
+void BluetoothClassicWrapper::SetInstanceForTest(
+ BluetoothClassicWrapper* instance) {
+ delete instance_;
+ instance_ = instance;
+}
+
+BluetoothClassicWrapper::BluetoothClassicWrapper() {}
+BluetoothClassicWrapper::~BluetoothClassicWrapper() {}
+
+HBLUETOOTH_RADIO_FIND BluetoothClassicWrapper::FindFirstRadio(
+ const BLUETOOTH_FIND_RADIO_PARAMS* params,
+ HANDLE* out_handle) {
+ return BluetoothFindFirstRadio(params, out_handle);
+}
+
+DWORD BluetoothClassicWrapper::GetRadioInfo(
+ HANDLE handle,
+ PBLUETOOTH_RADIO_INFO out_radio_info) {
+ return BluetoothGetRadioInfo(handle, out_radio_info);
+}
+
+BOOL BluetoothClassicWrapper::FindRadioClose(HBLUETOOTH_RADIO_FIND handle) {
+ return BluetoothFindRadioClose(handle);
+}
+
+BOOL BluetoothClassicWrapper::IsConnectable(HANDLE handle) {
+ return BluetoothIsConnectable(handle);
+}
+
+HBLUETOOTH_DEVICE_FIND BluetoothClassicWrapper::FindFirstDevice(
+ const BLUETOOTH_DEVICE_SEARCH_PARAMS* params,
+ BLUETOOTH_DEVICE_INFO* out_device_info) {
+ return BluetoothFindFirstDevice(params, out_device_info);
+}
+
+BOOL BluetoothClassicWrapper::FindNextDevice(
+ HBLUETOOTH_DEVICE_FIND handle,
+ BLUETOOTH_DEVICE_INFO* out_device_info) {
+ return BluetoothFindNextDevice(handle, out_device_info);
+}
+
+BOOL BluetoothClassicWrapper::FindDeviceClose(HBLUETOOTH_DEVICE_FIND handle) {
+ return BluetoothFindDeviceClose(handle);
+}
+
+BOOL BluetoothClassicWrapper::EnableDiscovery(HANDLE handle, BOOL is_enable) {
+ return BluetoothEnableDiscovery(handle, is_enable);
+}
+
+BOOL BluetoothClassicWrapper::EnableIncomingConnections(HANDLE handle,
+ BOOL is_enable) {
+ return BluetoothEnableIncomingConnections(handle, is_enable);
+}
+
+} // namespace win
+} // namespace device
« no previous file with comments | « device/bluetooth/bluetooth_classic_win.h ('k') | device/bluetooth/bluetooth_classic_win_fake.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698