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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 message_center::MessageCenter::Initialize(); | 190 message_center::MessageCenter::Initialize(); |
191 } | 191 } |
192 | 192 |
193 BrowserProcessImpl::~BrowserProcessImpl() { | 193 BrowserProcessImpl::~BrowserProcessImpl() { |
194 tracked_objects::ThreadData::EnsureCleanupWasCalled(4); | 194 tracked_objects::ThreadData::EnsureCleanupWasCalled(4); |
195 | 195 |
196 g_browser_process = NULL; | 196 g_browser_process = NULL; |
197 } | 197 } |
198 | 198 |
199 void BrowserProcessImpl::StartTearDown() { | 199 void BrowserProcessImpl::StartTearDown() { |
| 200 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown"); |
200 #if defined(ENABLE_AUTOMATION) | 201 #if defined(ENABLE_AUTOMATION) |
201 // Delete the AutomationProviderList before NotificationService, | 202 // Delete the AutomationProviderList before NotificationService, |
202 // since it may try to unregister notifications | 203 // since it may try to unregister notifications |
203 // Both NotificationService and AutomationProvider are singleton instances in | 204 // Both NotificationService and AutomationProvider are singleton instances in |
204 // the BrowserProcess. Since AutomationProvider may have some active | 205 // the BrowserProcess. Since AutomationProvider may have some active |
205 // notification observers, it is essential that it gets destroyed before the | 206 // notification observers, it is essential that it gets destroyed before the |
206 // NotificationService. NotificationService won't be destroyed until after | 207 // NotificationService. NotificationService won't be destroyed until after |
207 // this destructor is run. | 208 // this destructor is run. |
208 automation_provider_list_.reset(); | 209 automation_provider_list_.reset(); |
209 #endif | 210 #endif |
(...skipping 18 matching lines...) Expand all Loading... |
228 if (safe_browsing_service_.get()) | 229 if (safe_browsing_service_.get()) |
229 safe_browsing_service()->ShutDown(); | 230 safe_browsing_service()->ShutDown(); |
230 #endif | 231 #endif |
231 | 232 |
232 // Need to clear the desktop notification balloons before the io_thread_ and | 233 // Need to clear the desktop notification balloons before the io_thread_ and |
233 // before the profiles, since if there are any still showing we will access | 234 // before the profiles, since if there are any still showing we will access |
234 // those things during teardown. | 235 // those things during teardown. |
235 notification_ui_manager_.reset(); | 236 notification_ui_manager_.reset(); |
236 | 237 |
237 // Need to clear profiles (download managers) before the io_thread_. | 238 // Need to clear profiles (download managers) before the io_thread_. |
238 profile_manager_.reset(); | 239 { |
| 240 TRACE_EVENT0("shutdown", |
| 241 "BrowserProcessImpl::StartTearDown:ProfileManager"); |
| 242 profile_manager_.reset(); |
| 243 } |
239 | 244 |
240 #if !defined(OS_ANDROID) | 245 #if !defined(OS_ANDROID) |
241 // Debugger must be cleaned up before IO thread and NotificationService. | 246 // Debugger must be cleaned up before IO thread and NotificationService. |
242 remote_debugging_server_.reset(); | 247 remote_debugging_server_.reset(); |
243 #endif | 248 #endif |
244 | 249 |
245 ExtensionRendererState::GetInstance()->Shutdown(); | 250 ExtensionRendererState::GetInstance()->Shutdown(); |
246 | 251 |
247 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 252 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
248 media_file_system_registry_.reset(); | 253 media_file_system_registry_.reset(); |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 } | 1061 } |
1057 | 1062 |
1058 void BrowserProcessImpl::OnAutoupdateTimer() { | 1063 void BrowserProcessImpl::OnAutoupdateTimer() { |
1059 if (CanAutorestartForUpdate()) { | 1064 if (CanAutorestartForUpdate()) { |
1060 DLOG(WARNING) << "Detected update. Restarting browser."; | 1065 DLOG(WARNING) << "Detected update. Restarting browser."; |
1061 RestartBackgroundInstance(); | 1066 RestartBackgroundInstance(); |
1062 } | 1067 } |
1063 } | 1068 } |
1064 | 1069 |
1065 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1070 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |