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

Unified Diff: components/usb_service/usb_device_impl.cc

Issue 278633003: Extracted UsbDeviceHandle as interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/usb_service/usb_device_impl.h ('k') | extensions/browser/api/usb/usb_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/usb_service/usb_device_impl.cc
diff --git a/components/usb_service/usb_device_impl.cc b/components/usb_service/usb_device_impl.cc
index f1d69a319fc35577d38390d060bf160055ea211b..43c8c66fbd43ad92dcb0cbaa2f6b481315eeded4 100644
--- a/components/usb_service/usb_device_impl.cc
+++ b/components/usb_service/usb_device_impl.cc
@@ -8,7 +8,7 @@
#include "base/stl_util.h"
#include "components/usb_service/usb_context.h"
-#include "components/usb_service/usb_device_handle.h"
+#include "components/usb_service/usb_device_handle_impl.h"
#include "components/usb_service/usb_interface_impl.h"
#include "content/public/browser/browser_thread.h"
#include "third_party/libusb/src/libusb/libusb.h"
@@ -98,8 +98,8 @@ scoped_refptr<UsbDeviceHandle> UsbDeviceImpl::Open() {
scoped_refptr<UsbConfigDescriptor> interfaces = ListInterfaces();
if (!interfaces)
return NULL;
- scoped_refptr<UsbDeviceHandle> device_handle =
- new UsbDeviceHandle(context_, this, handle, interfaces);
+ scoped_refptr<UsbDeviceHandleImpl> device_handle =
+ new UsbDeviceHandleImpl(context_, this, handle, interfaces);
handles_.push_back(device_handle);
return device_handle;
}
@@ -136,12 +136,8 @@ void UsbDeviceImpl::OnDisconnect() {
DCHECK(thread_checker_.CalledOnValidThread());
HandlesVector handles;
swap(handles, handles_);
- for (std::vector<scoped_refptr<UsbDeviceHandle> >::iterator it =
- handles.begin();
- it != handles.end();
- ++it) {
+ for (HandlesVector::iterator it = handles.begin(); it != handles.end(); ++it)
(*it)->InternalClose();
- }
}
} // namespace usb_service
« no previous file with comments | « components/usb_service/usb_device_impl.h ('k') | extensions/browser/api/usb/usb_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698