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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 | 778 |
779 prerender::PrerenderTracker* BrowserProcessImpl::prerender_tracker() { | 779 prerender::PrerenderTracker* BrowserProcessImpl::prerender_tracker() { |
780 if (!prerender_tracker_.get()) | 780 if (!prerender_tracker_.get()) |
781 prerender_tracker_.reset(new prerender::PrerenderTracker); | 781 prerender_tracker_.reset(new prerender::PrerenderTracker); |
782 | 782 |
783 return prerender_tracker_.get(); | 783 return prerender_tracker_.get(); |
784 } | 784 } |
785 | 785 |
786 ComponentUpdateService* BrowserProcessImpl::component_updater() { | 786 ComponentUpdateService* BrowserProcessImpl::component_updater() { |
787 if (!component_updater_.get()) { | 787 if (!component_updater_.get()) { |
| 788 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) |
| 789 return NULL; |
788 ComponentUpdateService::Configurator* configurator = | 790 ComponentUpdateService::Configurator* configurator = |
789 MakeChromeComponentUpdaterConfigurator( | 791 MakeChromeComponentUpdaterConfigurator( |
790 CommandLine::ForCurrentProcess(), | 792 CommandLine::ForCurrentProcess(), |
791 io_thread()->system_url_request_context_getter()); | 793 io_thread()->system_url_request_context_getter()); |
792 // Creating the component updater does not do anything, components | 794 // Creating the component updater does not do anything, components |
793 // need to be registered and Start() needs to be called. | 795 // need to be registered and Start() needs to be called. |
794 component_updater_.reset(ComponentUpdateServiceFactory(configurator)); | 796 component_updater_.reset(ComponentUpdateServiceFactory(configurator)); |
795 } | 797 } |
796 return component_updater_.get(); | 798 return component_updater_.get(); |
797 } | 799 } |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 } | 1075 } |
1074 | 1076 |
1075 void BrowserProcessImpl::OnAutoupdateTimer() { | 1077 void BrowserProcessImpl::OnAutoupdateTimer() { |
1076 if (CanAutorestartForUpdate()) { | 1078 if (CanAutorestartForUpdate()) { |
1077 DLOG(WARNING) << "Detected update. Restarting browser."; | 1079 DLOG(WARNING) << "Detected update. Restarting browser."; |
1078 RestartBackgroundInstance(); | 1080 RestartBackgroundInstance(); |
1079 } | 1081 } |
1080 } | 1082 } |
1081 | 1083 |
1082 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1084 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |