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

Issue 1903933002: Store devices that only need to be enumerated once (Closed)

Created:
4 years, 8 months ago by juncai
Modified:
4 years, 7 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Store devices that only need to be enumerated once Some devices that only need to be enumerated once and then can be ignored (for example, hub devices, devices that failed enumeration, etc.). Currently these devices are enumerated each time UsbServiceImpl::EnumerateDevice() is called since they are added to |new_devices| at UsbServiceImpl::OnDeviceList(). This patch add code to store those devices and not enumerate them again. BUG=604792 Committed: https://crrev.com/d23f2ba75f50575513dcbde328c6041e4d47716c Cr-Commit-Position: refs/heads/master@{#390234}

Patch Set 1 : only enumerate hub devices once #

Patch Set 2 : address reillyg@'s comment #

Total comments: 8

Patch Set 3 : address reillyg@'s comments #

Total comments: 2

Patch Set 4 : clean up code #

Patch Set 5 : fixed device leak at usb_service_impl.cc #

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -3 lines) Patch
M device/usb/usb_service_impl.h View 1 2 2 chunks +9 lines, -0 lines 0 comments Download
M device/usb/usb_service_impl.cc View 1 2 3 4 7 chunks +34 lines, -3 lines 0 comments Download

Messages

Total messages: 20 (9 generated)
juncai
Please take a look.
4 years, 8 months ago (2016-04-20 22:43:23 UTC) #4
Reilly Grant (use Gerrit)
This is a good start but this should also handle the case of failed enumerations ...
4 years, 8 months ago (2016-04-20 22:49:40 UTC) #5
juncai
Made some modification to address the comment. Please take a look.
4 years, 8 months ago (2016-04-21 01:18:51 UTC) #6
Reilly Grant (use Gerrit)
https://codereview.chromium.org/1903933002/diff/20001/device/usb/usb_service_impl.cc File device/usb/usb_service_impl.cc (right): https://codereview.chromium.org/1903933002/diff/20001/device/usb/usb_service_impl.cc#newcode430 device/usb/usb_service_impl.cc:430: if (ignored_devices_.find(platform_device) != ignored_devices_.end()) { if (ContainsValue(ignored_devices, platform_device)) https://codereview.chromium.org/1903933002/diff/20001/device/usb/usb_service_impl.cc#newcode465 ...
4 years, 8 months ago (2016-04-22 21:12:05 UTC) #10
juncai
https://codereview.chromium.org/1903933002/diff/20001/device/usb/usb_service_impl.cc File device/usb/usb_service_impl.cc (right): https://codereview.chromium.org/1903933002/diff/20001/device/usb/usb_service_impl.cc#newcode430 device/usb/usb_service_impl.cc:430: if (ignored_devices_.find(platform_device) != ignored_devices_.end()) { On 2016/04/22 21:12:04, Reilly ...
4 years, 8 months ago (2016-04-22 22:02:44 UTC) #11
Reilly Grant (use Gerrit)
https://codereview.chromium.org/1903933002/diff/40001/device/usb/usb_service_impl.cc File device/usb/usb_service_impl.cc (right): https://codereview.chromium.org/1903933002/diff/40001/device/usb/usb_service_impl.cc#newcode461 device/usb/usb_service_impl.cc:461: ignored_devices_.erase(current); We should libusb_unref_device here and in the UsbServiceImpl ...
4 years, 8 months ago (2016-04-22 22:21:24 UTC) #12
juncai
https://codereview.chromium.org/1903933002/diff/40001/device/usb/usb_service_impl.cc File device/usb/usb_service_impl.cc (right): https://codereview.chromium.org/1903933002/diff/40001/device/usb/usb_service_impl.cc#newcode461 device/usb/usb_service_impl.cc:461: ignored_devices_.erase(current); On 2016/04/22 22:21:24, Reilly Grant wrote: > We ...
4 years, 8 months ago (2016-04-26 19:26:45 UTC) #13
Reilly Grant (use Gerrit)
lgtm
4 years, 7 months ago (2016-04-27 21:48:25 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1903933002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1903933002/80001
4 years, 7 months ago (2016-04-27 22:22:51 UTC) #16
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 7 months ago (2016-04-27 23:32:41 UTC) #18
commit-bot: I haz the power
4 years, 7 months ago (2016-04-30 17:14:26 UTC) #19
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/d23f2ba75f50575513dcbde328c6041e4d47716c
Cr-Commit-Position: refs/heads/master@{#390234}

Powered by Google App Engine
This is Rietveld 408576698