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

Side by Side Diff: device/test/usb_test_gadget.h

Issue 980023002: Move device/usb classes from the FILE thread to UI thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add more thread assertions. Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « device/hid/hid_service.cc ('k') | device/test/usb_test_gadget_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DEVICE_TEST_USB_TEST_GADGET_H_ 5 #ifndef DEVICE_TEST_USB_TEST_GADGET_H_
6 #define DEVICE_TEST_USB_TEST_GADGET_H_ 6 #define DEVICE_TEST_USB_TEST_GADGET_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
12 13
14 namespace base {
15 class SingleThreadTaskRunner;
16 }
17
13 namespace device { 18 namespace device {
14 19
15 class UsbDevice; 20 class UsbDevice;
16 21
17 class UsbTestGadget { 22 class UsbTestGadget {
18 public: 23 public:
19 enum Type { 24 enum Type {
20 DEFAULT = 0, 25 DEFAULT = 0,
21 KEYBOARD, 26 KEYBOARD,
22 MOUSE, 27 MOUSE,
23 HID_ECHO, 28 HID_ECHO,
24 ECHO, 29 ECHO,
25 }; 30 };
26 31
27 virtual ~UsbTestGadget() {} 32 virtual ~UsbTestGadget() {}
28 33
29 static bool IsTestEnabled(); 34 static bool IsTestEnabled();
30 static scoped_ptr<UsbTestGadget> Claim(); 35 static scoped_ptr<UsbTestGadget> Claim(
36 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner);
31 37
32 virtual bool Unclaim() = 0; 38 virtual bool Unclaim() = 0;
33 virtual bool Disconnect() = 0; 39 virtual bool Disconnect() = 0;
34 virtual bool Reconnect() = 0; 40 virtual bool Reconnect() = 0;
35 virtual bool SetType(Type type) = 0; 41 virtual bool SetType(Type type) = 0;
36 42
37 virtual UsbDevice* GetDevice() const = 0; 43 virtual UsbDevice* GetDevice() const = 0;
38 virtual const std::string& GetSerialNumber() const = 0;
39 44
40 protected: 45 protected:
41 UsbTestGadget() {} 46 UsbTestGadget() {}
42 47
43 private: 48 private:
44 DISALLOW_COPY_AND_ASSIGN(UsbTestGadget); 49 DISALLOW_COPY_AND_ASSIGN(UsbTestGadget);
45 }; 50 };
46 51
47 } // namespace device 52 } // namespace device
48 53
49 #endif // DEVICE_TEST_USB_TEST_GADGET_H_ 54 #endif // DEVICE_TEST_USB_TEST_GADGET_H_
OLDNEW
« no previous file with comments | « device/hid/hid_service.cc ('k') | device/test/usb_test_gadget_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698