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

Unified Diff: device/usb/usb_device_handle_android.cc

Issue 2797433005: Remove MessageLoop destruction observer from //device/usb (Closed)
Patch Set: Further clarify cross-thread ownership Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | device/usb/usb_device_handle_usbfs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_device_handle_android.cc
diff --git a/device/usb/usb_device_handle_android.cc b/device/usb/usb_device_handle_android.cc
index e2e0dc03d8916f15dced5183d73b0d485be5a23f..d5dce7a8e0f842d6e7029ac7a023fa108613183d 100644
--- a/device/usb/usb_device_handle_android.cc
+++ b/device/usb/usb_device_handle_android.cc
@@ -21,6 +21,8 @@ scoped_refptr<UsbDeviceHandleAndroid> UsbDeviceHandleAndroid::Create(
const base::android::JavaRef<jobject>& usb_connection) {
ScopedJavaLocalRef<jobject> wrapper =
Java_ChromeUsbConnection_create(env, usb_connection);
+ // C++ doesn't own this file descriptor so CloseBlocking() is overridden
+ // below to release it without closing it.
base::ScopedFD fd(Java_ChromeUsbConnection_getFileDescriptor(env, wrapper));
return make_scoped_refptr(new UsbDeviceHandleAndroid(
device, std::move(fd), blocking_task_runner, wrapper));
« no previous file with comments | « no previous file | device/usb/usb_device_handle_usbfs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698