| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 void BrowserProcessImpl::StartTearDown() { | 251 void BrowserProcessImpl::StartTearDown() { |
| 252 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown"); | 252 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown"); |
| 253 // We need to destroy the MetricsServicesManager, IntranetRedirectDetector, | 253 // We need to destroy the MetricsServicesManager, IntranetRedirectDetector, |
| 254 // PromoResourceService, and SafeBrowsing ClientSideDetectionService (owned by | 254 // PromoResourceService, and SafeBrowsing ClientSideDetectionService (owned by |
| 255 // the SafeBrowsingService) before the io_thread_ gets destroyed, since their | 255 // the SafeBrowsingService) before the io_thread_ gets destroyed, since their |
| 256 // destructors can call the URLFetcher destructor, which does a | 256 // destructors can call the URLFetcher destructor, which does a |
| 257 // PostDelayedTask operation on the IO thread. (The IO thread will handle that | 257 // PostDelayedTask operation on the IO thread. (The IO thread will handle that |
| 258 // URLFetcher operation before going away.) | 258 // URLFetcher operation before going away.) |
| 259 metrics_services_manager_.reset(); | 259 metrics_services_manager_.reset(); |
| 260 intranet_redirect_detector_.reset(); | 260 intranet_redirect_detector_.reset(); |
| 261 #if defined(SAFE_BROWSING_SERVICE) | |
| 262 if (safe_browsing_service_.get()) | 261 if (safe_browsing_service_.get()) |
| 263 safe_browsing_service()->ShutDown(); | 262 safe_browsing_service()->ShutDown(); |
| 264 #endif | |
| 265 #if defined(ENABLE_PLUGIN_INSTALLATION) | 263 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 266 plugins_resource_service_.reset(); | 264 plugins_resource_service_.reset(); |
| 267 #endif | 265 #endif |
| 268 | 266 |
| 269 // Need to clear the desktop notification balloons before the io_thread_ and | 267 // Need to clear the desktop notification balloons before the io_thread_ and |
| 270 // before the profiles, since if there are any still showing we will access | 268 // before the profiles, since if there are any still showing we will access |
| 271 // those things during teardown. | 269 // those things during teardown. |
| 272 notification_ui_manager_.reset(); | 270 notification_ui_manager_.reset(); |
| 273 | 271 |
| 274 // The SupervisedUserWhitelistInstaller observes the ProfileInfoCache, so it | 272 // The SupervisedUserWhitelistInstaller observes the ProfileInfoCache, so it |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 #else | 1150 #else |
| 1153 NOTIMPLEMENTED(); | 1151 NOTIMPLEMENTED(); |
| 1154 #endif | 1152 #endif |
| 1155 } | 1153 } |
| 1156 | 1154 |
| 1157 void BrowserProcessImpl::CreateSafeBrowsingService() { | 1155 void BrowserProcessImpl::CreateSafeBrowsingService() { |
| 1158 DCHECK(safe_browsing_service_.get() == NULL); | 1156 DCHECK(safe_browsing_service_.get() == NULL); |
| 1159 // Set this flag to true so that we don't retry indefinitely to | 1157 // Set this flag to true so that we don't retry indefinitely to |
| 1160 // create the service class if there was an error. | 1158 // create the service class if there was an error. |
| 1161 created_safe_browsing_service_ = true; | 1159 created_safe_browsing_service_ = true; |
| 1162 #if defined(SAFE_BROWSING_SERVICE) | |
| 1163 safe_browsing_service_ = SafeBrowsingService::CreateSafeBrowsingService(); | 1160 safe_browsing_service_ = SafeBrowsingService::CreateSafeBrowsingService(); |
| 1164 safe_browsing_service_->Initialize(); | 1161 safe_browsing_service_->Initialize(); |
| 1165 #endif | |
| 1166 } | 1162 } |
| 1167 | 1163 |
| 1168 void BrowserProcessImpl::CreateGCMDriver() { | 1164 void BrowserProcessImpl::CreateGCMDriver() { |
| 1169 DCHECK(!gcm_driver_); | 1165 DCHECK(!gcm_driver_); |
| 1170 | 1166 |
| 1171 #if defined(OS_ANDROID) | 1167 #if defined(OS_ANDROID) |
| 1172 // Android's GCMDriver currently makes the assumption that it's a singleton. | 1168 // Android's GCMDriver currently makes the assumption that it's a singleton. |
| 1173 // Until this gets fixed, instantiating multiple Java GCMDrivers will throw | 1169 // Until this gets fixed, instantiating multiple Java GCMDrivers will throw |
| 1174 // an exception, but because they're only initialized on demand these crashes | 1170 // an exception, but because they're only initialized on demand these crashes |
| 1175 // would be very difficult to triage. See http://crbug.com/437827. | 1171 // would be very difficult to triage. See http://crbug.com/437827. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1281 } | 1277 } |
| 1282 | 1278 |
| 1283 void BrowserProcessImpl::OnAutoupdateTimer() { | 1279 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1284 if (CanAutorestartForUpdate()) { | 1280 if (CanAutorestartForUpdate()) { |
| 1285 DLOG(WARNING) << "Detected update. Restarting browser."; | 1281 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1286 RestartBackgroundInstance(); | 1282 RestartBackgroundInstance(); |
| 1287 } | 1283 } |
| 1288 } | 1284 } |
| 1289 | 1285 |
| 1290 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1286 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |