OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "device/usb/usb_device_win.h" |
| 6 |
| 7 #include "base/bind.h" |
| 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/sequenced_task_runner.h" |
| 10 #include "base/single_thread_task_runner.h" |
| 11 #include "base/threading/thread_task_runner_handle.h" |
| 12 #include "components/device_event_log/device_event_log.h" |
| 13 #include "device/usb/usb_device_handle.h" |
| 14 |
| 15 namespace device { |
| 16 |
| 17 UsbDeviceWin::UsbDeviceWin( |
| 18 const std::string& device_path, |
| 19 const std::string& hub_path, |
| 20 int port_number, |
| 21 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner) |
| 22 : device_path_(device_path), |
| 23 hub_path_(hub_path), |
| 24 port_number_(port_number), |
| 25 task_runner_(base::ThreadTaskRunnerHandle::Get()), |
| 26 blocking_task_runner_(std::move(blocking_task_runner)) {} |
| 27 |
| 28 UsbDeviceWin::~UsbDeviceWin() {} |
| 29 |
| 30 void UsbDeviceWin::Open(const OpenCallback& callback) { |
| 31 DCHECK(thread_checker_.CalledOnValidThread()); |
| 32 task_runner_->PostTask(FROM_HERE, base::Bind(callback, nullptr)); |
| 33 } |
| 34 |
| 35 } // namespace device |
OLD | NEW |