chromium/services/device/usb/usb_service_linux.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.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "services/device/usb/usb_service_linux.h"

#include <stdint.h>

#include <utility>
#include <vector>

#include "base/containers/contains.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/threading/scoped_blocking_call.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/device_event_log/device_event_log.h"
#include "device/udev_linux/udev_watcher.h"
#include "services/device/usb/usb_device_handle.h"
#include "services/device/usb/usb_device_linux.h"
#include "services/device/usb/webusb_descriptors.h"

namespace device {

namespace {

constexpr std::string_view kUsbSubsystem =;

// Standard USB requests and descriptor types:
const uint16_t kUsbVersion2_1 =;

const uint8_t kDeviceClassHub =;
constexpr int kUsbClassMassStorage =;

bool ShouldReadDescriptors(const UsbDeviceLinux& device) {}

void OnReadDescriptors(base::OnceClosure callback,
                       scoped_refptr<UsbDeviceHandle> device_handle,
                       const GURL& landing_page) {}

void OnDeviceOpenedToReadDescriptors(
    base::OnceClosure callback,
    scoped_refptr<UsbDeviceHandle> device_handle) {}

}  // namespace

class UsbServiceLinux::BlockingTaskRunnerHelper : public UdevWatcher::Observer {};

UsbServiceLinux::BlockingTaskRunnerHelper::BlockingTaskRunnerHelper(
    base::WeakPtr<UsbServiceLinux> service,
    scoped_refptr<base::SequencedTaskRunner> task_runner)
    :{}

UsbServiceLinux::BlockingTaskRunnerHelper::~BlockingTaskRunnerHelper() {}

void UsbServiceLinux::BlockingTaskRunnerHelper::OnDeviceAdded(
    ScopedUdevDevicePtr device) {}

void UsbServiceLinux::BlockingTaskRunnerHelper::OnDeviceRemoved(
    ScopedUdevDevicePtr device) {}

void UsbServiceLinux::BlockingTaskRunnerHelper::OnDeviceChanged(
    ScopedUdevDevicePtr) {}

UsbServiceLinux::UsbServiceLinux() {}

UsbServiceLinux::~UsbServiceLinux() {}

void UsbServiceLinux::GetDevices(GetDevicesCallback callback) {}

void UsbServiceLinux::OnDeviceAdded(
    const std::string& device_path,
    std::unique_ptr<UsbDeviceDescriptor> descriptor) {}

void UsbServiceLinux::DeviceReady(scoped_refptr<UsbDeviceLinux> device) {}

void UsbServiceLinux::OnDeviceRemoved(const std::string& path) {}

void UsbServiceLinux::HelperStarted() {}

}  // namespace device