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

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

Issue 2340003002: Mechanical refactoring of BrowserProcessImpl::component_updater(). (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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
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
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)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698