Implement common code for component and extension updaters.

The changes not under update_client are mechanical.

This change creates a working UpdateClient updater client, which can be reused by both component and extension updaters.

This code is not hooked up yet with any of the updaters above.
Those changes will be committed in the near future by other CLs.

R=waffles,erikwright,agl,dgarrett,jhawkins,brettw

BUG=450337

Committed: https://crrev.com/ba6742df55de47568e3aa438378d844a7439c391
Cr-Commit-Position: refs/heads/master@{#325006}

Review URL: https://codereview.chromium.org/1055903003

Cr-Commit-Position: refs/heads/master@{#325658}
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 254d2ef..d463086 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -876,14 +876,14 @@
   if (!component_updater_.get()) {
     if (!BrowserThread::CurrentlyOn(BrowserThread::UI))
       return NULL;
-    update_client::Configurator* configurator =
+    scoped_refptr<update_client::Configurator> configurator =
         component_updater::MakeChromeComponentUpdaterConfigurator(
             base::CommandLine::ForCurrentProcess(),
             io_thread()->system_url_request_context_getter());
     // 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));
+    component_updater_.reset(component_updater::ComponentUpdateServiceFactory(
+                                 configurator).release());
   }
   return component_updater_.get();
 }