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() {
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))
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();
}
......
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