Commit 7a43e837 authored by sorin's avatar sorin Committed by Commit bot

Mechanical refactoring of BrowserProcessImpl::component_updater().

Bring the code to C++11 standard and streamline the execution path inside the function.

BUG=646904

Review-Url: https://codereview.chromium.org/2340003002
Cr-Commit-Position: refs/heads/master@{#418982}
parent 9954e8c3
...@@ -889,19 +889,18 @@ net_log::ChromeNetLog* BrowserProcessImpl::net_log() { ...@@ -889,19 +889,18 @@ net_log::ChromeNetLog* BrowserProcessImpl::net_log() {
component_updater::ComponentUpdateService* component_updater::ComponentUpdateService*
BrowserProcessImpl::component_updater() { BrowserProcessImpl::component_updater() {
if (!component_updater_.get()) { if (component_updater_)
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) return component_updater_.get();
return NULL;
scoped_refptr<update_client::Configurator> configurator = if (!BrowserThread::CurrentlyOn(BrowserThread::UI))
component_updater::MakeChromeComponentUpdaterConfigurator( return nullptr;
base::CommandLine::ForCurrentProcess(),
io_thread()->system_url_request_context_getter(), component_updater_ = component_updater::ComponentUpdateServiceFactory(
g_browser_process->local_state()); component_updater::MakeChromeComponentUpdaterConfigurator(
// Creating the component updater does not do anything, components base::CommandLine::ForCurrentProcess(),
// need to be registered and Start() needs to be called. io_thread()->system_url_request_context_getter(),
component_updater_.reset(component_updater::ComponentUpdateServiceFactory( g_browser_process->local_state()));
configurator).release());
}
return component_updater_.get(); return component_updater_.get();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment