OLD | NEW |
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 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // the BrowserProcess. Since AutomationProvider may have some active | 177 // the BrowserProcess. Since AutomationProvider may have some active |
178 // notification observers, it is essential that it gets destroyed before the | 178 // notification observers, it is essential that it gets destroyed before the |
179 // NotificationService. NotificationService won't be destroyed until after | 179 // NotificationService. NotificationService won't be destroyed until after |
180 // this destructor is run. | 180 // this destructor is run. |
181 automation_provider_list_.reset(); | 181 automation_provider_list_.reset(); |
182 | 182 |
183 // We need to shutdown the SdchDictionaryFetcher as it regularly holds | 183 // We need to shutdown the SdchDictionaryFetcher as it regularly holds |
184 // a pointer to a URLFetcher, and that URLFetcher (upon destruction) will do | 184 // a pointer to a URLFetcher, and that URLFetcher (upon destruction) will do |
185 // a PostDelayedTask onto the IO thread. This shutdown call will both discard | 185 // a PostDelayedTask onto the IO thread. This shutdown call will both discard |
186 // any pending URLFetchers, and avoid creating any more. | 186 // any pending URLFetchers, and avoid creating any more. |
187 SdchDictionaryFetcher::Shutdown(); | 187 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 188 base::Bind(&SdchDictionaryFetcher::Shutdown)); |
188 | 189 |
189 // We need to destroy the MetricsService, GoogleURLTracker, | 190 // We need to destroy the MetricsService, GoogleURLTracker, |
190 // IntranetRedirectDetector, and SafeBrowsing ClientSideDetectionService | 191 // IntranetRedirectDetector, and SafeBrowsing ClientSideDetectionService |
191 // (owned by the SafeBrowsingService) before the io_thread_ gets destroyed, | 192 // (owned by the SafeBrowsingService) before the io_thread_ gets destroyed, |
192 // since their destructors can call the URLFetcher destructor, which does a | 193 // since their destructors can call the URLFetcher destructor, which does a |
193 // PostDelayedTask operation on the IO thread. | 194 // PostDelayedTask operation on the IO thread. |
194 // (The IO thread will handle that URLFetcher operation before going away.) | 195 // (The IO thread will handle that URLFetcher operation before going away.) |
195 metrics_service_.reset(); | 196 metrics_service_.reset(); |
196 google_url_tracker_.reset(); | 197 google_url_tracker_.reset(); |
197 intranet_redirect_detector_.reset(); | 198 intranet_redirect_detector_.reset(); |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 } | 1009 } |
1009 | 1010 |
1010 void BrowserProcessImpl::OnAutoupdateTimer() { | 1011 void BrowserProcessImpl::OnAutoupdateTimer() { |
1011 if (CanAutorestartForUpdate()) { | 1012 if (CanAutorestartForUpdate()) { |
1012 DLOG(WARNING) << "Detected update. Restarting browser."; | 1013 DLOG(WARNING) << "Detected update. Restarting browser."; |
1013 RestartBackgroundInstance(); | 1014 RestartBackgroundInstance(); |
1014 } | 1015 } |
1015 } | 1016 } |
1016 | 1017 |
1017 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1018 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |