Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2248)

Unified Diff: device/usb/usb_device_win.h

Issue 2690383002: Add device path enumeration to the new Windows USB backend. (Closed)
Patch Set: Fix a comment. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/usb/usb_device.cc ('k') | device/usb/usb_device_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_device_win.h
diff --git a/device/usb/usb_device_win.h b/device/usb/usb_device_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..0a74c06cf00edb2bae5fc0dcbc56fbd3fd0cfb4e
--- /dev/null
+++ b/device/usb/usb_device_win.h
@@ -0,0 +1,55 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DEVICE_USB_USB_DEVICE_WIN_H_
+#define DEVICE_USB_USB_DEVICE_WIN_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "base/threading/thread_checker.h"
+#include "device/usb/usb_device.h"
+
+namespace base {
+class SequencedTaskRunner;
+}
+
+namespace device {
+
+class UsbDeviceWin : public UsbDevice {
+ public:
+ // UsbDevice implementation:
+ void Open(const OpenCallback& callback) override;
+
+ protected:
+ friend class UsbServiceWin;
+ friend class UsbDeviceHandleWin;
+
+ // Called by UsbServiceWin only;
+ UsbDeviceWin(const std::string& device_path,
+ const std::string& hub_path,
+ int port_number,
+ scoped_refptr<base::SequencedTaskRunner> task_runner);
+
+ ~UsbDeviceWin() override;
+
+ const std::string& device_path() const { return device_path_; }
+ int port_number() const { return port_number_; }
+
+ private:
+ base::ThreadChecker thread_checker_;
+
+ const std::string device_path_;
+ const std::string hub_path_;
+ const int port_number_;
+
+ scoped_refptr<base::SequencedTaskRunner> task_runner_;
+ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(UsbDeviceWin);
+};
+
+} // namespace device
+
+#endif // DEVICE_USB_USB_DEVICE_WIN_H_
« no previous file with comments | « device/usb/usb_device.cc ('k') | device/usb/usb_device_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698