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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 void BrowserProcessImpl::StartTearDown() { | 219 void BrowserProcessImpl::StartTearDown() { |
220 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown"); | 220 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown"); |
221 // We need to destroy the MetricsServicesManager, IntranetRedirectDetector, | 221 // We need to destroy the MetricsServicesManager, IntranetRedirectDetector, |
222 // PromoResourceService, and SafeBrowsing ClientSideDetectionService (owned by | 222 // PromoResourceService, and SafeBrowsing ClientSideDetectionService (owned by |
223 // the SafeBrowsingService) before the io_thread_ gets destroyed, since their | 223 // the SafeBrowsingService) before the io_thread_ gets destroyed, since their |
224 // destructors can call the URLFetcher destructor, which does a | 224 // destructors can call the URLFetcher destructor, which does a |
225 // PostDelayedTask operation on the IO thread. (The IO thread will handle that | 225 // PostDelayedTask operation on the IO thread. (The IO thread will handle that |
226 // URLFetcher operation before going away.) | 226 // URLFetcher operation before going away.) |
227 metrics_services_manager_.reset(); | 227 metrics_services_manager_.reset(); |
228 intranet_redirect_detector_.reset(); | 228 intranet_redirect_detector_.reset(); |
229 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | 229 #if defined(SAFE_BROWSING_SERVICE) |
230 if (safe_browsing_service_.get()) | 230 if (safe_browsing_service_.get()) |
231 safe_browsing_service()->ShutDown(); | 231 safe_browsing_service()->ShutDown(); |
232 #endif | 232 #endif |
233 | 233 |
234 // Need to clear the desktop notification balloons before the io_thread_ and | 234 // Need to clear the desktop notification balloons before the io_thread_ and |
235 // before the profiles, since if there are any still showing we will access | 235 // before the profiles, since if there are any still showing we will access |
236 // those things during teardown. | 236 // those things during teardown. |
237 notification_ui_manager_.reset(); | 237 notification_ui_manager_.reset(); |
238 | 238 |
239 // Need to clear profiles (download managers) before the io_thread_. | 239 // Need to clear profiles (download managers) before the io_thread_. |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 #else | 1065 #else |
1066 NOTIMPLEMENTED(); | 1066 NOTIMPLEMENTED(); |
1067 #endif | 1067 #endif |
1068 } | 1068 } |
1069 | 1069 |
1070 void BrowserProcessImpl::CreateSafeBrowsingService() { | 1070 void BrowserProcessImpl::CreateSafeBrowsingService() { |
1071 DCHECK(safe_browsing_service_.get() == NULL); | 1071 DCHECK(safe_browsing_service_.get() == NULL); |
1072 // Set this flag to true so that we don't retry indefinitely to | 1072 // Set this flag to true so that we don't retry indefinitely to |
1073 // create the service class if there was an error. | 1073 // create the service class if there was an error. |
1074 created_safe_browsing_service_ = true; | 1074 created_safe_browsing_service_ = true; |
1075 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | 1075 #if defined(SAFE_BROWSING_SERVICE) |
1076 safe_browsing_service_ = SafeBrowsingService::CreateSafeBrowsingService(); | 1076 safe_browsing_service_ = SafeBrowsingService::CreateSafeBrowsingService(); |
1077 safe_browsing_service_->Initialize(); | 1077 safe_browsing_service_->Initialize(); |
1078 #endif | 1078 #endif |
1079 } | 1079 } |
1080 | 1080 |
1081 void BrowserProcessImpl::CreateGCMDriver() { | 1081 void BrowserProcessImpl::CreateGCMDriver() { |
1082 DCHECK(!gcm_driver_); | 1082 DCHECK(!gcm_driver_); |
1083 | 1083 |
1084 #if defined(OS_ANDROID) | 1084 #if defined(OS_ANDROID) |
1085 gcm_driver_.reset(new gcm::GCMDriverAndroid); | 1085 gcm_driver_.reset(new gcm::GCMDriverAndroid); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1171 } | 1171 } |
1172 | 1172 |
1173 void BrowserProcessImpl::OnAutoupdateTimer() { | 1173 void BrowserProcessImpl::OnAutoupdateTimer() { |
1174 if (CanAutorestartForUpdate()) { | 1174 if (CanAutorestartForUpdate()) { |
1175 DLOG(WARNING) << "Detected update. Restarting browser."; | 1175 DLOG(WARNING) << "Detected update. Restarting browser."; |
1176 RestartBackgroundInstance(); | 1176 RestartBackgroundInstance(); |
1177 } | 1177 } |
1178 } | 1178 } |
1179 | 1179 |
1180 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1180 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |