Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: chrome/browser/browser_process_impl.cc

Issue 397853002: Refactor safe-browsing build-config definitions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup gn files Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 #else 1089 #else
1090 NOTIMPLEMENTED(); 1090 NOTIMPLEMENTED();
1091 #endif 1091 #endif
1092 } 1092 }
1093 1093
1094 void BrowserProcessImpl::CreateSafeBrowsingService() { 1094 void BrowserProcessImpl::CreateSafeBrowsingService() {
1095 DCHECK(safe_browsing_service_.get() == NULL); 1095 DCHECK(safe_browsing_service_.get() == NULL);
1096 // Set this flag to true so that we don't retry indefinitely to 1096 // Set this flag to true so that we don't retry indefinitely to
1097 // create the service class if there was an error. 1097 // create the service class if there was an error.
1098 created_safe_browsing_service_ = true; 1098 created_safe_browsing_service_ = true;
1099 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) 1099 #if defined(SAFE_BROWSING_SERVICE)
1100 safe_browsing_service_ = SafeBrowsingService::CreateSafeBrowsingService(); 1100 safe_browsing_service_ = SafeBrowsingService::CreateSafeBrowsingService();
1101 safe_browsing_service_->Initialize(); 1101 safe_browsing_service_->Initialize();
1102 #endif 1102 #endif
1103 } 1103 }
1104 1104
1105 void BrowserProcessImpl::CreateGCMDriver() { 1105 void BrowserProcessImpl::CreateGCMDriver() {
1106 DCHECK(!gcm_driver_); 1106 DCHECK(!gcm_driver_);
1107 1107
1108 #if defined(OS_ANDROID) 1108 #if defined(OS_ANDROID)
1109 gcm_driver_.reset(new gcm::GCMDriverAndroid); 1109 gcm_driver_.reset(new gcm::GCMDriverAndroid);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 } 1195 }
1196 1196
1197 void BrowserProcessImpl::OnAutoupdateTimer() { 1197 void BrowserProcessImpl::OnAutoupdateTimer() {
1198 if (CanAutorestartForUpdate()) { 1198 if (CanAutorestartForUpdate()) {
1199 DLOG(WARNING) << "Detected update. Restarting browser."; 1199 DLOG(WARNING) << "Detected update. Restarting browser.";
1200 RestartBackgroundInstance(); 1200 RestartBackgroundInstance();
1201 } 1201 }
1202 } 1202 }
1203 1203
1204 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1204 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698