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

Issue 2557073004: Call libusb_init on the FILE thread. (Closed)

Created:
4 years ago by Reilly Grant (use Gerrit)
Modified:
4 years ago
Reviewers:
juncai
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Call libusb_init on the FILE thread. On some platforms this function creates an initial enumeration of devices which can cause jank when done on the UI thread. BUG=645583 Committed: https://crrev.com/20dbee333a778a90bd8966a7a5227d3cb4592e5d Cr-Commit-Position: refs/heads/master@{#437382}

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -48 lines) Patch
M device/usb/usb_context.h View 1 chunk +2 lines, -2 lines 0 comments Download
M device/usb/usb_service_impl.h View 2 chunks +3 lines, -0 lines 3 comments Download
M device/usb/usb_service_impl.cc View 5 chunks +60 lines, -46 lines 0 comments Download

Messages

Total messages: 15 (8 generated)
Reilly Grant (use Gerrit)
Please take a look.
4 years ago (2016-12-08 02:20:32 UTC) #4
juncai
LGTM. https://codereview.chromium.org/2557073004/diff/1/device/usb/usb_service_impl.h File device/usb/usb_service_impl.h (right): https://codereview.chromium.org/2557073004/diff/1/device/usb/usb_service_impl.h#newcode89 device/usb/usb_service_impl.h:89: bool usb_unavailable_ = false; nit: maybe change the ...
4 years ago (2016-12-08 20:00:40 UTC) #7
Reilly Grant (use Gerrit)
https://codereview.chromium.org/2557073004/diff/1/device/usb/usb_service_impl.h File device/usb/usb_service_impl.h (right): https://codereview.chromium.org/2557073004/diff/1/device/usb/usb_service_impl.h#newcode89 device/usb/usb_service_impl.h:89: bool usb_unavailable_ = false; On 2016/12/08 at 20:00:39, juncai ...
4 years ago (2016-12-08 22:44:39 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2557073004/1
4 years ago (2016-12-08 22:45:12 UTC) #10
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years ago (2016-12-08 22:52:36 UTC) #12
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/20dbee333a778a90bd8966a7a5227d3cb4592e5d Cr-Commit-Position: refs/heads/master@{#437382}
4 years ago (2016-12-08 22:55:21 UTC) #14
juncai
4 years ago (2016-12-08 23:02:11 UTC) #15
Message was sent while issue was closed.
https://codereview.chromium.org/2557073004/diff/1/device/usb/usb_service_impl.h
File device/usb/usb_service_impl.h (right):

https://codereview.chromium.org/2557073004/diff/1/device/usb/usb_service_impl...
device/usb/usb_service_impl.h:89: bool usb_unavailable_ = false;
On 2016/12/08 22:44:39, Reilly Grant wrote:
> On 2016/12/08 at 20:00:39, juncai wrote:
> > nit: maybe change the variable name to be:
> > bool usb_available_ = true;
> 
> The reason I named this usb_unavailable_ is because until we see if we can
> initialize context_ we don't know if USB will be available or not, so it
seemed
> less surprising to have a variable that becomes true only when we've given up
on
> initializing USB than a variable that it true before we've even tried.

I see. Thanks for the explanation.

Powered by Google App Engine
This is Rietveld 408576698