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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 void BrowserProcessImpl::StartTearDown() { | 220 void BrowserProcessImpl::StartTearDown() { |
221 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown"); | 221 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown"); |
222 // We need to destroy the MetricsServicesManager, IntranetRedirectDetector, | 222 // We need to destroy the MetricsServicesManager, IntranetRedirectDetector, |
223 // PromoResourceService, and SafeBrowsing ClientSideDetectionService (owned by | 223 // PromoResourceService, and SafeBrowsing ClientSideDetectionService (owned by |
224 // the SafeBrowsingService) before the io_thread_ gets destroyed, since their | 224 // the SafeBrowsingService) before the io_thread_ gets destroyed, since their |
225 // destructors can call the URLFetcher destructor, which does a | 225 // destructors can call the URLFetcher destructor, which does a |
226 // PostDelayedTask operation on the IO thread. (The IO thread will handle that | 226 // PostDelayedTask operation on the IO thread. (The IO thread will handle that |
227 // URLFetcher operation before going away.) | 227 // URLFetcher operation before going away.) |
228 metrics_services_manager_.reset(); | 228 metrics_services_manager_.reset(); |
229 intranet_redirect_detector_.reset(); | 229 intranet_redirect_detector_.reset(); |
230 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | 230 #if defined(SAFE_BROWSING_SERVICE) |
231 if (safe_browsing_service_.get()) | 231 if (safe_browsing_service_.get()) |
232 safe_browsing_service()->ShutDown(); | 232 safe_browsing_service()->ShutDown(); |
233 #endif | 233 #endif |
234 | 234 |
235 // Need to clear the desktop notification balloons before the io_thread_ and | 235 // Need to clear the desktop notification balloons before the io_thread_ and |
236 // before the profiles, since if there are any still showing we will access | 236 // before the profiles, since if there are any still showing we will access |
237 // those things during teardown. | 237 // those things during teardown. |
238 notification_ui_manager_.reset(); | 238 notification_ui_manager_.reset(); |
239 | 239 |
240 // Need to clear profiles (download managers) before the io_thread_. | 240 // Need to clear profiles (download managers) before the io_thread_. |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 #else | 1095 #else |
1096 NOTIMPLEMENTED(); | 1096 NOTIMPLEMENTED(); |
1097 #endif | 1097 #endif |
1098 } | 1098 } |
1099 | 1099 |
1100 void BrowserProcessImpl::CreateSafeBrowsingService() { | 1100 void BrowserProcessImpl::CreateSafeBrowsingService() { |
1101 DCHECK(safe_browsing_service_.get() == NULL); | 1101 DCHECK(safe_browsing_service_.get() == NULL); |
1102 // Set this flag to true so that we don't retry indefinitely to | 1102 // Set this flag to true so that we don't retry indefinitely to |
1103 // create the service class if there was an error. | 1103 // create the service class if there was an error. |
1104 created_safe_browsing_service_ = true; | 1104 created_safe_browsing_service_ = true; |
1105 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | 1105 #if defined(SAFE_BROWSING_SERVICE) |
1106 safe_browsing_service_ = SafeBrowsingService::CreateSafeBrowsingService(); | 1106 safe_browsing_service_ = SafeBrowsingService::CreateSafeBrowsingService(); |
1107 safe_browsing_service_->Initialize(); | 1107 safe_browsing_service_->Initialize(); |
1108 #endif | 1108 #endif |
1109 } | 1109 } |
1110 | 1110 |
1111 void BrowserProcessImpl::CreateGCMDriver() { | 1111 void BrowserProcessImpl::CreateGCMDriver() { |
1112 DCHECK(!gcm_driver_); | 1112 DCHECK(!gcm_driver_); |
1113 | 1113 |
1114 #if defined(OS_ANDROID) | 1114 #if defined(OS_ANDROID) |
1115 gcm_driver_.reset(new gcm::GCMDriverAndroid); | 1115 gcm_driver_.reset(new gcm::GCMDriverAndroid); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 } | 1201 } |
1202 | 1202 |
1203 void BrowserProcessImpl::OnAutoupdateTimer() { | 1203 void BrowserProcessImpl::OnAutoupdateTimer() { |
1204 if (CanAutorestartForUpdate()) { | 1204 if (CanAutorestartForUpdate()) { |
1205 DLOG(WARNING) << "Detected update. Restarting browser."; | 1205 DLOG(WARNING) << "Detected update. Restarting browser."; |
1206 RestartBackgroundInstance(); | 1206 RestartBackgroundInstance(); |
1207 } | 1207 } |
1208 } | 1208 } |
1209 | 1209 |
1210 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1210 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |