| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 void BrowserProcessImpl::StartTearDown() { | 234 void BrowserProcessImpl::StartTearDown() { |
| 235 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown"); | 235 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown"); |
| 236 // We need to destroy the MetricsServicesManager, IntranetRedirectDetector, | 236 // We need to destroy the MetricsServicesManager, IntranetRedirectDetector, |
| 237 // PromoResourceService, and SafeBrowsing ClientSideDetectionService (owned by | 237 // PromoResourceService, and SafeBrowsing ClientSideDetectionService (owned by |
| 238 // the SafeBrowsingService) before the io_thread_ gets destroyed, since their | 238 // the SafeBrowsingService) before the io_thread_ gets destroyed, since their |
| 239 // destructors can call the URLFetcher destructor, which does a | 239 // destructors can call the URLFetcher destructor, which does a |
| 240 // PostDelayedTask operation on the IO thread. (The IO thread will handle that | 240 // PostDelayedTask operation on the IO thread. (The IO thread will handle that |
| 241 // URLFetcher operation before going away.) | 241 // URLFetcher operation before going away.) |
| 242 metrics_services_manager_.reset(); | 242 metrics_services_manager_.reset(); |
| 243 intranet_redirect_detector_.reset(); | 243 intranet_redirect_detector_.reset(); |
| 244 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | 244 #if defined(SAFE_BROWSING_SERVICE) |
| 245 if (safe_browsing_service_.get()) | 245 if (safe_browsing_service_.get()) |
| 246 safe_browsing_service()->ShutDown(); | 246 safe_browsing_service()->ShutDown(); |
| 247 #endif | 247 #endif |
| 248 #if defined(ENABLE_PLUGIN_INSTALLATION) | 248 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 249 plugins_resource_service_.reset(); | 249 plugins_resource_service_.reset(); |
| 250 #endif | 250 #endif |
| 251 | 251 |
| 252 // Need to clear the desktop notification balloons before the io_thread_ and | 252 // Need to clear the desktop notification balloons before the io_thread_ and |
| 253 // before the profiles, since if there are any still showing we will access | 253 // before the profiles, since if there are any still showing we will access |
| 254 // those things during teardown. | 254 // those things during teardown. |
| (...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1116 #else | 1116 #else |
| 1117 NOTIMPLEMENTED(); | 1117 NOTIMPLEMENTED(); |
| 1118 #endif | 1118 #endif |
| 1119 } | 1119 } |
| 1120 | 1120 |
| 1121 void BrowserProcessImpl::CreateSafeBrowsingService() { | 1121 void BrowserProcessImpl::CreateSafeBrowsingService() { |
| 1122 DCHECK(safe_browsing_service_.get() == NULL); | 1122 DCHECK(safe_browsing_service_.get() == NULL); |
| 1123 // Set this flag to true so that we don't retry indefinitely to | 1123 // Set this flag to true so that we don't retry indefinitely to |
| 1124 // create the service class if there was an error. | 1124 // create the service class if there was an error. |
| 1125 created_safe_browsing_service_ = true; | 1125 created_safe_browsing_service_ = true; |
| 1126 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | 1126 #if defined(SAFE_BROWSING_SERVICE) |
| 1127 safe_browsing_service_ = SafeBrowsingService::CreateSafeBrowsingService(); | 1127 safe_browsing_service_ = SafeBrowsingService::CreateSafeBrowsingService(); |
| 1128 safe_browsing_service_->Initialize(); | 1128 safe_browsing_service_->Initialize(); |
| 1129 #endif | 1129 #endif |
| 1130 } | 1130 } |
| 1131 | 1131 |
| 1132 void BrowserProcessImpl::CreateGCMDriver() { | 1132 void BrowserProcessImpl::CreateGCMDriver() { |
| 1133 DCHECK(!gcm_driver_); | 1133 DCHECK(!gcm_driver_); |
| 1134 | 1134 |
| 1135 #if defined(OS_ANDROID) | 1135 #if defined(OS_ANDROID) |
| 1136 // Android's GCMDriver currently makes the assumption that it's a singleton. | 1136 // Android's GCMDriver currently makes the assumption that it's a singleton. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1224 } | 1224 } |
| 1225 | 1225 |
| 1226 void BrowserProcessImpl::OnAutoupdateTimer() { | 1226 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1227 if (CanAutorestartForUpdate()) { | 1227 if (CanAutorestartForUpdate()) { |
| 1228 DLOG(WARNING) << "Detected update. Restarting browser."; | 1228 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1229 RestartBackgroundInstance(); | 1229 RestartBackgroundInstance(); |
| 1230 } | 1230 } |
| 1231 } | 1231 } |
| 1232 | 1232 |
| 1233 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1233 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |