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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 2514373003: Move SetupMetrics() to PreMainMessageLoopRun (Closed)
Patch Set: Rebase https://crrev.com/2517363002 Created 4 years 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 | no next file » | 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 9caaf4124250991d1c91b5228c3198feda141e74..9fd4dcf3891a09d4b684b036169f1c9c5a7ebd46 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -1211,8 +1211,6 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
// Task Scheduler initialization needs to be here for the following reasons:
// * After |SetupFieldTrials()|: Initialization uses variations.
- // * Before |SetupMetrics()|: |SetupMetrics()| uses the blocking pool. The
- // Task Scheduler must do any necessary redirection before then.
// * Near the end of |PreCreateThreads()|: The TaskScheduler needs to be
// created before any other threads are (by contract) but it creates
// threads itself so instantiating it earlier is also incorrect.
@@ -1220,8 +1218,6 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
// shutdown call may also need to be moved.
task_scheduler_util::InitializeDefaultBrowserTaskScheduler();
- SetupMetrics();
-
// ChromeOS needs ResourceBundle::InitSharedInstance to be called before this.
// This also instantiates the IOThread which requests the metrics service and
// must be after |SetupMetrics()|.
@@ -1417,6 +1413,10 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
SCOPED_UMA_HISTOGRAM_LONG_TIMER("Startup.PreMainMessageLoopRunImplLongTime");
const base::TimeTicks start_time_step1 = base::TimeTicks::Now();
+ // This must occur at PreMainMessageLoopRun because |SetupMetrics()| uses the
+ // blocking pool, which is disabled until the CreateThreads phase of startup.
+ SetupMetrics();
+
#if defined(OS_WIN)
// Windows parental controls calls can be slow, so we do an early init here
// that calculates this value off of the UI thread.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698