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

Unified Diff: ios/chrome/browser/ios_chrome_main_parts.mm

Issue 2569863003: Move SetupMetrics() to PreMainMessageLoopRun (Closed)
Patch Set: 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: ios/chrome/browser/ios_chrome_main_parts.mm
diff --git a/ios/chrome/browser/ios_chrome_main_parts.mm b/ios/chrome/browser/ios_chrome_main_parts.mm
index 722cad2bed9daa63425805ca552ac0badeaa4cec..e295f9fa993fc7daba857985cef140772b162181 100644
--- a/ios/chrome/browser/ios_chrome_main_parts.mm
+++ b/ios/chrome/browser/ios_chrome_main_parts.mm
@@ -132,8 +132,6 @@ void IOSChromeMainParts::PreCreateThreads() {
// 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.
@@ -141,7 +139,6 @@ void IOSChromeMainParts::PreCreateThreads() {
// shutdown call may also need to be moved.
task_scheduler_util::InitializeDefaultBrowserTaskScheduler();
- SetupMetrics();
// Initialize FieldTrialSynchronizer system.
field_trial_synchronizer_.reset(new ios::FieldTrialSynchronizer);
@@ -150,6 +147,10 @@ void IOSChromeMainParts::PreCreateThreads() {
}
void IOSChromeMainParts::PreMainMessageLoopRun() {
+ // This must occur at PreMainMessageLoopRun because |SetupMetrics()| uses the
+ // blocking pool, which is disabled until the CreateThreads phase of startup.
+ SetupMetrics();
+
// Now that the file thread has been started, start recording.
StartMetricsRecording();
« 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