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

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

Issue 2567903004: Replace ScopedVector/ScopedPtrHashMap with std::vector and std::unordered_map (Closed)
Patch Set: Mac bustage 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_DEVICE_WIN_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 void Update(const BluetoothTaskManagerWin::DeviceState& device_state); 97 void Update(const BluetoothTaskManagerWin::DeviceState& device_state);
98 98
99 protected: 99 protected:
100 // BluetoothDevice override 100 // BluetoothDevice override
101 void CreateGattConnectionImpl() override; 101 void CreateGattConnectionImpl() override;
102 void DisconnectGatt() override; 102 void DisconnectGatt() override;
103 103
104 private: 104 private:
105 friend class BluetoothAdapterWin; 105 friend class BluetoothAdapterWin;
106 106
107 typedef ScopedVector<BluetoothServiceRecordWin> ServiceRecordList; 107 using ServiceRecordList =
108 std::vector<std::unique_ptr<BluetoothServiceRecordWin>>;
108 109
109 // Used by BluetoothAdapterWin to update the visible state during 110 // Used by BluetoothAdapterWin to update the visible state during
110 // discovery. 111 // discovery.
111 void SetVisible(bool visible); 112 void SetVisible(bool visible);
112 113
113 // Updates the services with services stored in |device_state|. 114 // Updates the services with services stored in |device_state|.
114 void UpdateServices(const BluetoothTaskManagerWin::DeviceState& device_state); 115 void UpdateServices(const BluetoothTaskManagerWin::DeviceState& device_state);
115 116
116 // Checks if GATT service with |uuid| and |attribute_handle| has already been 117 // Checks if GATT service with |uuid| and |attribute_handle| has already been
117 // discovered. 118 // discovered.
118 bool IsGattServiceDiscovered(BluetoothUUID& uuid, uint16_t attribute_handle); 119 bool IsGattServiceDiscovered(BluetoothUUID& uuid, uint16_t attribute_handle);
119 120
120 // Checks if |service| still exist on device according to newly discovered 121 // Checks if |service| still exist on device according to newly discovered
121 // |service_state|. 122 // |service_state|.
122 bool DoesGattServiceExist( 123 bool DoesGattServiceExist(
123 const ScopedVector<BluetoothTaskManagerWin::ServiceRecordState>& 124 const std::vector<std::unique_ptr<
124 service_state, 125 BluetoothTaskManagerWin::ServiceRecordState>>& service_state,
125 BluetoothRemoteGattService* service); 126 BluetoothRemoteGattService* service);
126 127
127 // Updates the GATT services with the services stored in |service_state|. 128 // Updates the GATT services with the services stored in |service_state|.
128 void UpdateGattServices( 129 void UpdateGattServices(
129 const ScopedVector<BluetoothTaskManagerWin::ServiceRecordState>& 130 const std::vector<
131 std::unique_ptr<BluetoothTaskManagerWin::ServiceRecordState>>&
130 service_state); 132 service_state);
131 133
132 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; 134 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_;
133 scoped_refptr<BluetoothSocketThread> socket_thread_; 135 scoped_refptr<BluetoothSocketThread> socket_thread_;
134 net::NetLog* net_log_; 136 net::NetLog* net_log_;
135 net::NetLogSource net_log_source_; 137 net::NetLogSource net_log_source_;
136 138
137 // The Bluetooth class of the device, a bitmask that may be decoded using 139 // The Bluetooth class of the device, a bitmask that may be decoded using
138 // https://www.bluetooth.org/Technical/AssignedNumbers/baseband.htm 140 // https://www.bluetooth.org/Technical/AssignedNumbers/baseband.htm
139 uint32_t bluetooth_class_; 141 uint32_t bluetooth_class_;
(...skipping 18 matching lines...) Expand all
158 160
159 // The service records retrieved from SDP. 161 // The service records retrieved from SDP.
160 ServiceRecordList service_record_list_; 162 ServiceRecordList service_record_list_;
161 163
162 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceWin); 164 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceWin);
163 }; 165 };
164 166
165 } // namespace device 167 } // namespace device
166 168
167 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ 169 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698