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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_process_impl.cc
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 7abddbb973f60c75d58406375ed62137f3e15817..51450fe181526cf761cb873d48f9ae507923989e 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -889,19 +889,18 @@ net_log::ChromeNetLog* BrowserProcessImpl::net_log() {
component_updater::ComponentUpdateService*
BrowserProcessImpl::component_updater() {
- if (!component_updater_.get()) {
- if (!BrowserThread::CurrentlyOn(BrowserThread::UI))
- return NULL;
- scoped_refptr<update_client::Configurator> configurator =
- component_updater::MakeChromeComponentUpdaterConfigurator(
- base::CommandLine::ForCurrentProcess(),
- io_thread()->system_url_request_context_getter(),
- g_browser_process->local_state());
- // Creating the component updater does not do anything, components
- // need to be registered and Start() needs to be called.
- component_updater_.reset(component_updater::ComponentUpdateServiceFactory(
- configurator).release());
- }
+ if (component_updater_)
+ return component_updater_.get();
+
+ if (!BrowserThread::CurrentlyOn(BrowserThread::UI))
sky 2016/09/14 18:11:00 I'm a bit confused by this check being only in the
+ return nullptr;
+
+ component_updater_ = component_updater::ComponentUpdateServiceFactory(
+ component_updater::MakeChromeComponentUpdaterConfigurator(
+ base::CommandLine::ForCurrentProcess(),
+ io_thread()->system_url_request_context_getter(),
+ g_browser_process->local_state()));
+
return component_updater_.get();
}
« 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