| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 return net_log_.get(); | 792 return net_log_.get(); |
| 793 } | 793 } |
| 794 | 794 |
| 795 prerender::PrerenderTracker* BrowserProcessImpl::prerender_tracker() { | 795 prerender::PrerenderTracker* BrowserProcessImpl::prerender_tracker() { |
| 796 if (!prerender_tracker_.get()) | 796 if (!prerender_tracker_.get()) |
| 797 prerender_tracker_.reset(new prerender::PrerenderTracker); | 797 prerender_tracker_.reset(new prerender::PrerenderTracker); |
| 798 | 798 |
| 799 return prerender_tracker_.get(); | 799 return prerender_tracker_.get(); |
| 800 } | 800 } |
| 801 | 801 |
| 802 ComponentUpdateService* BrowserProcessImpl::component_updater() { | 802 component_updater::ComponentUpdateService* |
| 803 BrowserProcessImpl::component_updater() { |
| 803 if (!component_updater_.get()) { | 804 if (!component_updater_.get()) { |
| 804 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) | 805 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) |
| 805 return NULL; | 806 return NULL; |
| 806 ComponentUpdateService::Configurator* configurator = | 807 component_updater::ComponentUpdateService::Configurator* configurator = |
| 807 MakeChromeComponentUpdaterConfigurator( | 808 component_updater::MakeChromeComponentUpdaterConfigurator( |
| 808 CommandLine::ForCurrentProcess(), | 809 CommandLine::ForCurrentProcess(), |
| 809 io_thread()->system_url_request_context_getter()); | 810 io_thread()->system_url_request_context_getter()); |
| 810 // Creating the component updater does not do anything, components | 811 // Creating the component updater does not do anything, components |
| 811 // need to be registered and Start() needs to be called. | 812 // need to be registered and Start() needs to be called. |
| 812 component_updater_.reset(ComponentUpdateServiceFactory(configurator)); | 813 component_updater_.reset(ComponentUpdateServiceFactory(configurator)); |
| 813 } | 814 } |
| 814 return component_updater_.get(); | 815 return component_updater_.get(); |
| 815 } | 816 } |
| 816 | 817 |
| 817 CRLSetFetcher* BrowserProcessImpl::crl_set_fetcher() { | 818 CRLSetFetcher* BrowserProcessImpl::crl_set_fetcher() { |
| 818 if (!crl_set_fetcher_.get()) | 819 if (!crl_set_fetcher_.get()) |
| 819 crl_set_fetcher_ = new CRLSetFetcher(); | 820 crl_set_fetcher_ = new CRLSetFetcher(); |
| 820 return crl_set_fetcher_.get(); | 821 return crl_set_fetcher_.get(); |
| 821 } | 822 } |
| 822 | 823 |
| 823 PnaclComponentInstaller* BrowserProcessImpl::pnacl_component_installer() { | 824 component_updater::PnaclComponentInstaller* |
| 824 if (!pnacl_component_installer_.get()) | 825 BrowserProcessImpl::pnacl_component_installer() { |
| 825 pnacl_component_installer_.reset(new PnaclComponentInstaller()); | 826 if (!pnacl_component_installer_.get()) { |
| 827 pnacl_component_installer_.reset( |
| 828 new component_updater::PnaclComponentInstaller()); |
| 829 } |
| 826 return pnacl_component_installer_.get(); | 830 return pnacl_component_installer_.get(); |
| 827 } | 831 } |
| 828 | 832 |
| 829 void BrowserProcessImpl::ResourceDispatcherHostCreated() { | 833 void BrowserProcessImpl::ResourceDispatcherHostCreated() { |
| 830 resource_dispatcher_host_delegate_.reset( | 834 resource_dispatcher_host_delegate_.reset( |
| 831 new ChromeResourceDispatcherHostDelegate(prerender_tracker())); | 835 new ChromeResourceDispatcherHostDelegate(prerender_tracker())); |
| 832 ResourceDispatcherHost::Get()->SetDelegate( | 836 ResourceDispatcherHost::Get()->SetDelegate( |
| 833 resource_dispatcher_host_delegate_.get()); | 837 resource_dispatcher_host_delegate_.get()); |
| 834 | 838 |
| 835 pref_change_registrar_.Add( | 839 pref_change_registrar_.Add( |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 } | 1118 } |
| 1115 | 1119 |
| 1116 void BrowserProcessImpl::OnAutoupdateTimer() { | 1120 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1117 if (CanAutorestartForUpdate()) { | 1121 if (CanAutorestartForUpdate()) { |
| 1118 DLOG(WARNING) << "Detected update. Restarting browser."; | 1122 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1119 RestartBackgroundInstance(); | 1123 RestartBackgroundInstance(); |
| 1120 } | 1124 } |
| 1121 } | 1125 } |
| 1122 | 1126 |
| 1123 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1127 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |