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

Unified Diff: components/usb_service/usb_interface.cc

Issue 236203019: Move UsbService to its own component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move usb_service component symbols into usb_service namespace Created 6 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 | « components/usb_service/usb_interface.h ('k') | components/usb_service/usb_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/usb_service/usb_interface.cc
diff --git a/chrome/browser/usb/usb_interface.cc b/components/usb_service/usb_interface.cc
similarity index 90%
rename from chrome/browser/usb/usb_interface.cc
rename to components/usb_service/usb_interface.cc
index d5a1e0fcdff74a96e098d89560452a9b66934289..65a52e6e5373512e8ecc4ff24ac03d2f08098f55 100644
--- a/chrome/browser/usb/usb_interface.cc
+++ b/components/usb_service/usb_interface.cc
@@ -2,18 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/usb/usb_interface.h"
+#include "components/usb_service/usb_interface.h"
#include "base/logging.h"
#include "third_party/libusb/src/libusb/libusb.h"
+namespace usb_service {
+
UsbEndpointDescriptor::UsbEndpointDescriptor(
scoped_refptr<const UsbConfigDescriptor> config,
PlatformUsbEndpointDescriptor descriptor)
: config_(config), descriptor_(descriptor) {
}
-UsbEndpointDescriptor::~UsbEndpointDescriptor() {}
+UsbEndpointDescriptor::~UsbEndpointDescriptor() {
+}
int UsbEndpointDescriptor::GetAddress() const {
return descriptor_->bEndpointAddress & LIBUSB_ENDPOINT_ADDRESS_MASK;
@@ -91,14 +94,15 @@ UsbInterfaceAltSettingDescriptor::UsbInterfaceAltSettingDescriptor(
: config_(config), descriptor_(descriptor) {
}
-UsbInterfaceAltSettingDescriptor::~UsbInterfaceAltSettingDescriptor() {}
+UsbInterfaceAltSettingDescriptor::~UsbInterfaceAltSettingDescriptor() {
+}
size_t UsbInterfaceAltSettingDescriptor::GetNumEndpoints() const {
return descriptor_->bNumEndpoints;
}
scoped_refptr<const UsbEndpointDescriptor>
- UsbInterfaceAltSettingDescriptor::GetEndpoint(size_t index) const {
+UsbInterfaceAltSettingDescriptor::GetEndpoint(size_t index) const {
return new UsbEndpointDescriptor(config_, &descriptor_->endpoint[index]);
}
@@ -128,14 +132,15 @@ UsbInterfaceDescriptor::UsbInterfaceDescriptor(
: config_(config), interface_(usbInterface) {
}
-UsbInterfaceDescriptor::~UsbInterfaceDescriptor() {}
+UsbInterfaceDescriptor::~UsbInterfaceDescriptor() {
+}
size_t UsbInterfaceDescriptor::GetNumAltSettings() const {
return interface_->num_altsetting;
}
scoped_refptr<const UsbInterfaceAltSettingDescriptor>
- UsbInterfaceDescriptor::GetAltSetting(size_t index) const {
+UsbInterfaceDescriptor::GetAltSetting(size_t index) const {
return new UsbInterfaceAltSettingDescriptor(config_,
&interface_->altsetting[index]);
}
@@ -155,7 +160,9 @@ size_t UsbConfigDescriptor::GetNumInterfaces() const {
return config_->bNumInterfaces;
}
-scoped_refptr<const UsbInterfaceDescriptor>
- UsbConfigDescriptor::GetInterface(size_t index) const {
+scoped_refptr<const UsbInterfaceDescriptor> UsbConfigDescriptor::GetInterface(
+ size_t index) const {
return new UsbInterfaceDescriptor(this, &config_->interface[index]);
}
+
+} // namespace usb_service
« no previous file with comments | « components/usb_service/usb_interface.h ('k') | components/usb_service/usb_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698