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

Side by Side Diff: device/usb/usb_device_handle_android.h

Issue 2849953003: Use the task scheduler for blocking tasks in the USB service on Linux (Closed)
Patch Set: Remove more passing of the SequencedTaskRunner Created 3 years, 7 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/usb/usb_device_android.cc ('k') | device/usb/usb_device_handle_android.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_USB_USB_DEVICE_HANDLE_ANDROID_H_ 5 #ifndef DEVICE_USB_USB_DEVICE_HANDLE_ANDROID_H_
6 #define DEVICE_USB_USB_DEVICE_HANDLE_ANDROID_H_ 6 #define DEVICE_USB_USB_DEVICE_HANDLE_ANDROID_H_
7 7
8 #include "base/android/scoped_java_ref.h" 8 #include "base/android/scoped_java_ref.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/sequenced_task_runner.h"
11 #include "device/usb/usb_device_handle_usbfs.h" 10 #include "device/usb/usb_device_handle_usbfs.h"
12 11
13 namespace device { 12 namespace device {
14 13
15 class UsbDevice; 14 class UsbDevice;
16 15
17 // Extends UsbDeviceHandleUsbfs with support for managing a device connection 16 // Extends UsbDeviceHandleUsbfs with support for managing a device connection
18 // through an instance of android.hardware.usb.UsbDeviceConnection. 17 // through an instance of android.hardware.usb.UsbDeviceConnection.
19 class UsbDeviceHandleAndroid : public UsbDeviceHandleUsbfs { 18 class UsbDeviceHandleAndroid : public UsbDeviceHandleUsbfs {
20 public: 19 public:
21 static scoped_refptr<UsbDeviceHandleAndroid> Create( 20 static scoped_refptr<UsbDeviceHandleAndroid> Create(
22 JNIEnv* env, 21 JNIEnv* env,
23 scoped_refptr<UsbDevice> device, 22 scoped_refptr<UsbDevice> device,
24 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner,
25 const base::android::JavaRef<jobject>& usb_connection); 23 const base::android::JavaRef<jobject>& usb_connection);
26 24
27 private: 25 private:
28 // |wrapper| is an instance of org.chromium.device.usb.ChromeUsbConnection. 26 // |wrapper| is an instance of org.chromium.device.usb.ChromeUsbConnection.
29 UsbDeviceHandleAndroid( 27 UsbDeviceHandleAndroid(
30 scoped_refptr<UsbDevice> device, 28 scoped_refptr<UsbDevice> device,
31 base::ScopedFD fd, 29 base::ScopedFD fd,
32 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner,
33 const base::android::JavaRef<jobject>& wrapper); 30 const base::android::JavaRef<jobject>& wrapper);
34 ~UsbDeviceHandleAndroid() override; 31 ~UsbDeviceHandleAndroid() override;
35 32
36 // UsbDeviceHandleUsbfs: 33 // UsbDeviceHandleUsbfs:
37 void CloseBlocking() override; 34 void CloseBlocking() override;
38 35
39 void CloseConnection(); 36 void CloseConnection();
40 37
41 // Java object org.chromium.device.usb.ChromeUsbConnection. 38 // Java object org.chromium.device.usb.ChromeUsbConnection.
42 base::android::ScopedJavaGlobalRef<jobject> j_object_; 39 base::android::ScopedJavaGlobalRef<jobject> j_object_;
43 }; 40 };
44 41
45 } // namespace device 42 } // namespace device
46 43
47 #endif // DEVICE_USB_USB_DEVICE_HANDLE_ANDROID_H_ 44 #endif // DEVICE_USB_USB_DEVICE_HANDLE_ANDROID_H_
OLDNEW
« no previous file with comments | « device/usb/usb_device_android.cc ('k') | device/usb/usb_device_handle_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698