Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Side by Side Diff: chrome/browser/browser_process_impl.cc

Issue 13071002: Turn on component updater on chromeos, only for the pnacl component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: filepath Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/bind_helpers.h" 13 #include "base/bind_helpers.h"
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "base/debug/alias.h" 15 #include "base/debug/alias.h"
16 #include "base/file_util.h" 16 #include "base/file_util.h"
17 #include "base/path_service.h" 17 #include "base/path_service.h"
18 #include "base/prefs/json_pref_store.h" 18 #include "base/prefs/json_pref_store.h"
19 #include "base/prefs/pref_registry_simple.h" 19 #include "base/prefs/pref_registry_simple.h"
20 #include "base/prefs/pref_service.h" 20 #include "base/prefs/pref_service.h"
21 #include "base/synchronization/waitable_event.h" 21 #include "base/synchronization/waitable_event.h"
22 #include "base/threading/thread.h" 22 #include "base/threading/thread.h"
23 #include "base/threading/thread_restrictions.h" 23 #include "base/threading/thread_restrictions.h"
24 #include "chrome/browser/automation/automation_provider_list.h" 24 #include "chrome/browser/automation/automation_provider_list.h"
25 #include "chrome/browser/background/background_mode_manager.h" 25 #include "chrome/browser/background/background_mode_manager.h"
26 #include "chrome/browser/chrome_browser_main.h" 26 #include "chrome/browser/chrome_browser_main.h"
27 #include "chrome/browser/chrome_content_browser_client.h" 27 #include "chrome/browser/chrome_content_browser_client.h"
28 #include "chrome/browser/component_updater/component_updater_configurator.h" 28 #include "chrome/browser/component_updater/component_updater_configurator.h"
29 #include "chrome/browser/component_updater/component_updater_service.h" 29 #include "chrome/browser/component_updater/component_updater_service.h"
30 #include "chrome/browser/component_updater/pnacl/pnacl_component_installer.h"
30 #include "chrome/browser/defaults.h" 31 #include "chrome/browser/defaults.h"
31 #include "chrome/browser/devtools/remote_debugging_server.h" 32 #include "chrome/browser/devtools/remote_debugging_server.h"
32 #include "chrome/browser/download/download_request_limiter.h" 33 #include "chrome/browser/download/download_request_limiter.h"
33 #include "chrome/browser/download/download_status_updater.h" 34 #include "chrome/browser/download/download_status_updater.h"
34 #include "chrome/browser/extensions/event_router_forwarder.h" 35 #include "chrome/browser/extensions/event_router_forwarder.h"
35 #include "chrome/browser/extensions/extension_renderer_state.h" 36 #include "chrome/browser/extensions/extension_renderer_state.h"
36 #include "chrome/browser/first_run/upgrade_util.h" 37 #include "chrome/browser/first_run/upgrade_util.h"
37 #include "chrome/browser/gpu/gl_string_manager.h" 38 #include "chrome/browser/gpu/gl_string_manager.h"
38 #include "chrome/browser/gpu/gpu_mode_manager.h" 39 #include "chrome/browser/gpu/gpu_mode_manager.h"
39 #include "chrome/browser/icon_manager.h" 40 #include "chrome/browser/icon_manager.h"
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 } 734 }
734 735
735 prerender::PrerenderTracker* BrowserProcessImpl::prerender_tracker() { 736 prerender::PrerenderTracker* BrowserProcessImpl::prerender_tracker() {
736 if (!prerender_tracker_.get()) 737 if (!prerender_tracker_.get())
737 prerender_tracker_.reset(new prerender::PrerenderTracker); 738 prerender_tracker_.reset(new prerender::PrerenderTracker);
738 739
739 return prerender_tracker_.get(); 740 return prerender_tracker_.get();
740 } 741 }
741 742
742 ComponentUpdateService* BrowserProcessImpl::component_updater() { 743 ComponentUpdateService* BrowserProcessImpl::component_updater() {
743 #if defined(OS_CHROMEOS)
744 return NULL;
745 #else
746 if (!component_updater_.get()) { 744 if (!component_updater_.get()) {
747 ComponentUpdateService::Configurator* configurator = 745 ComponentUpdateService::Configurator* configurator =
748 MakeChromeComponentUpdaterConfigurator( 746 MakeChromeComponentUpdaterConfigurator(
749 CommandLine::ForCurrentProcess(), 747 CommandLine::ForCurrentProcess(),
750 io_thread()->system_url_request_context_getter()); 748 io_thread()->system_url_request_context_getter());
751 // Creating the component updater does not do anything, components 749 // Creating the component updater does not do anything, components
752 // need to be registered and Start() needs to be called. 750 // need to be registered and Start() needs to be called.
753 component_updater_.reset(ComponentUpdateServiceFactory(configurator)); 751 component_updater_.reset(ComponentUpdateServiceFactory(configurator));
754 } 752 }
755 return component_updater_.get(); 753 return component_updater_.get();
756 #endif
757 } 754 }
758 755
759 CRLSetFetcher* BrowserProcessImpl::crl_set_fetcher() { 756 CRLSetFetcher* BrowserProcessImpl::crl_set_fetcher() {
760 #if defined(OS_CHROMEOS) 757 #if defined(OS_CHROMEOS)
761 // There's no component updater on ChromeOS so there can't be a CRLSetFetcher 758 // There is component updater on ChromeOS, but it is only used when data
762 // either. 759 // is not shared between users. Currently not making a CRLSetFetcher
760 // component for ChromeOS.
cpu_(ooo_6.6-7.5) 2013/03/29 22:24:39 do we need this ifdef block? given that we aleady
jvoung (off chromium) 2013/03/29 22:54:52 Yeah, seems like we don't need to ifdef this anymo
jvoung (off chromium) 2013/03/29 23:22:40 Done -- also removed the null checks that I added
763 return NULL; 761 return NULL;
764 #else 762 #else
765 if (!crl_set_fetcher_.get()) 763 if (!crl_set_fetcher_.get())
766 crl_set_fetcher_ = new CRLSetFetcher(); 764 crl_set_fetcher_ = new CRLSetFetcher();
767 return crl_set_fetcher_.get(); 765 return crl_set_fetcher_.get();
768 #endif 766 #endif
769 } 767 }
770 768
769 PnaclComponentInstaller* BrowserProcessImpl::pnacl_component_installer() {
770 if (!pnacl_component_installer_.get())
771 pnacl_component_installer_.reset(new PnaclComponentInstaller());
772 return pnacl_component_installer_.get();
773 }
774
771 void BrowserProcessImpl::ResourceDispatcherHostCreated() { 775 void BrowserProcessImpl::ResourceDispatcherHostCreated() {
772 resource_dispatcher_host_delegate_.reset( 776 resource_dispatcher_host_delegate_.reset(
773 new ChromeResourceDispatcherHostDelegate(prerender_tracker())); 777 new ChromeResourceDispatcherHostDelegate(prerender_tracker()));
774 ResourceDispatcherHost::Get()->SetDelegate( 778 ResourceDispatcherHost::Get()->SetDelegate(
775 resource_dispatcher_host_delegate_.get()); 779 resource_dispatcher_host_delegate_.get());
776 780
777 pref_change_registrar_.Add( 781 pref_change_registrar_.Add(
778 prefs::kAllowCrossOriginAuthPrompt, 782 prefs::kAllowCrossOriginAuthPrompt,
779 base::Bind(&BrowserProcessImpl::ApplyAllowCrossOriginAuthPromptPolicy, 783 base::Bind(&BrowserProcessImpl::ApplyAllowCrossOriginAuthPromptPolicy,
780 base::Unretained(this))); 784 base::Unretained(this)));
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 } 1052 }
1049 1053
1050 void BrowserProcessImpl::OnAutoupdateTimer() { 1054 void BrowserProcessImpl::OnAutoupdateTimer() {
1051 if (CanAutorestartForUpdate()) { 1055 if (CanAutorestartForUpdate()) {
1052 DLOG(WARNING) << "Detected update. Restarting browser."; 1056 DLOG(WARNING) << "Detected update. Restarting browser.";
1053 RestartBackgroundInstance(); 1057 RestartBackgroundInstance();
1054 } 1058 }
1055 } 1059 }
1056 1060
1057 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1061 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698