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

Side by Side Diff: device/bluetooth/bluetooth_low_energy_win.h

Issue 2567903004: Replace ScopedVector/ScopedPtrHashMap with std::vector and std::unordered_map (Closed)
Patch Set: Created 4 years 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 // Returns true only on Windows platforms supporting Bluetooth Low Energy. 128 // Returns true only on Windows platforms supporting Bluetooth Low Energy.
129 virtual bool IsBluetoothLowEnergySupported(); 129 virtual bool IsBluetoothLowEnergySupported();
130 130
131 // Enumerates the list of known (i.e. already paired) Bluetooth LE devices on 131 // Enumerates the list of known (i.e. already paired) Bluetooth LE devices on
132 // this machine. In case of error, returns false and sets |error| with an 132 // this machine. In case of error, returns false and sets |error| with an
133 // error message describing the problem. 133 // error message describing the problem.
134 // Note: This function returns an error if Bluetooth Low Energy is not 134 // Note: This function returns an error if Bluetooth Low Energy is not
135 // supported on this Windows platform. 135 // supported on this Windows platform.
136 virtual bool EnumerateKnownBluetoothLowEnergyDevices( 136 virtual bool EnumerateKnownBluetoothLowEnergyDevices(
137 ScopedVector<BluetoothLowEnergyDeviceInfo>* devices, 137 std::vector<std::unique_ptr<BluetoothLowEnergyDeviceInfo>> devices,
scheib 2016/12/13 00:51:06 Looks like the parameter 'devices' is passed in to
138 std::string* error); 138 std::string* error);
139 139
140 // Enumerates the list of known Bluetooth LE GATT service devices on this 140 // Enumerates the list of known Bluetooth LE GATT service devices on this
141 // machine (a Bluetooth LE device usually has more than one GATT 141 // machine (a Bluetooth LE device usually has more than one GATT
142 // services that each of them has a device interface on the machine). In case 142 // services that each of them has a device interface on the machine). In case
143 // of error, returns false and sets |error| with an error message describing 143 // of error, returns false and sets |error| with an error message describing
144 // the problem. 144 // the problem.
145 // Note: This function returns an error if Bluetooth Low Energy is not 145 // Note: This function returns an error if Bluetooth Low Energy is not
146 // supported on this Windows platform. 146 // supported on this Windows platform.
147 virtual bool EnumerateKnownBluetoothLowEnergyGattServiceDevices( 147 virtual bool EnumerateKnownBluetoothLowEnergyGattServiceDevices(
148 ScopedVector<BluetoothLowEnergyDeviceInfo>* devices, 148 std::vector<std::unique_ptr<BluetoothLowEnergyDeviceInfo>> devices,
149 std::string* error); 149 std::string* error);
150 150
151 // Enumerates the list of known (i.e. cached) GATT services for a given 151 // Enumerates the list of known (i.e. cached) GATT services for a given
152 // Bluetooth LE device |device_path| into |services|. In case of error, 152 // Bluetooth LE device |device_path| into |services|. In case of error,
153 // returns false and sets |error| with an error message describing the 153 // returns false and sets |error| with an error message describing the
154 // problem. 154 // problem.
155 // Note: This function returns an error if Bluetooth Low Energy is not 155 // Note: This function returns an error if Bluetooth Low Energy is not
156 // supported on this Windows platform. 156 // supported on this Windows platform.
157 virtual bool EnumerateKnownBluetoothLowEnergyServices( 157 virtual bool EnumerateKnownBluetoothLowEnergyServices(
158 const base::FilePath& device_path, 158 const base::FilePath& device_path,
159 ScopedVector<BluetoothLowEnergyServiceInfo>* services, 159 std::vector<std::unique_ptr<BluetoothLowEnergyServiceInfo>>& services,
160 std::string* error); 160 std::string* error);
161 161
162 // Reads characteristics of |service| with service device path |service_path|. 162 // Reads characteristics of |service| with service device path |service_path|.
163 // The result will be stored in |*out_included_characteristics| and 163 // The result will be stored in |*out_included_characteristics| and
164 // |*out_counts|. 164 // |*out_counts|.
165 virtual HRESULT ReadCharacteristicsOfAService( 165 virtual HRESULT ReadCharacteristicsOfAService(
166 base::FilePath& service_path, 166 base::FilePath& service_path,
167 const PBTH_LE_GATT_SERVICE service, 167 const PBTH_LE_GATT_SERVICE service,
168 std::unique_ptr<BTH_LE_GATT_CHARACTERISTIC>* out_included_characteristics, 168 std::unique_ptr<BTH_LE_GATT_CHARACTERISTIC>* out_included_characteristics,
169 USHORT* out_counts); 169 USHORT* out_counts);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 protected: 214 protected:
215 BluetoothLowEnergyWrapper(); 215 BluetoothLowEnergyWrapper();
216 virtual ~BluetoothLowEnergyWrapper(); 216 virtual ~BluetoothLowEnergyWrapper();
217 }; 217 };
218 218
219 } // namespace win 219 } // namespace win
220 } // namespace device 220 } // namespace device
221 221
222 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_H_ 222 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698