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

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

Issue 14017013: Initialize CrosSettings before SetupMetrics (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »
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 <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 #elif defined(OS_MACOSX) 109 #elif defined(OS_MACOSX)
110 #include "chrome/browser/chrome_browser_main_mac.h" 110 #include "chrome/browser/chrome_browser_main_mac.h"
111 #endif 111 #endif
112 112
113 #if defined(USE_AURA) 113 #if defined(USE_AURA)
114 #include "ui/aura/env.h" 114 #include "ui/aura/env.h"
115 #endif 115 #endif
116 116
117 #if defined(OS_CHROMEOS) 117 #if defined(OS_CHROMEOS)
118 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" 118 #include "chrome/browser/chromeos/memory/oom_priority_manager.h"
119 #include "chrome/browser/chromeos/settings/cros_settings.h"
120 #endif // defined(OS_CHROMEOS) 119 #endif // defined(OS_CHROMEOS)
121 120
122 #if defined(ENABLE_PLUGIN_INSTALLATION) 121 #if defined(ENABLE_PLUGIN_INSTALLATION)
123 #include "chrome/browser/plugins/plugins_resource_service.h" 122 #include "chrome/browser/plugins/plugins_resource_service.h"
124 #endif 123 #endif
125 124
126 #if defined(OS_MACOSX) 125 #if defined(OS_MACOSX)
127 #include "apps/app_shim/app_shim_host_manager_mac.h" 126 #include "apps/app_shim/app_shim_host_manager_mac.h"
128 #endif 127 #endif
129 128
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 197
199 #if defined(ENABLE_MESSAGE_CENTER) 198 #if defined(ENABLE_MESSAGE_CENTER)
200 message_center::MessageCenter::Initialize(); 199 message_center::MessageCenter::Initialize();
201 #endif 200 #endif
202 } 201 }
203 202
204 BrowserProcessImpl::~BrowserProcessImpl() { 203 BrowserProcessImpl::~BrowserProcessImpl() {
205 tracked_objects::ThreadData::EnsureCleanupWasCalled(4); 204 tracked_objects::ThreadData::EnsureCleanupWasCalled(4);
206 205
207 g_browser_process = NULL; 206 g_browser_process = NULL;
208
209 #if defined(OS_CHROMEOS)
210 // Initialized in PreCreateThreards()
211 chromeos::CrosSettings::Shutdown();
212 #endif
213 } 207 }
214 208
215 void BrowserProcessImpl::StartTearDown() { 209 void BrowserProcessImpl::StartTearDown() {
216 #if defined(ENABLE_AUTOMATION) 210 #if defined(ENABLE_AUTOMATION)
217 // Delete the AutomationProviderList before NotificationService, 211 // Delete the AutomationProviderList before NotificationService,
218 // since it may try to unregister notifications 212 // since it may try to unregister notifications
219 // Both NotificationService and AutomationProvider are singleton instances in 213 // Both NotificationService and AutomationProvider are singleton instances in
220 // the BrowserProcess. Since AutomationProvider may have some active 214 // the BrowserProcess. Since AutomationProvider may have some active
221 // notification observers, it is essential that it gets destroyed before the 215 // notification observers, it is essential that it gets destroyed before the
222 // NotificationService. NotificationService won't be destroyed until after 216 // NotificationService. NotificationService won't be destroyed until after
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 net::HttpNetworkSession::NORMAL_SOCKET_POOL))); 845 net::HttpNetworkSession::NORMAL_SOCKET_POOL)));
852 846
853 pref_change_registrar_.Add( 847 pref_change_registrar_.Add(
854 prefs::kDisabledSchemes, 848 prefs::kDisabledSchemes,
855 base::Bind(&BrowserProcessImpl::ApplyDisabledSchemesPolicy, 849 base::Bind(&BrowserProcessImpl::ApplyDisabledSchemesPolicy,
856 base::Unretained(this))); 850 base::Unretained(this)));
857 ApplyDisabledSchemesPolicy(); 851 ApplyDisabledSchemesPolicy();
858 } 852 }
859 853
860 void BrowserProcessImpl::PreCreateThreads() { 854 void BrowserProcessImpl::PreCreateThreads() {
861 #if defined(OS_CHROMEOS)
862 chromeos::CrosSettings::Initialize();
863 #endif
864 io_thread_.reset(new IOThread(local_state(), policy_service(), net_log_.get(), 855 io_thread_.reset(new IOThread(local_state(), policy_service(), net_log_.get(),
865 extension_event_router_forwarder_.get())); 856 extension_event_router_forwarder_.get()));
866 } 857 }
867 858
868 void BrowserProcessImpl::PreMainMessageLoopRun() { 859 void BrowserProcessImpl::PreMainMessageLoopRun() {
869 #if defined(ENABLE_CONFIGURATION_POLICY) 860 #if defined(ENABLE_CONFIGURATION_POLICY)
870 // browser_policy_connector() is created very early because local_state() 861 // browser_policy_connector() is created very early because local_state()
871 // needs policy to be initialized with the managed preference values. 862 // needs policy to be initialized with the managed preference values.
872 // However, policy fetches from the network and loading of disk caches 863 // However, policy fetches from the network and loading of disk caches
873 // requires that threads are running; this Init() call lets the connector 864 // requires that threads are running; this Init() call lets the connector
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 } 1051 }
1061 1052
1062 void BrowserProcessImpl::OnAutoupdateTimer() { 1053 void BrowserProcessImpl::OnAutoupdateTimer() {
1063 if (CanAutorestartForUpdate()) { 1054 if (CanAutorestartForUpdate()) {
1064 DLOG(WARNING) << "Detected update. Restarting browser."; 1055 DLOG(WARNING) << "Detected update. Restarting browser.";
1065 RestartBackgroundInstance(); 1056 RestartBackgroundInstance();
1066 } 1057 }
1067 } 1058 }
1068 1059
1069 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1060 #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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698