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

Side by Side Diff: chrome/browser/browser_process_impl.cc

Issue 2517363002: Decouple Metrics Initialization from IO Thread Initialization (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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main.cc » ('j') | chrome/browser/io_thread.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/browser_process_impl.h" 5 #include "chrome/browser/browser_process_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 io_thread_.reset( 1061 io_thread_.reset(
1062 new IOThread(local_state(), policy_service(), net_log_.get(), 1062 new IOThread(local_state(), policy_service(), net_log_.get(),
1063 extension_event_router_forwarder())); 1063 extension_event_router_forwarder()));
1064 } 1064 }
1065 1065
1066 void BrowserProcessImpl::PreMainMessageLoopRun() { 1066 void BrowserProcessImpl::PreMainMessageLoopRun() {
1067 TRACE_EVENT0("startup", "BrowserProcessImpl::PreMainMessageLoopRun"); 1067 TRACE_EVENT0("startup", "BrowserProcessImpl::PreMainMessageLoopRun");
1068 SCOPED_UMA_HISTOGRAM_TIMER( 1068 SCOPED_UMA_HISTOGRAM_TIMER(
1069 "Startup.BrowserProcessImpl_PreMainMessageLoopRunTime"); 1069 "Startup.BrowserProcessImpl_PreMainMessageLoopRunTime");
1070 1070
1071 // At this stage of startup, metrics should be good to go and we can
1072 // initialize the metrics data use forwarder on the IO thread state object.
1073 io_thread()->InitMetricsDataUseForwarder();
1074
1071 // browser_policy_connector() is created very early because local_state() 1075 // browser_policy_connector() is created very early because local_state()
1072 // needs policy to be initialized with the managed preference values. 1076 // needs policy to be initialized with the managed preference values.
1073 // However, policy fetches from the network and loading of disk caches 1077 // However, policy fetches from the network and loading of disk caches
1074 // requires that threads are running; this Init() call lets the connector 1078 // requires that threads are running; this Init() call lets the connector
1075 // resume its initialization now that the loops are spinning and the 1079 // resume its initialization now that the loops are spinning and the
1076 // system request context is available for the fetchers. 1080 // system request context is available for the fetchers.
1077 browser_policy_connector()->Init(local_state(), system_request_context()); 1081 browser_policy_connector()->Init(local_state(), system_request_context());
1078 1082
1079 if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled)) 1083 if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled))
1080 ApplyDefaultBrowserPolicy(); 1084 ApplyDefaultBrowserPolicy();
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 } 1405 }
1402 1406
1403 void BrowserProcessImpl::OnAutoupdateTimer() { 1407 void BrowserProcessImpl::OnAutoupdateTimer() {
1404 if (CanAutorestartForUpdate()) { 1408 if (CanAutorestartForUpdate()) {
1405 DLOG(WARNING) << "Detected update. Restarting browser."; 1409 DLOG(WARNING) << "Detected update. Restarting browser.";
1406 RestartBackgroundInstance(); 1410 RestartBackgroundInstance();
1407 } 1411 }
1408 } 1412 }
1409 1413
1410 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1414 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main.cc » ('j') | chrome/browser/io_thread.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698