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

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: 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 191 }
192 192
193 BrowserProcessImpl::~BrowserProcessImpl() { 193 BrowserProcessImpl::~BrowserProcessImpl() {
194 tracked_objects::ThreadData::EnsureCleanupWasCalled(4); 194 tracked_objects::ThreadData::EnsureCleanupWasCalled(4);
195 195
196 g_browser_process = NULL; 196 g_browser_process = NULL;
197 } 197 }
198 198
199 void BrowserProcessImpl::StartTearDown() { 199 void BrowserProcessImpl::StartTearDown() {
200 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown"); 200 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown");
201 // We need to shutdown the SdchDictionaryFetcher as it regularly holds
202 // a pointer to a URLFetcher, and that URLFetcher (upon destruction) will do
203 // a PostDelayedTask onto the IO thread. This shutdown call will both discard
204 // any pending URLFetchers, and avoid creating any more.
205 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
206 base::Bind(&SdchDictionaryFetcher::Shutdown));
207
208 // We need to destroy the MetricsService, RapporService, VariationsService, 201 // We need to destroy the MetricsService, RapporService, VariationsService,
209 // IntranetRedirectDetector, PromoResourceService, and SafeBrowsing 202 // IntranetRedirectDetector, PromoResourceService, and SafeBrowsing
210 // ClientSideDetectionService (owned by the SafeBrowsingService) before the 203 // ClientSideDetectionService (owned by the SafeBrowsingService) before the
211 // io_thread_ gets destroyed, since their destructors can call the URLFetcher 204 // io_thread_ gets destroyed, since their destructors can call the URLFetcher
212 // destructor, which does a PostDelayedTask operation on the IO thread. (The 205 // destructor, which does a PostDelayedTask operation on the IO thread. (The
213 // IO thread will handle that URLFetcher operation before going away.) 206 // IO thread will handle that URLFetcher operation before going away.)
214 metrics_service_.reset(); 207 metrics_service_.reset();
215 rappor_service_.reset(); 208 rappor_service_.reset();
216 variations_service_.reset(); 209 variations_service_.reset();
217 intranet_redirect_detector_.reset(); 210 intranet_redirect_detector_.reset();
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 } 1045 }
1053 1046
1054 void BrowserProcessImpl::OnAutoupdateTimer() { 1047 void BrowserProcessImpl::OnAutoupdateTimer() {
1055 if (CanAutorestartForUpdate()) { 1048 if (CanAutorestartForUpdate()) {
1056 DLOG(WARNING) << "Detected update. Restarting browser."; 1049 DLOG(WARNING) << "Detected update. Restarting browser.";
1057 RestartBackgroundInstance(); 1050 RestartBackgroundInstance();
1058 } 1051 }
1059 } 1052 }
1060 1053
1061 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1054 #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/net/sdch_dictionary_fetcher.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698