| OLD | NEW |
| 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_BLUETOOTH_BLOCKLIST_H_ | 5 #ifndef CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_BLOCKLIST_H_ |
| 6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_BLOCKLIST_H_ | 6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_BLOCKLIST_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 void RemoveExcludedUUIDs( | 78 void RemoveExcludedUUIDs( |
| 79 blink::mojom::WebBluetoothRequestDeviceOptions* options); | 79 blink::mojom::WebBluetoothRequestDeviceOptions* options); |
| 80 | 80 |
| 81 // Size of blocklist. | 81 // Size of blocklist. |
| 82 size_t size() { return blocklisted_uuids_.size(); } | 82 size_t size() { return blocklisted_uuids_.size(); } |
| 83 | 83 |
| 84 void ResetToDefaultValuesForTest(); | 84 void ResetToDefaultValuesForTest(); |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 // friend LazyInstance to permit access to private constructor. | 87 // friend LazyInstance to permit access to private constructor. |
| 88 friend base::DefaultLazyInstanceTraits<BluetoothBlocklist>; | 88 friend base::LazyInstanceTraitsBase<BluetoothBlocklist>; |
| 89 | 89 |
| 90 BluetoothBlocklist(); | 90 BluetoothBlocklist(); |
| 91 | 91 |
| 92 void PopulateWithDefaultValues(); | 92 void PopulateWithDefaultValues(); |
| 93 | 93 |
| 94 // Populates blocklist with values obtained dynamically from a server, able | 94 // Populates blocklist with values obtained dynamically from a server, able |
| 95 // to be updated without shipping new executable versions. | 95 // to be updated without shipping new executable versions. |
| 96 void PopulateWithServerProvidedValues(); | 96 void PopulateWithServerProvidedValues(); |
| 97 | 97 |
| 98 // Map of UUID to blocklisted value. | 98 // Map of UUID to blocklisted value. |
| 99 std::map<device::BluetoothUUID, Value> blocklisted_uuids_; | 99 std::map<device::BluetoothUUID, Value> blocklisted_uuids_; |
| 100 | 100 |
| 101 DISALLOW_COPY_AND_ASSIGN(BluetoothBlocklist); | 101 DISALLOW_COPY_AND_ASSIGN(BluetoothBlocklist); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 } // namespace content | 104 } // namespace content |
| 105 | 105 |
| 106 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_BLOCKLIST_H_ | 106 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_BLOCKLIST_H_ |
| OLD | NEW |