chromium/chrome/browser/usb/usb_blocklist.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 =;

// Returns true if the passed string is exactly 4 digits long and only contains
// valid hexadecimal characters (no leading 0x).
bool IsHexComponent(std::string_view string) {}

bool CompareEntry(const UsbBlocklist::Entry& a, const UsbBlocklist::Entry& b) {}

// Returns true if an entry in (begin, end] matches the vendor and product IDs
// of |entry| and has a device version greater than or equal to |entry|.
template <class Iterator>
bool EntryMatches(Iterator begin,
                  Iterator end,
                  const UsbBlocklist::Entry& entry) {}

// This list must be sorted according to CompareEntry.
const UsbBlocklist::Entry kStaticEntries[] =;

}  // namespace

UsbBlocklist::Entry::Entry(uint16_t vendor_id,
                           uint16_t product_id,
                           uint16_t max_version)
    :{}

UsbBlocklist::~UsbBlocklist() {}

// static
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() {}