OLD | NEW |
---|---|
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 Loading... | |
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" | |
119 #endif // defined(OS_CHROMEOS) | 120 #endif // defined(OS_CHROMEOS) |
120 | 121 |
121 #if defined(ENABLE_PLUGIN_INSTALLATION) | 122 #if defined(ENABLE_PLUGIN_INSTALLATION) |
122 #include "chrome/browser/plugins/plugins_resource_service.h" | 123 #include "chrome/browser/plugins/plugins_resource_service.h" |
123 #endif | 124 #endif |
124 | 125 |
125 #if defined(OS_MACOSX) | 126 #if defined(OS_MACOSX) |
126 #include "apps/app_shim/app_shim_host_manager_mac.h" | 127 #include "apps/app_shim/app_shim_host_manager_mac.h" |
127 #endif | 128 #endif |
128 | 129 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 | 198 |
198 #if defined(ENABLE_MESSAGE_CENTER) | 199 #if defined(ENABLE_MESSAGE_CENTER) |
199 message_center::MessageCenter::Initialize(); | 200 message_center::MessageCenter::Initialize(); |
200 #endif | 201 #endif |
201 } | 202 } |
202 | 203 |
203 BrowserProcessImpl::~BrowserProcessImpl() { | 204 BrowserProcessImpl::~BrowserProcessImpl() { |
204 tracked_objects::ThreadData::EnsureCleanupWasCalled(4); | 205 tracked_objects::ThreadData::EnsureCleanupWasCalled(4); |
205 | 206 |
206 g_browser_process = NULL; | 207 g_browser_process = NULL; |
208 | |
209 #if defined(OS_CHROMEOS) | |
210 // Initialized in PreCreateThreards() | |
211 chromeos::CrosSettings::Shutdown(); | |
212 #endif | |
207 } | 213 } |
208 | 214 |
209 void BrowserProcessImpl::StartTearDown() { | 215 void BrowserProcessImpl::StartTearDown() { |
210 #if defined(ENABLE_AUTOMATION) | 216 #if defined(ENABLE_AUTOMATION) |
211 // Delete the AutomationProviderList before NotificationService, | 217 // Delete the AutomationProviderList before NotificationService, |
212 // since it may try to unregister notifications | 218 // since it may try to unregister notifications |
213 // Both NotificationService and AutomationProvider are singleton instances in | 219 // Both NotificationService and AutomationProvider are singleton instances in |
214 // the BrowserProcess. Since AutomationProvider may have some active | 220 // the BrowserProcess. Since AutomationProvider may have some active |
215 // notification observers, it is essential that it gets destroyed before the | 221 // notification observers, it is essential that it gets destroyed before the |
216 // NotificationService. NotificationService won't be destroyed until after | 222 // NotificationService. NotificationService won't be destroyed until after |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
845 net::HttpNetworkSession::NORMAL_SOCKET_POOL))); | 851 net::HttpNetworkSession::NORMAL_SOCKET_POOL))); |
846 | 852 |
847 pref_change_registrar_.Add( | 853 pref_change_registrar_.Add( |
848 prefs::kDisabledSchemes, | 854 prefs::kDisabledSchemes, |
849 base::Bind(&BrowserProcessImpl::ApplyDisabledSchemesPolicy, | 855 base::Bind(&BrowserProcessImpl::ApplyDisabledSchemesPolicy, |
850 base::Unretained(this))); | 856 base::Unretained(this))); |
851 ApplyDisabledSchemesPolicy(); | 857 ApplyDisabledSchemesPolicy(); |
852 } | 858 } |
853 | 859 |
854 void BrowserProcessImpl::PreCreateThreads() { | 860 void BrowserProcessImpl::PreCreateThreads() { |
861 #if defined(OS_CHROMEOS) | |
862 chromeos::CrosSettings::Initialize(); | |
Mattias Nissler (ping if slow)
2013/04/16 16:09:51
Why is this not in chrome_browser_main_chromeos.cc
stevenjb
2013/04/16 16:49:43
new BrowserProcessImpl() and browser_process_->Pre
Mattias Nissler (ping if slow)
2013/04/16 18:04:13
Right, and IOThread initialization below immediate
| |
863 #endif | |
855 io_thread_.reset(new IOThread(local_state(), policy_service(), net_log_.get(), | 864 io_thread_.reset(new IOThread(local_state(), policy_service(), net_log_.get(), |
856 extension_event_router_forwarder_.get())); | 865 extension_event_router_forwarder_.get())); |
857 } | 866 } |
858 | 867 |
859 void BrowserProcessImpl::PreMainMessageLoopRun() { | 868 void BrowserProcessImpl::PreMainMessageLoopRun() { |
860 #if defined(ENABLE_CONFIGURATION_POLICY) | 869 #if defined(ENABLE_CONFIGURATION_POLICY) |
861 // browser_policy_connector() is created very early because local_state() | 870 // browser_policy_connector() is created very early because local_state() |
862 // needs policy to be initialized with the managed preference values. | 871 // needs policy to be initialized with the managed preference values. |
863 // However, policy fetches from the network and loading of disk caches | 872 // However, policy fetches from the network and loading of disk caches |
864 // requires that threads are running; this Init() call lets the connector | 873 // requires that threads are running; this Init() call lets the connector |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1051 } | 1060 } |
1052 | 1061 |
1053 void BrowserProcessImpl::OnAutoupdateTimer() { | 1062 void BrowserProcessImpl::OnAutoupdateTimer() { |
1054 if (CanAutorestartForUpdate()) { | 1063 if (CanAutorestartForUpdate()) { |
1055 DLOG(WARNING) << "Detected update. Restarting browser."; | 1064 DLOG(WARNING) << "Detected update. Restarting browser."; |
1056 RestartBackgroundInstance(); | 1065 RestartBackgroundInstance(); |
1057 } | 1066 } |
1058 } | 1067 } |
1059 | 1068 |
1060 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1069 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |