#include "chrome/browser/usb/usb_blocklist.h"
#include <algorithm>
#include <string>
#include <string_view>
#include <tuple>
#include "base/metrics/field_trial_params.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "services/device/public/mojom/usb_device.mojom.h"
namespace {
static base::LazyInstance<UsbBlocklist>::Leaky g_singleton = …;
constexpr uint16_t kMaxVersion = …;
bool IsHexComponent(std::string_view string) { … }
bool CompareEntry(const UsbBlocklist::Entry& a, const UsbBlocklist::Entry& b) { … }
template <class Iterator>
bool EntryMatches(Iterator begin,
Iterator end,
const UsbBlocklist::Entry& entry) { … }
const UsbBlocklist::Entry kStaticEntries[] = …;
}
UsbBlocklist::Entry::Entry(uint16_t vendor_id,
uint16_t product_id,
uint16_t max_version)
: … { … }
UsbBlocklist::~UsbBlocklist() { … }
UsbBlocklist& UsbBlocklist::Get() { … }
bool UsbBlocklist::IsExcluded(const Entry& entry) const { … }
bool UsbBlocklist::IsExcluded(
const device::mojom::UsbDeviceInfo& device_info) const { … }
void UsbBlocklist::ResetToDefaultValuesForTest() { … }
UsbBlocklist::UsbBlocklist() { … }
void UsbBlocklist::PopulateWithServerProvidedValues() { … }