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

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

Issue 6298004: Fix a possible crash in the ClientSideDetectionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <map> 7 #include <map>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // NotificationService. NotificationService won't be destroyed until after 139 // NotificationService. NotificationService won't be destroyed until after
140 // this destructor is run. 140 // this destructor is run.
141 automation_provider_list_.reset(); 141 automation_provider_list_.reset();
142 142
143 // We need to shutdown the SdchDictionaryFetcher as it regularly holds 143 // We need to shutdown the SdchDictionaryFetcher as it regularly holds
144 // a pointer to a URLFetcher, and that URLFetcher (upon destruction) will do 144 // a pointer to a URLFetcher, and that URLFetcher (upon destruction) will do
145 // a PostDelayedTask onto the IO thread. This shutdown call will both discard 145 // a PostDelayedTask onto the IO thread. This shutdown call will both discard
146 // any pending URLFetchers, and avoid creating any more. 146 // any pending URLFetchers, and avoid creating any more.
147 SdchDictionaryFetcher::Shutdown(); 147 SdchDictionaryFetcher::Shutdown();
148 148
149 // We need to destroy the MetricsService, GoogleURLTracker, and 149 // We need to destroy the MetricsService, GoogleURLTracker,
150 // IntranetRedirectDetector before the io_thread_ gets destroyed, since their 150 // IntranetRedirectDetector, and SafeBrowsing ClientSideDetectionService
151 // destructors can call the URLFetcher destructor, which does a 151 // before the io_thread_ gets destroyed, since their destructors can call the
152 // PostDelayedTask operation on the IO thread. (The IO thread will handle 152 // URLFetcher destructor, which does a PostDelayedTask operation on the IO
153 // that URLFetcher operation before going away.) 153 // thread. (The IO thread will handle that URLFetcher operation before going
154 // away.)
154 metrics_service_.reset(); 155 metrics_service_.reset();
155 google_url_tracker_.reset(); 156 google_url_tracker_.reset();
156 intranet_redirect_detector_.reset(); 157 intranet_redirect_detector_.reset();
158 safe_browsing_detection_service_.reset();
157 159
158 // Need to clear the desktop notification balloons before the io_thread_ and 160 // Need to clear the desktop notification balloons before the io_thread_ and
159 // before the profiles, since if there are any still showing we will access 161 // before the profiles, since if there are any still showing we will access
160 // those things during teardown. 162 // those things during teardown.
161 notification_ui_manager_.reset(); 163 notification_ui_manager_.reset();
162 164
163 // Need to clear profiles (download managers) before the io_thread_. 165 // Need to clear profiles (download managers) before the io_thread_.
164 profile_manager_.reset(); 166 profile_manager_.reset();
165 167
166 // Debugger must be cleaned up before IO thread and NotificationService. 168 // Debugger must be cleaned up before IO thread and NotificationService.
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 } 918 }
917 919
918 void BrowserProcessImpl::OnAutoupdateTimer() { 920 void BrowserProcessImpl::OnAutoupdateTimer() {
919 if (CanAutorestartForUpdate()) { 921 if (CanAutorestartForUpdate()) {
920 DLOG(WARNING) << "Detected update. Restarting browser."; 922 DLOG(WARNING) << "Detected update. Restarting browser.";
921 RestartPersistentInstance(); 923 RestartPersistentInstance();
922 } 924 }
923 } 925 }
924 926
925 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 927 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698