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

Unified Diff: device/test/usb_test_gadget_impl.cc

Issue 601073002: Move string descriptor getters from UsbDeviceHandle to UsbDevice. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix function order. Created 6 years, 3 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 | « device/test/usb_test_gadget.h ('k') | device/usb/usb_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/test/usb_test_gadget_impl.cc
diff --git a/device/test/usb_test_gadget_impl.cc b/device/test/usb_test_gadget_impl.cc
index a0bf4d33f30401edf296fb13230244607b310e8c..fa4f3d7a639c051b096c94ce58f5222504e6e86c 100644
--- a/device/test/usb_test_gadget_impl.cc
+++ b/device/test/usb_test_gadget_impl.cc
@@ -71,7 +71,7 @@ class UsbTestGadgetImpl : public UsbTestGadget {
virtual bool Reconnect() OVERRIDE;
virtual bool SetType(Type type) OVERRIDE;
virtual UsbDevice* GetDevice() const OVERRIDE;
- virtual std::string GetSerial() const OVERRIDE;
+ virtual std::string GetSerialNumber() const OVERRIDE;
protected:
UsbTestGadgetImpl();
@@ -166,7 +166,7 @@ UsbDevice* UsbTestGadgetImpl::GetDevice() const {
return device_.get();
}
-std::string UsbTestGadgetImpl::GetSerial() const {
+std::string UsbTestGadgetImpl::GetSerialNumber() const {
return device_address_;
}
@@ -205,13 +205,8 @@ bool UsbTestGadgetImpl::FindUnclaimed() {
devices.begin(); iter != devices.end(); ++iter) {
const scoped_refptr<UsbDevice> &device = *iter;
if (device->vendor_id() == 0x18D1 && device->product_id() == 0x58F0) {
- scoped_refptr<UsbDeviceHandle> handle = device->Open();
- if (handle.get() == NULL) {
- continue;
- }
-
base::string16 serial_utf16;
- if (!handle->GetSerial(&serial_utf16)) {
+ if (!device->GetSerialNumber(&serial_utf16)) {
continue;
}
@@ -340,7 +335,7 @@ bool UsbTestGadgetImpl::Update() {
bool UsbTestGadgetImpl::FindClaimed() {
CHECK(!device_.get());
- std::string expected_serial = GetSerial();
+ std::string expected_serial = GetSerialNumber();
std::vector<scoped_refptr<UsbDevice> > devices;
usb_service_->GetDevices(&devices);
@@ -362,13 +357,8 @@ bool UsbTestGadgetImpl::FindClaimed() {
continue;
}
- scoped_refptr<UsbDeviceHandle> handle(device->Open());
- if (handle.get() == NULL) {
- continue;
- }
-
base::string16 serial_utf16;
- if (!handle->GetSerial(&serial_utf16)) {
+ if (!device->GetSerialNumber(&serial_utf16)) {
continue;
}
« no previous file with comments | « device/test/usb_test_gadget.h ('k') | device/usb/usb_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698