| 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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 } | 885 } |
| 886 | 886 |
| 887 component_updater::ComponentUpdateService* | 887 component_updater::ComponentUpdateService* |
| 888 BrowserProcessImpl::component_updater() { | 888 BrowserProcessImpl::component_updater() { |
| 889 if (!component_updater_.get()) { | 889 if (!component_updater_.get()) { |
| 890 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) | 890 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) |
| 891 return NULL; | 891 return NULL; |
| 892 scoped_refptr<update_client::Configurator> configurator = | 892 scoped_refptr<update_client::Configurator> configurator = |
| 893 component_updater::MakeChromeComponentUpdaterConfigurator( | 893 component_updater::MakeChromeComponentUpdaterConfigurator( |
| 894 base::CommandLine::ForCurrentProcess(), | 894 base::CommandLine::ForCurrentProcess(), |
| 895 io_thread()->system_url_request_context_getter()); | 895 io_thread()->system_url_request_context_getter(), |
| 896 g_browser_process->local_state()); |
| 896 // Creating the component updater does not do anything, components | 897 // Creating the component updater does not do anything, components |
| 897 // need to be registered and Start() needs to be called. | 898 // need to be registered and Start() needs to be called. |
| 898 component_updater_.reset(component_updater::ComponentUpdateServiceFactory( | 899 component_updater_.reset(component_updater::ComponentUpdateServiceFactory( |
| 899 configurator).release()); | 900 configurator).release()); |
| 900 } | 901 } |
| 901 return component_updater_.get(); | 902 return component_updater_.get(); |
| 902 } | 903 } |
| 903 | 904 |
| 904 CRLSetFetcher* BrowserProcessImpl::crl_set_fetcher() { | 905 CRLSetFetcher* BrowserProcessImpl::crl_set_fetcher() { |
| 905 if (!crl_set_fetcher_) | 906 if (!crl_set_fetcher_) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 ApplyAllowCrossOriginAuthPromptPolicy(); | 946 ApplyAllowCrossOriginAuthPromptPolicy(); |
| 946 } | 947 } |
| 947 | 948 |
| 948 void BrowserProcessImpl::OnKeepAliveStateChanged(bool is_keeping_alive) { | 949 void BrowserProcessImpl::OnKeepAliveStateChanged(bool is_keeping_alive) { |
| 949 if (is_keeping_alive) | 950 if (is_keeping_alive) |
| 950 Pin(); | 951 Pin(); |
| 951 else | 952 else |
| 952 Unpin(); | 953 Unpin(); |
| 953 } | 954 } |
| 954 | 955 |
| 955 void BrowserProcessImpl::OnKeepAliveRestartStateChanged(bool can_restart){ | 956 void BrowserProcessImpl::OnKeepAliveRestartStateChanged(bool can_restart) {} |
| 956 } | |
| 957 | 957 |
| 958 void BrowserProcessImpl::CreateWatchdogThread() { | 958 void BrowserProcessImpl::CreateWatchdogThread() { |
| 959 DCHECK(!created_watchdog_thread_ && !watchdog_thread_); | 959 DCHECK(!created_watchdog_thread_ && !watchdog_thread_); |
| 960 created_watchdog_thread_ = true; | 960 created_watchdog_thread_ = true; |
| 961 | 961 |
| 962 std::unique_ptr<WatchDogThread> thread(new WatchDogThread()); | 962 std::unique_ptr<WatchDogThread> thread(new WatchDogThread()); |
| 963 base::Thread::Options options; | 963 base::Thread::Options options; |
| 964 options.timer_slack = base::TIMER_SLACK_MAXIMUM; | 964 options.timer_slack = base::TIMER_SLACK_MAXIMUM; |
| 965 if (!thread->StartWithOptions(options)) | 965 if (!thread->StartWithOptions(options)) |
| 966 return; | 966 return; |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 } | 1337 } |
| 1338 | 1338 |
| 1339 void BrowserProcessImpl::OnAutoupdateTimer() { | 1339 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1340 if (CanAutorestartForUpdate()) { | 1340 if (CanAutorestartForUpdate()) { |
| 1341 DLOG(WARNING) << "Detected update. Restarting browser."; | 1341 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1342 RestartBackgroundInstance(); | 1342 RestartBackgroundInstance(); |
| 1343 } | 1343 } |
| 1344 } | 1344 } |
| 1345 | 1345 |
| 1346 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1346 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |