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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 2295023002: Delay WebUSB initialization until after browser startup. (Closed)
Patch Set: Add UMA for WebUSB detector initialization time. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/usb/web_usb_detector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 725fdaaffea19beb8f14b7af36ceaf3c281f0cbb..b0c796b245c569450dbddfe3c1f7a76baf9c8a99 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -1532,8 +1532,13 @@ void ChromeBrowserMainParts::PostBrowserStart() {
#endif // defined(ENABLE_WEBRTC)
#if !defined(OS_ANDROID)
- if (base::FeatureList::IsEnabled(features::kWebUsb))
+ if (base::FeatureList::IsEnabled(features::kWebUsb)) {
web_usb_detector_.reset(new WebUsbDetector());
+ BrowserThread::PostAfterStartupTask(
+ FROM_HERE, BrowserThread::GetTaskRunnerForThread(BrowserThread::UI),
+ base::Bind(&WebUsbDetector::Initialize,
+ base::Unretained(web_usb_detector_.get())));
+ }
#endif
// At this point, StartupBrowserCreator::Start has run creating initial
« no previous file with comments | « no previous file | chrome/browser/usb/web_usb_detector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698