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

Unified Diff: extensions/browser/api/usb/usb_api.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.cc ('k') | extensions/browser/api/usb/usb_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/usb/usb_api.cc
diff --git a/extensions/browser/api/usb/usb_api.cc b/extensions/browser/api/usb/usb_api.cc
index 93ac6c133b75aef37677e0ce92b314d1dbc6564c..428439a06c5b5e4204d81fbd16b75fccd97f22da 100644
--- a/extensions/browser/api/usb/usb_api.cc
+++ b/extensions/browser/api/usb/usb_api.cc
@@ -464,15 +464,15 @@ UsbAsyncApiFunction::GetDeviceHandleOrCompleteWithError(
return NULL;
}
- if (!resource->device() || !resource->device()->device()) {
+ if (!resource->device() || !resource->device()->GetDevice()) {
CompleteWithError(kErrorDisconnect);
manager_->Remove(extension_->id(), input_device_handle.handle);
return NULL;
}
- if (resource->device()->device()->vendor_id() !=
+ if (resource->device()->GetDevice()->vendor_id() !=
input_device_handle.vendor_id ||
- resource->device()->device()->product_id() !=
+ resource->device()->GetDevice()->product_id() !=
input_device_handle.product_id) {
CompleteWithError(kErrorNoDevice);
return NULL;
@@ -721,8 +721,8 @@ void UsbOpenDeviceFunction::AsyncWorkStart() {
SetResult(PopulateConnectionHandle(
manager_->Add(new UsbDeviceResource(extension_->id(), handle_)),
- handle_->device()->vendor_id(),
- handle_->device()->product_id()));
+ handle_->GetDevice()->vendor_id(),
+ handle_->GetDevice()->product_id()));
AsyncWorkCompleted();
}
@@ -745,7 +745,7 @@ void UsbListInterfacesFunction::AsyncWorkStart() {
return;
scoped_refptr<UsbConfigDescriptor> config =
- device_handle->device()->ListInterfaces();
+ device_handle->GetDevice()->ListInterfaces();
if (!config) {
SetError(kErrorCannotListInterfaces);
« no previous file with comments | « components/usb_service/usb_device_impl.cc ('k') | extensions/browser/api/usb/usb_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698