OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BLUETOOTH_ALLOWED_DEVICES_MAP_H_ | 5 #ifndef CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_ALLOWED_DEVICES_MAP_H_ |
6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_ALLOWED_DEVICES_MAP_H_ | 6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_ALLOWED_DEVICES_MAP_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <unordered_map> | 10 #include <unordered_map> |
11 #include <unordered_set> | 11 #include <unordered_set> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/optional.h" | 14 #include "base/optional.h" |
15 #include "content/common/bluetooth/web_bluetooth_device_id.h" | 15 #include "content/common/bluetooth/web_bluetooth_device_id.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.moj
om.h" | 17 #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.moj
om.h" |
18 #include "url/origin.h" | 18 #include "url/origin.h" |
19 | 19 |
20 namespace device { | 20 namespace device { |
21 class BluetoothUUID; | 21 class BluetoothUUID; |
22 } | 22 } |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 | 25 |
26 struct BluetoothScanFilter; | |
27 | |
28 // Keeps track of which origins are allowed to access which devices and | 26 // Keeps track of which origins are allowed to access which devices and |
29 // their services. | 27 // their services. |
30 // | 28 // |
31 // |AddDevice| generates device ids, which are random strings that are unique | 29 // |AddDevice| generates device ids, which are random strings that are unique |
32 // in the map. | 30 // in the map. |
33 class CONTENT_EXPORT BluetoothAllowedDevicesMap final { | 31 class CONTENT_EXPORT BluetoothAllowedDevicesMap final { |
34 public: | 32 public: |
35 BluetoothAllowedDevicesMap(); | 33 BluetoothAllowedDevicesMap(); |
36 ~BluetoothAllowedDevicesMap(); | 34 ~BluetoothAllowedDevicesMap(); |
37 | 35 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 origin_to_device_id_to_services_map_; | 97 origin_to_device_id_to_services_map_; |
100 | 98 |
101 // Keep track of all device_ids in the map. | 99 // Keep track of all device_ids in the map. |
102 std::unordered_set<WebBluetoothDeviceId, WebBluetoothDeviceIdHash> | 100 std::unordered_set<WebBluetoothDeviceId, WebBluetoothDeviceIdHash> |
103 device_id_set_; | 101 device_id_set_; |
104 }; | 102 }; |
105 | 103 |
106 } // namespace content | 104 } // namespace content |
107 | 105 |
108 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_ALLOWED_DEVICES_MAP_H_ | 106 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_ALLOWED_DEVICES_MAP_H_ |
OLD | NEW |