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

Issue 562763002: Convert device::UsbConfigDescriptor and friends to structs. (Closed)

Created:
6 years, 3 months ago by Reilly Grant (use Gerrit)
Modified:
6 years, 3 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

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}

Patch Set 1 : #

Total comments: 5

Patch Set 2 : Add interface and endpoint descriptor iterator typedefs. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+459 lines, -843 lines) Patch
M chrome/browser/devtools/device/usb/android_usb_browsertest.cc View 5 chunks +30 lines, -124 lines 0 comments Download
M chrome/browser/devtools/device/usb/android_usb_device.cc View 1 7 chunks +40 lines, -48 lines 0 comments Download
M device/usb/BUILD.gn View 2 chunks +2 lines, -3 lines 0 comments Download
M device/usb/usb.gyp View 2 chunks +2 lines, -3 lines 0 comments Download
A device/usb/usb_descriptors.h View 1 1 chunk +83 lines, -0 lines 0 comments Download
A device/usb/usb_descriptors.cc View 1 chunk +43 lines, -0 lines 0 comments Download
M device/usb/usb_device.h View 2 chunks +3 lines, -4 lines 0 comments Download
M device/usb/usb_device_filter.cc View 1 2 chunks +11 lines, -17 lines 0 comments Download
M device/usb/usb_device_filter_unittest.cc View 1 chunk +26 lines, -127 lines 0 comments Download
M device/usb/usb_device_handle.h View 1 chunk +1 line, -1 line 0 comments Download
M device/usb/usb_device_handle_impl.h View 4 chunks +3 lines, -4 lines 0 comments Download
M device/usb/usb_device_handle_impl.cc View 1 3 chunks +23 lines, -18 lines 0 comments Download
M device/usb/usb_device_impl.h View 3 chunks +7 lines, -1 line 0 comments Download
M device/usb/usb_device_impl.cc View 6 chunks +135 lines, -16 lines 0 comments Download
D device/usb/usb_interface.h View 1 chunk +0 lines, -112 lines 0 comments Download
D device/usb/usb_interface_impl.h View 1 chunk +0 lines, -117 lines 0 comments Download
D device/usb/usb_interface_impl.cc View 1 chunk +0 lines, -168 lines 0 comments Download
M extensions/browser/api/usb/usb_api.h View 1 chunk +0 lines, -1 line 0 comments Download
M extensions/browser/api/usb/usb_api.cc View 1 2 chunks +45 lines, -63 lines 0 comments Download
M extensions/browser/api/usb/usb_apitest.cc View 4 chunks +5 lines, -16 lines 0 comments Download

Messages

Total messages: 17 (6 generated)
Reilly Grant (use Gerrit)
dgozman, pfeldman: Android DevTools changes. rockot, rpaquay, scheib: Device and extension API changes.
6 years, 3 months ago (2014-09-11 00:24:17 UTC) #5
Reilly Grant (use Gerrit)
Removing scheib because while he's a nice guy and would love to review some of ...
6 years, 3 months ago (2014-09-11 00:39:51 UTC) #7
dgozman
https://codereview.chromium.org/562763002/diff/40001/chrome/browser/devtools/device/usb/android_usb_browsertest.cc File chrome/browser/devtools/device/usb/android_usb_browsertest.cc (right): https://codereview.chromium.org/562763002/diff/40001/chrome/browser/devtools/device/usb/android_usb_browsertest.cc#newcode354 chrome/browser/devtools/device/usb/android_usb_browsertest.cc:354: bulk_in.maximum_packet_size = 512; This was 1Mb before. Why did ...
6 years, 3 months ago (2014-09-11 11:23:47 UTC) #8
Reilly Grant (use Gerrit)
https://codereview.chromium.org/562763002/diff/40001/chrome/browser/devtools/device/usb/android_usb_browsertest.cc File chrome/browser/devtools/device/usb/android_usb_browsertest.cc (right): https://codereview.chromium.org/562763002/diff/40001/chrome/browser/devtools/device/usb/android_usb_browsertest.cc#newcode354 chrome/browser/devtools/device/usb/android_usb_browsertest.cc:354: bulk_in.maximum_packet_size = 512; On 2014/09/11 11:23:47, dgozman wrote: > ...
6 years, 3 months ago (2014-09-11 17:49:26 UTC) #9
Ken Rockot(use gerrit already)
lgtm
6 years, 3 months ago (2014-09-11 20:02:14 UTC) #10
Reilly Grant (use Gerrit)
Added typedefs for interface and endpoint iterators to encourage the use of this pattern over ...
6 years, 3 months ago (2014-09-12 01:00:19 UTC) #11
dgozman
lgtm https://codereview.chromium.org/562763002/diff/40001/chrome/browser/devtools/device/usb/android_usb_device.cc File chrome/browser/devtools/device/usb/android_usb_device.cc (right): https://codereview.chromium.org/562763002/diff/40001/chrome/browser/devtools/device/usb/android_usb_device.cc#newcode62 chrome/browser/devtools/device/usb/android_usb_device.cc:62: if (interface.alternate_setting != 0 || On 2014/09/11 17:49:26, ...
6 years, 3 months ago (2014-09-12 11:03:34 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/562763002/60001
6 years, 3 months ago (2014-09-12 14:52:42 UTC) #14
commit-bot: I haz the power
Committed patchset #2 (id:60001) as b5a62f1c0f1792b69540afc40ecea06a48bbc70a
6 years, 3 months ago (2014-09-12 15:33:20 UTC) #15
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/be9e363a3af57bd313fbb96ec3b5fa02cef769b5 Cr-Commit-Position: refs/heads/master@{#294594}
6 years, 3 months ago (2014-09-12 15:46:27 UTC) #16
weitao
6 years, 3 months ago (2014-09-12 19:19:32 UTC) #17
Message was sent while issue was closed.
A revert of this CL (patchset #2 id:60001) has been created in
https://codereview.chromium.org/567003002/ by weitaosu@chromium.org.

The reason for reverting is: This broken the Linux ASan LSan Tests:
http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Te...
http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Te...

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
.

Powered by Google App Engine
This is Rietveld 408576698