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

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

Issue 298063006: Make SdchManager per-profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove whitespace before asterix. Created 6 years, 6 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "chrome/browser/gpu/gpu_mode_manager.h" 42 #include "chrome/browser/gpu/gpu_mode_manager.h"
43 #include "chrome/browser/icon_manager.h" 43 #include "chrome/browser/icon_manager.h"
44 #include "chrome/browser/idle.h" 44 #include "chrome/browser/idle.h"
45 #include "chrome/browser/intranet_redirect_detector.h" 45 #include "chrome/browser/intranet_redirect_detector.h"
46 #include "chrome/browser/io_thread.h" 46 #include "chrome/browser/io_thread.h"
47 #include "chrome/browser/lifetime/application_lifetime.h" 47 #include "chrome/browser/lifetime/application_lifetime.h"
48 #include "chrome/browser/metrics/metrics_services_manager.h" 48 #include "chrome/browser/metrics/metrics_services_manager.h"
49 #include "chrome/browser/metrics/thread_watcher.h" 49 #include "chrome/browser/metrics/thread_watcher.h"
50 #include "chrome/browser/net/chrome_net_log.h" 50 #include "chrome/browser/net/chrome_net_log.h"
51 #include "chrome/browser/net/crl_set_fetcher.h" 51 #include "chrome/browser/net/crl_set_fetcher.h"
52 #include "chrome/browser/net/sdch_dictionary_fetcher.h" 52 #include "chrome/browser/net/sdch_dictionary_fetcher.h"
sky 2014/06/12 17:06:22 If you can, remove this include.
Randy Smith (Not in Mondays) 2014/06/12 18:06:39 Ah, thanks for catching this. Done.
53 #include "chrome/browser/notifications/notification_ui_manager.h" 53 #include "chrome/browser/notifications/notification_ui_manager.h"
54 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" 54 #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
55 #include "chrome/browser/plugins/plugin_finder.h" 55 #include "chrome/browser/plugins/plugin_finder.h"
56 #include "chrome/browser/prefs/browser_prefs.h" 56 #include "chrome/browser/prefs/browser_prefs.h"
57 #include "chrome/browser/prefs/chrome_pref_service_factory.h" 57 #include "chrome/browser/prefs/chrome_pref_service_factory.h"
58 #include "chrome/browser/prerender/prerender_tracker.h" 58 #include "chrome/browser/prerender/prerender_tracker.h"
59 #include "chrome/browser/printing/background_printing_manager.h" 59 #include "chrome/browser/printing/background_printing_manager.h"
60 #include "chrome/browser/printing/print_job_manager.h" 60 #include "chrome/browser/printing/print_job_manager.h"
61 #include "chrome/browser/printing/print_preview_dialog_controller.h" 61 #include "chrome/browser/printing/print_preview_dialog_controller.h"
62 #include "chrome/browser/profiles/profile_manager.h" 62 #include "chrome/browser/profiles/profile_manager.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 211 }
212 212
213 BrowserProcessImpl::~BrowserProcessImpl() { 213 BrowserProcessImpl::~BrowserProcessImpl() {
214 tracked_objects::ThreadData::EnsureCleanupWasCalled(4); 214 tracked_objects::ThreadData::EnsureCleanupWasCalled(4);
215 215
216 g_browser_process = NULL; 216 g_browser_process = NULL;
217 } 217 }
218 218
219 void BrowserProcessImpl::StartTearDown() { 219 void BrowserProcessImpl::StartTearDown() {
220 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown"); 220 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown");
221 // We need to shutdown the SdchDictionaryFetcher as it regularly holds
222 // a pointer to a URLFetcher, and that URLFetcher (upon destruction) will do
223 // a PostDelayedTask onto the IO thread. This shutdown call will both discard
224 // any pending URLFetchers, and avoid creating any more.
225 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
226 base::Bind(&SdchDictionaryFetcher::Shutdown));
227
228 // We need to destroy the MetricsServicesManager, IntranetRedirectDetector, 221 // We need to destroy the MetricsServicesManager, IntranetRedirectDetector,
229 // PromoResourceService, and SafeBrowsing ClientSideDetectionService (owned by 222 // PromoResourceService, and SafeBrowsing ClientSideDetectionService (owned by
230 // the SafeBrowsingService) before the io_thread_ gets destroyed, since their 223 // the SafeBrowsingService) before the io_thread_ gets destroyed, since their
231 // destructors can call the URLFetcher destructor, which does a 224 // destructors can call the URLFetcher destructor, which does a
232 // 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
233 // URLFetcher operation before going away.) 226 // URLFetcher operation before going away.)
234 metrics_services_manager_.reset(); 227 metrics_services_manager_.reset();
235 intranet_redirect_detector_.reset(); 228 intranet_redirect_detector_.reset();
236 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) 229 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING)
237 if (safe_browsing_service_.get()) 230 if (safe_browsing_service_.get())
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 } 1108 }
1116 1109
1117 void BrowserProcessImpl::OnAutoupdateTimer() { 1110 void BrowserProcessImpl::OnAutoupdateTimer() {
1118 if (CanAutorestartForUpdate()) { 1111 if (CanAutorestartForUpdate()) {
1119 DLOG(WARNING) << "Detected update. Restarting browser."; 1112 DLOG(WARNING) << "Detected update. Restarting browser.";
1120 RestartBackgroundInstance(); 1113 RestartBackgroundInstance();
1121 } 1114 }
1122 } 1115 }
1123 1116
1124 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1117 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/io_thread.cc » ('j') | chrome/browser/profiles/profile_impl_io_data.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698