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

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: rebase to satiate trybots Created 6 years, 4 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 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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)
OLDNEW
« no previous file with comments | « chrome/browser/apps/ephemeral_app_launcher_browsertest.cc ('k') | chrome/browser/browsing_data/browsing_data_remover.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698