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

Side by Side 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: 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "device/bluetooth/bluetooth_classic_win.h"
6
7 namespace {
8 static device::win::BluetoothClassicWrapper* g_instance_ = nullptr;
9 } // namespace
10
11 namespace device {
12 namespace win {
13
14 BluetoothClassicWrapper* BluetoothClassicWrapper::GetInstance() {
15 if (g_instance_ == nullptr) {
16 g_instance_ = new BluetoothClassicWrapper();
17 }
18 return g_instance_;
19 }
20
21 void BluetoothClassicWrapper::DeleteInstance() {
22 delete g_instance_;
23 g_instance_ = nullptr;
24 }
25
26 void BluetoothClassicWrapper::SetInstanceForTest(
27 BluetoothClassicWrapper* instance) {
28 delete g_instance_;
29 g_instance_ = instance;
30 }
31
32 BluetoothClassicWrapper::BluetoothClassicWrapper() {}
33 BluetoothClassicWrapper::~BluetoothClassicWrapper() {}
34
35 HBLUETOOTH_RADIO_FIND BluetoothClassicWrapper::FindFirstRadio(
36 const BLUETOOTH_FIND_RADIO_PARAMS* params,
37 HANDLE* out_handle) {
38 return BluetoothFindFirstRadio(params, out_handle);
39 }
40
41 DWORD BluetoothClassicWrapper::GetRadioInfo(
42 HANDLE handle,
43 PBLUETOOTH_RADIO_INFO out_radio_info) {
44 return BluetoothGetRadioInfo(handle, out_radio_info);
45 }
46
47 BOOL BluetoothClassicWrapper::FindRadioClose(HBLUETOOTH_RADIO_FIND handle) {
48 return BluetoothFindRadioClose(handle);
49 }
50
51 BOOL BluetoothClassicWrapper::IsConnectable(HANDLE handle) {
52 return BluetoothIsConnectable(handle);
53 }
54
55 HBLUETOOTH_DEVICE_FIND BluetoothClassicWrapper::FindFirstDevice(
56 const BLUETOOTH_DEVICE_SEARCH_PARAMS* params,
57 BLUETOOTH_DEVICE_INFO* out_device_info) {
58 return BluetoothFindFirstDevice(params, out_device_info);
59 }
60
61 BOOL BluetoothClassicWrapper::FindNextDevice(
62 HBLUETOOTH_DEVICE_FIND handle,
63 BLUETOOTH_DEVICE_INFO* out_device_info) {
64 return BluetoothFindNextDevice(handle, out_device_info);
65 }
66
67 BOOL BluetoothClassicWrapper::FindDeviceClose(HBLUETOOTH_DEVICE_FIND handle) {
68 return BluetoothFindDeviceClose(handle);
69 }
70
71 BOOL BluetoothClassicWrapper::EnableDiscovery(HANDLE handle, BOOL is_enable) {
72 return BluetoothEnableDiscovery(handle, is_enable);
73 }
74
75 BOOL BluetoothClassicWrapper::EnableIncomingConnections(HANDLE handle,
76 BOOL is_enable) {
77 return BluetoothEnableIncomingConnections(handle, is_enable);
78 }
79
80 } // namespace win
81 } // namespace device
OLDNEW
« 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