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

Side by Side Diff: content/browser/bluetooth/web_bluetooth_service_impl.h

Issue 2658473002: Refactor BluetoothAllowedDevicesMap (Closed)
Patch Set: set --similarity=20 when did git cl upload Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ 5 #ifndef CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_
6 #define CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ 6 #define CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/optional.h" 13 #include "base/optional.h"
14 #include "content/browser/bad_message.h" 14 #include "content/browser/bad_message.h"
15 #include "content/browser/bluetooth/bluetooth_allowed_devices_map.h" 15 #include "content/browser/bluetooth/bluetooth_allowed_devices.h"
16 #include "content/common/content_export.h" 16 #include "content/common/content_export.h"
17 #include "content/public/browser/web_contents_observer.h" 17 #include "content/public/browser/web_contents_observer.h"
18 #include "device/bluetooth/bluetooth_adapter.h" 18 #include "device/bluetooth/bluetooth_adapter.h"
19 #include "device/bluetooth/bluetooth_gatt_connection.h" 19 #include "device/bluetooth/bluetooth_gatt_connection.h"
20 #include "device/bluetooth/bluetooth_gatt_notify_session.h" 20 #include "device/bluetooth/bluetooth_gatt_notify_session.h"
21 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h" 21 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h"
22 #include "device/bluetooth/bluetooth_remote_gatt_service.h" 22 #include "device/bluetooth/bluetooth_remote_gatt_service.h"
23 #include "mojo/public/cpp/bindings/binding.h" 23 #include "mojo/public/cpp/bindings/binding.h"
24 #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.moj om.h" 24 #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.moj om.h"
25 25
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 device::BluetoothAdapter* GetAdapter(); 221 device::BluetoothAdapter* GetAdapter();
222 url::Origin GetOrigin(); 222 url::Origin GetOrigin();
223 223
224 // Clears all state (maps, sets, etc). 224 // Clears all state (maps, sets, etc).
225 void ClearState(); 225 void ClearState();
226 226
227 // Used to open a BluetoothChooser and start a device discovery session. 227 // Used to open a BluetoothChooser and start a device discovery session.
228 std::unique_ptr<BluetoothDeviceChooserController> device_chooser_controller_; 228 std::unique_ptr<BluetoothDeviceChooserController> device_chooser_controller_;
229 229
230 // Keeps track of which devices the frame's origin is allowed to access. 230 // Keeps track of which devices the frame's origin is allowed to access.
231 BluetoothAllowedDevicesMap allowed_devices_map_; 231 BluetoothAllowedDevices* allowed_devices_ = nullptr;
232 232
233 // Maps to get the object's parent based on its instanceID. 233 // Maps to get the object's parent based on its instanceID.
234 std::unordered_map<std::string, std::string> service_id_to_device_address_; 234 std::unordered_map<std::string, std::string> service_id_to_device_address_;
235 std::unordered_map<std::string, std::string> characteristic_id_to_service_id_; 235 std::unordered_map<std::string, std::string> characteristic_id_to_service_id_;
236 std::unordered_map<std::string, std::string> 236 std::unordered_map<std::string, std::string>
237 descriptor_id_to_characteristic_id_; 237 descriptor_id_to_characteristic_id_;
238 238
239 // Map to keep track of the connected Bluetooth devices. 239 // Map to keep track of the connected Bluetooth devices.
240 std::unique_ptr<FrameConnectedBluetoothDevices> connected_devices_; 240 std::unique_ptr<FrameConnectedBluetoothDevices> connected_devices_;
241 241
(...skipping 19 matching lines...) Expand all
261 mojo::Binding<blink::mojom::WebBluetoothService> binding_; 261 mojo::Binding<blink::mojom::WebBluetoothService> binding_;
262 262
263 base::WeakPtrFactory<WebBluetoothServiceImpl> weak_ptr_factory_; 263 base::WeakPtrFactory<WebBluetoothServiceImpl> weak_ptr_factory_;
264 264
265 DISALLOW_COPY_AND_ASSIGN(WebBluetoothServiceImpl); 265 DISALLOW_COPY_AND_ASSIGN(WebBluetoothServiceImpl);
266 }; 266 };
267 267
268 } // namespace content 268 } // namespace content
269 269
270 #endif // CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ 270 #endif // CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698