OLD | NEW |
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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 } | 261 } |
262 | 262 |
263 #if !defined(OS_ANDROID) | 263 #if !defined(OS_ANDROID) |
264 void BrowserProcessImpl::StartTearDown() { | 264 void BrowserProcessImpl::StartTearDown() { |
265 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown"); | 265 TRACE_EVENT0("shutdown", "BrowserProcessImpl::StartTearDown"); |
266 // TODO(crbug.com/560486): Fix the tests that make the check of | 266 // TODO(crbug.com/560486): Fix the tests that make the check of |
267 // |tearing_down_| necessary in IsShuttingDown(). | 267 // |tearing_down_| necessary in IsShuttingDown(). |
268 tearing_down_ = true; | 268 tearing_down_ = true; |
269 DCHECK(IsShuttingDown()); | 269 DCHECK(IsShuttingDown()); |
270 // We need to destroy the MetricsServicesManager, IntranetRedirectDetector, | 270 // We need to destroy the MetricsServicesManager, IntranetRedirectDetector, |
271 // PromoResourceService, and SafeBrowsing ClientSideDetectionService (owned by | 271 // PromoResourceService, NetworkTimeTracker, and SafeBrowsing |
272 // the SafeBrowsingService) before the io_thread_ gets destroyed, since their | 272 // ClientSideDetectionService (owned by the SafeBrowsingService) before the |
273 // destructors can call the URLFetcher destructor, which does a | 273 // io_thread_ gets destroyed, since their destructors can call the URLFetcher |
274 // PostDelayedTask operation on the IO thread. (The IO thread will handle that | 274 // destructor, which does a PostDelayedTask operation on the IO thread. (The |
275 // URLFetcher operation before going away.) | 275 // IO thread will handle that URLFetcher operation before going away.) |
276 metrics_services_manager_.reset(); | 276 metrics_services_manager_.reset(); |
277 intranet_redirect_detector_.reset(); | 277 intranet_redirect_detector_.reset(); |
278 if (safe_browsing_service_.get()) | 278 if (safe_browsing_service_.get()) |
279 safe_browsing_service()->ShutDown(); | 279 safe_browsing_service()->ShutDown(); |
| 280 network_time_tracker_.reset(); |
280 #if defined(ENABLE_PLUGIN_INSTALLATION) | 281 #if defined(ENABLE_PLUGIN_INSTALLATION) |
281 plugins_resource_service_.reset(); | 282 plugins_resource_service_.reset(); |
282 #endif | 283 #endif |
283 | 284 |
284 // Need to clear the desktop notification balloons before the io_thread_ and | 285 // Need to clear the desktop notification balloons before the io_thread_ and |
285 // before the profiles, since if there are any still showing we will access | 286 // before the profiles, since if there are any still showing we will access |
286 // those things during teardown. | 287 // those things during teardown. |
287 notification_ui_manager_.reset(); | 288 notification_ui_manager_.reset(); |
288 | 289 |
289 // The SupervisedUserWhitelistInstaller observes the ProfileAttributesStorage, | 290 // The SupervisedUserWhitelistInstaller observes the ProfileAttributesStorage, |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 if (!webrtc_log_uploader_.get()) | 741 if (!webrtc_log_uploader_.get()) |
741 webrtc_log_uploader_.reset(new WebRtcLogUploader()); | 742 webrtc_log_uploader_.reset(new WebRtcLogUploader()); |
742 return webrtc_log_uploader_.get(); | 743 return webrtc_log_uploader_.get(); |
743 } | 744 } |
744 #endif | 745 #endif |
745 | 746 |
746 network_time::NetworkTimeTracker* BrowserProcessImpl::network_time_tracker() { | 747 network_time::NetworkTimeTracker* BrowserProcessImpl::network_time_tracker() { |
747 if (!network_time_tracker_) { | 748 if (!network_time_tracker_) { |
748 network_time_tracker_.reset(new network_time::NetworkTimeTracker( | 749 network_time_tracker_.reset(new network_time::NetworkTimeTracker( |
749 base::WrapUnique(new base::DefaultClock()), | 750 base::WrapUnique(new base::DefaultClock()), |
750 base::WrapUnique(new base::DefaultTickClock()), local_state())); | 751 base::WrapUnique(new base::DefaultTickClock()), local_state(), |
| 752 system_request_context())); |
751 } | 753 } |
752 return network_time_tracker_.get(); | 754 return network_time_tracker_.get(); |
753 } | 755 } |
754 | 756 |
755 gcm::GCMDriver* BrowserProcessImpl::gcm_driver() { | 757 gcm::GCMDriver* BrowserProcessImpl::gcm_driver() { |
756 DCHECK(CalledOnValidThread()); | 758 DCHECK(CalledOnValidThread()); |
757 if (!gcm_driver_) | 759 if (!gcm_driver_) |
758 CreateGCMDriver(); | 760 CreateGCMDriver(); |
759 return gcm_driver_.get(); | 761 return gcm_driver_.get(); |
760 } | 762 } |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 } | 1313 } |
1312 | 1314 |
1313 void BrowserProcessImpl::OnAutoupdateTimer() { | 1315 void BrowserProcessImpl::OnAutoupdateTimer() { |
1314 if (CanAutorestartForUpdate()) { | 1316 if (CanAutorestartForUpdate()) { |
1315 DLOG(WARNING) << "Detected update. Restarting browser."; | 1317 DLOG(WARNING) << "Detected update. Restarting browser."; |
1316 RestartBackgroundInstance(); | 1318 RestartBackgroundInstance(); |
1317 } | 1319 } |
1318 } | 1320 } |
1319 | 1321 |
1320 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1322 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |