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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 2514373003: Move SetupMetrics() to PreMainMessageLoopRun (Closed)
Patch Set: Created 4 years, 1 month 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 d418834126caf5e42a8ca5db409f325f9226017c..6f93d94041265ad4317dfbddde14c1a32a96f502 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.
browser_process_->PreCreateThreads();
@@ -1415,6 +1411,11 @@ 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 won't be redirected until the CreateThreads phase
fdoray 2016/11/22 18:21:15 , which is disabled until the ...
robliao 2016/11/22 20:39:59 Done.
+ // 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