summaryrefslogtreecommitdiffstats
path: root/device/usb/usb_descriptors.cc
diff options
context:
space:
mode:
authorweitaosu <weitaosu@chromium.org>2014-09-12 12:47:54 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-12 19:51:38 +0000
commitf49954838f51461f18be37c68ff85ddbbd042a47 (patch)
tree3509c317e54fa44bb23c93b7dc1084367378aea0 /device/usb/usb_descriptors.cc
parent4c1e40ba4cf297649a2b919644618c664d4812ce (diff)
downloadchromium_src-f49954838f51461f18be37c68ff85ddbbd042a47.zip
chromium_src-f49954838f51461f18be37c68ff85ddbbd042a47.tar.gz
chromium_src-f49954838f51461f18be37c68ff85ddbbd042a47.tar.bz2
Revert of Convert device::UsbConfigDescriptor and friends to structs. (patchset #2 id:60001 of https://codereview.chromium.org/562763002/)
Reason for revert: This broken the Linux ASan LSan Tests: http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Tests%20%283%29/builds/7506 http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Tests%20%281%29/builds/5717 Sample callstacks: Direct leak of 400 byte(s) in 10 object(s) allocated from: #0 0x55c6eb in __interceptor_malloc (/b/build/slave/Linux_ASan_LSan_Tests__3_/build/src/out/Release/browser_tests+0x55c6eb) #1 0xab24bb8 in raw_desc_to_config third_party/libusb/src/libusb/descriptor.c:501:45 #2 0xab24ab9 in libusb_get_active_config_descriptor third_party/libusb/src/libusb/descriptor.c:601:7 #3 0xab14aae in device::UsbDeviceImpl::GetConfiguration() device/usb/usb_device_impl.cc:199:9 #4 0xb37d57b in EnumerateOnFileThread(crypto::RSAPrivateKey*, base::Callback\u003Cvoid (std::__1::vector\u003Cscoped_refptr\u003CAndroidUsbDevice>, std::__1::allocator\u003Cscoped_refptr\u003CAndroidUsbDevice> > > const&)> const&, scoped_refptr\u003Cbase::MessageLoopProxy>) chrome/browser/devtools/device/usb/android_usb_device.cc:262:42 #5 0xb38aebf in Run base/bind_internal.h:288:12 #6 0xb38aebf in base::internal::InvokeHelper\u003Cfalse, void, base::internal::RunnableAdapter\u003Cvoid (*)(crypto::RSAPrivateKey*, base::Callback\u003Cvoid (std::__1::vector\u003Cscoped_refptr\u003CAndroidUsbDevice>, std::__1::allocator\u003Cscoped_refptr\u003CAndroidUsbDevice> > > const&)> const&, scoped_refptr\u003Cbase::MessageLoopProxy>)>, void (crypto::RSAPrivateKey* const&, base::Callback\u003Cvoid (std::__1::vector\u003Cscoped_refptr\u003CAndroidUsbDevice>, std::__1::allocator\u003Cscoped_refptr\u003CAndroidUsbDevice> > > const&)> const&, base::MessageLoopProxy*)>::MakeItSo(base::internal::RunnableAdapter\u003Cvoid (*)(crypto::RSAPrivateKey*, base::Callback\u003Cvoid (std::__1::vector\u003Cscoped_refptr\u003CAndroidUsbDevice>, std::__1::allocator\u003Cscoped_refptr\u003CAndroidUsbDevice> > > const&)> const&, scoped_refptr\u003Cbase::MessageLoopProxy>)>, crypto::RSAPrivateKey* const&, base::Callback\u003Cvoid (std::__1::vector\u003Cscoped_refptr\u003CAndroidUsbDevice>, std::__1::allocator\u003Cscoped_refptr\u003CAndroidUsbDevice> > > const&)> const&, base::MessageLoopProxy*) base/bind_internal.h:927 #7 0x2d58bff in Run base/callback.h:401:12 #8 0x2d58bff in base::debug::TaskAnnotator::RunTask(char const*, char const*, base::PendingTask const&) base/debug/task_annotator.cc:62 #9 0x2ca519c in base::MessageLoop::RunTask(base::PendingTask const&) base/message_loop/message_loop.cc:446:3 #10 0x2ca629e in DeferOrRunPendingTask base/message_loop/message_loop.cc:456:5 #11 0x2ca629e in base::MessageLoop::DoWork() base/message_loop/message_loop.cc:565 #12 0x2c23ddf in base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_libevent.cc:232:21 #13 0x2cd57b4 in base::RunLoop::Run() base/run_loop.cc:49:3 #14 0x2ca39c4 in base::MessageLoop::Run() base/message_loop/message_loop.cc:308:3 #15 0x50fd018 in content::BrowserThreadImpl::FileThreadRun(base::MessageLoop*) content/browser/browser_thread_impl.cc:190:3 #16 0x50fdca7 in content::BrowserThreadImpl::Run(base::MessageLoop*) content/browser/browser_thread_impl.cc:244:14 #17 0x2d1ebc8 in base::Thread::ThreadMain() base/threading/thread.cc:228:5 #18 0x2d12b20 in base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:80:3 #19 0x7f4d560a3e99 in start_thread /build/buildd/eglibc-2.15/nptl/pthread_create.c:308 Direct leak of 400 byte(s) in 10 object(s) allocated from: #0 0x55c6eb in __interceptor_malloc (/b/build/slave/Linux_ASan_LSan_Tests__1_/build/src/out/Release/browser_tests+0x55c6eb) #1 0xab24bb8 in raw_desc_to_config third_party/libusb/src/libusb/descriptor.c:501:45 #2 0xab24ab9 in libusb_get_active_config_descriptor third_party/libusb/src/libusb/descriptor.c:601:7 #3 0xab14aae in device::UsbDeviceImpl::GetConfiguration() device/usb/usb_device_impl.cc:199:9 #4 0xb37d57b in EnumerateOnFileThread(crypto::RSAPrivateKey*, base::Callback\u003Cvoid (std::__1::vector\u003Cscoped_refptr\u003CAndroidUsbDevice>, std::__1::allocator\u003Cscoped_refptr\u003CAndroidUsbDevice> > > const&)> const&, scoped_refptr\u003Cbase::MessageLoopProxy>) chrome/browser/devtools/device/usb/android_usb_device.cc:262:42 #5 0xb38aebf in Run base/bind_internal.h:288:12 #6 0xb38aebf in base::internal::InvokeHelper\u003Cfalse, void, base::internal::RunnableAdapter\u003Cvoid (*)(crypto::RSAPrivateKey*, base::Callback\u003Cvoid (std::__1::vector\u003Cscoped_refptr\u003CAndroidUsbDevice>, std::__1::allocator\u003Cscoped_refptr\u003CAndroidUsbDevice> > > const&)> const&, scoped_refptr\u003Cbase::MessageLoopProxy>)>, void (crypto::RSAPrivateKey* const&, base::Callback\u003Cvoid (std::__1::vector\u003Cscoped_refptr\u003CAndroidUsbDevice>, std::__1::allocator\u003Cscoped_refptr\u003CAndroidUsbDevice> > > const&)> const&, base::MessageLoopProxy*)>::MakeItSo(base::internal::RunnableAdapter\u003Cvoid (*)(crypto::RSAPrivateKey*, base::Callback\u003Cvoid (std::__1::vector\u003Cscoped_refptr\u003CAndroidUsbDevice>, std::__1::allocator\u003Cscoped_refptr\u003CAndroidUsbDevice> > > const&)> const&, scoped_refptr\u003Cbase::MessageLoopProxy>)>, crypto::RSAPrivateKey* const&, base::Callback\u003Cvoid (std::__1::vector\u003Cscoped_refptr\u003CAndroidUsbDevice>, std::__1::allocator\u003Cscoped_refptr\u003CAndroidUsbDevice> > > const&)> const&, base::MessageLoopProxy*) base/bind_internal.h:927 #7 0x2d58bff in Run base/callback.h:401:12 #8 0x2d58bff in base::debug::TaskAnnotator::RunTask(char const*, char const*, base::PendingTask const&) base/debug/task_annotator.cc:62 #9 0x2ca519c in base::MessageLoop::RunTask(base::PendingTask const&) base/message_loop/message_loop.cc:446:3 #10 0x2ca629e in DeferOrRunPendingTask base/message_loop/message_loop.cc:456:5 #11 0x2ca629e in base::MessageLoop::DoWork() base/message_loop/message_loop.cc:565 #12 0x2c23ddf in base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_libevent.cc:232:21 #13 0x2cd57b4 in base::RunLoop::Run() base/run_loop.cc:49:3 #14 0x2ca39c4 in base::MessageLoop::Run() base/message_loop/message_loop.cc:308:3 #15 0x50fd018 in content::BrowserThreadImpl::FileThreadRun(base::MessageLoop*) content/browser/browser_thread_impl.cc:190:3 #16 0x50fdca7 in content::BrowserThreadImpl::Run(base::MessageLoop*) content/browser/browser_thread_impl.cc:244:14 #17 0x2d1ebc8 in base::Thread::ThreadMain() base/threading/thread.cc:228:5 #18 0x2d12b20 in base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:80:3 #19 0x7f4aef980e99 in start_thread /build/buildd/eglibc-2.15/nptl/pthread_create.c:308 Original issue's description: > Convert device::UsbConfigDescriptor and friends to structs. > > These classes do not need to be classes and expecially don't need to be > abstract classes as this leads to a complicated implementation and > complicated tests. All USB devices no matter the platform will have the > same descriptor data. > > This change follows the model of device::HidDeviceInfo. > > BUG= > > Committed: https://crrev.com/be9e363a3af57bd313fbb96ec3b5fa02cef769b5 > Cr-Commit-Position: refs/heads/master@{#294594} TBR=dgozman@chromium.org,rockot@chromium.org,rpaquay@chromium.org,pfeldman@chromium.org,reillyg@chromium.org NOTREECHECKS=true NOTRY=true BUG= Review URL: https://codereview.chromium.org/567003002 Cr-Commit-Position: refs/heads/master@{#294640}
Diffstat (limited to 'device/usb/usb_descriptors.cc')
-rw-r--r--device/usb/usb_descriptors.cc43
1 files changed, 0 insertions, 43 deletions
diff --git a/device/usb/usb_descriptors.cc b/device/usb/usb_descriptors.cc
deleted file mode 100644
index d68d60e..0000000
--- a/device/usb/usb_descriptors.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "device/usb/usb_descriptors.h"
-
-namespace device {
-
-UsbEndpointDescriptor::UsbEndpointDescriptor()
- : address(0),
- direction(USB_DIRECTION_INBOUND),
- maximum_packet_size(0),
- synchronization_type(USB_SYNCHRONIZATION_NONE),
- transfer_type(USB_TRANSFER_CONTROL),
- usage_type(USB_USAGE_DATA),
- polling_interval(0) {
-}
-
-UsbEndpointDescriptor::~UsbEndpointDescriptor() {
-}
-
-UsbInterfaceDescriptor::UsbInterfaceDescriptor()
- : interface_number(0),
- alternate_setting(0),
- interface_class(0),
- interface_subclass(0),
- interface_protocol(0) {
-}
-
-UsbInterfaceDescriptor::~UsbInterfaceDescriptor() {
-}
-
-UsbConfigDescriptor::UsbConfigDescriptor()
- : configuration_value(0),
- self_powered(false),
- remote_wakeup(false),
- maximum_power(0) {
-}
-
-UsbConfigDescriptor::~UsbConfigDescriptor() {
-}
-
-} // namespace device