Commit 89875894 authored by Nicholas Verne's avatar Nicholas Verne Committed by Commit Bot

crostini: Delay the CrosUsbDetector ConnectToDeviceManager call.

DeviceManager isn't necessarily ready to be used straight away. It
should be ready after PostBrowserStart returns.

Bug: 1129735
Change-Id: I9b65ab48a3b442bf2803a0337354b8fefaab38d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2530962Reviewed-by: default avatarTimothy Loh <timloh@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Auto-Submit: Nicholas Verne <nverne@chromium.org>
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826293}
parent 4e8008c0
...@@ -1082,7 +1082,10 @@ void ChromeBrowserMainPartsChromeos::PostBrowserStart() { ...@@ -1082,7 +1082,10 @@ void ChromeBrowserMainPartsChromeos::PostBrowserStart() {
// Enable Chrome OS USB detection. // Enable Chrome OS USB detection.
cros_usb_detector_ = std::make_unique<CrosUsbDetector>(); cros_usb_detector_ = std::make_unique<CrosUsbDetector>();
cros_usb_detector_->ConnectToDeviceManager(); content::GetUIThreadTaskRunner({base::TaskPriority::BEST_EFFORT})
->PostTask(FROM_HERE,
base::BindOnce(&CrosUsbDetector::ConnectToDeviceManager,
base::Unretained(cros_usb_detector_.get())));
crostini_unsupported_action_notifier_ = crostini_unsupported_action_notifier_ =
std::make_unique<crostini::CrostiniUnsupportedActionNotifier>(); std::make_unique<crostini::CrostiniUnsupportedActionNotifier>();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment