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 CHROME_BROWSER_USB_USB_BLOCKLIST_H_ | 5 #ifndef CHROME_BROWSER_USB_USB_BLOCKLIST_H_ |
6 #define CHROME_BROWSER_USB_USB_BLOCKLIST_H_ | 6 #define CHROME_BROWSER_USB_USB_BLOCKLIST_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 bool IsExcluded(scoped_refptr<const device::UsbDevice>); | 59 bool IsExcluded(scoped_refptr<const device::UsbDevice>); |
60 | 60 |
61 // Size of the blocklist. | 61 // Size of the blocklist. |
62 size_t size() { return blocklisted_devices_.size(); } | 62 size_t size() { return blocklisted_devices_.size(); } |
63 | 63 |
64 // Reload the blocklist for testing purposes. | 64 // Reload the blocklist for testing purposes. |
65 void ResetToDefaultValuesForTest(); | 65 void ResetToDefaultValuesForTest(); |
66 | 66 |
67 private: | 67 private: |
68 // friend LazyInstance to permit access to private constructor. | 68 // friend LazyInstance to permit access to private constructor. |
69 friend base::DefaultLazyInstanceTraits<UsbBlocklist>; | 69 friend base::LazyInstanceTraitsBase<UsbBlocklist>; |
70 | 70 |
71 UsbBlocklist(); | 71 UsbBlocklist(); |
72 | 72 |
73 void PopulateWithDefaultValues(); | 73 void PopulateWithDefaultValues(); |
74 | 74 |
75 // Populates the blocklist with values obtained dynamically from a server, | 75 // Populates the blocklist with values obtained dynamically from a server, |
76 // able to be updated without shipping new executable versions. | 76 // able to be updated without shipping new executable versions. |
77 void PopulateWithServerProvidedValues(); | 77 void PopulateWithServerProvidedValues(); |
78 | 78 |
79 // Set of blocklist entries. | 79 // Set of blocklist entries. |
80 std::set<Entry> blocklisted_devices_; | 80 std::set<Entry> blocklisted_devices_; |
81 | 81 |
82 DISALLOW_COPY_AND_ASSIGN(UsbBlocklist); | 82 DISALLOW_COPY_AND_ASSIGN(UsbBlocklist); |
83 }; | 83 }; |
84 | 84 |
85 #endif // CHROME_BROWSER_USB_USB_BLOCKLIST_H_ | 85 #endif // CHROME_BROWSER_USB_USB_BLOCKLIST_H_ |
OLD | NEW |