Chromium Code Reviews| 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 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 882 &BrowserProcessImpl::OnAutoupdateTimer); | 882 &BrowserProcessImpl::OnAutoupdateTimer); |
| 883 } | 883 } |
| 884 #endif | 884 #endif |
| 885 | 885 |
| 886 net_log::ChromeNetLog* BrowserProcessImpl::net_log() { | 886 net_log::ChromeNetLog* BrowserProcessImpl::net_log() { |
| 887 return net_log_.get(); | 887 return net_log_.get(); |
| 888 } | 888 } |
| 889 | 889 |
| 890 component_updater::ComponentUpdateService* | 890 component_updater::ComponentUpdateService* |
| 891 BrowserProcessImpl::component_updater() { | 891 BrowserProcessImpl::component_updater() { |
| 892 if (!component_updater_.get()) { | 892 if (component_updater_) |
| 893 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) | 893 return component_updater_.get(); |
| 894 return NULL; | 894 |
| 895 scoped_refptr<update_client::Configurator> configurator = | 895 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) |
|
sky
2016/09/14 18:11:00
I'm a bit confused by this check being only in the
| |
| 896 component_updater::MakeChromeComponentUpdaterConfigurator( | 896 return nullptr; |
| 897 base::CommandLine::ForCurrentProcess(), | 897 |
| 898 io_thread()->system_url_request_context_getter(), | 898 component_updater_ = component_updater::ComponentUpdateServiceFactory( |
| 899 g_browser_process->local_state()); | 899 component_updater::MakeChromeComponentUpdaterConfigurator( |
| 900 // Creating the component updater does not do anything, components | 900 base::CommandLine::ForCurrentProcess(), |
| 901 // need to be registered and Start() needs to be called. | 901 io_thread()->system_url_request_context_getter(), |
| 902 component_updater_.reset(component_updater::ComponentUpdateServiceFactory( | 902 g_browser_process->local_state())); |
| 903 configurator).release()); | 903 |
| 904 } | |
| 905 return component_updater_.get(); | 904 return component_updater_.get(); |
| 906 } | 905 } |
| 907 | 906 |
| 908 CRLSetFetcher* BrowserProcessImpl::crl_set_fetcher() { | 907 CRLSetFetcher* BrowserProcessImpl::crl_set_fetcher() { |
| 909 if (!crl_set_fetcher_) | 908 if (!crl_set_fetcher_) |
| 910 crl_set_fetcher_ = new CRLSetFetcher(); | 909 crl_set_fetcher_ = new CRLSetFetcher(); |
| 911 return crl_set_fetcher_.get(); | 910 return crl_set_fetcher_.get(); |
| 912 } | 911 } |
| 913 | 912 |
| 914 component_updater::PnaclComponentInstaller* | 913 component_updater::PnaclComponentInstaller* |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1346 } | 1345 } |
| 1347 | 1346 |
| 1348 void BrowserProcessImpl::OnAutoupdateTimer() { | 1347 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1349 if (CanAutorestartForUpdate()) { | 1348 if (CanAutorestartForUpdate()) { |
| 1350 DLOG(WARNING) << "Detected update. Restarting browser."; | 1349 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1351 RestartBackgroundInstance(); | 1350 RestartBackgroundInstance(); |
| 1352 } | 1351 } |
| 1353 } | 1352 } |
| 1354 | 1353 |
| 1355 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1354 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |