update_engine: Use org.chromium.NetworkProxyService.

Make update_engine call Chrome's new
org.chromium.NetworkProxyService D-Bus service to resolve
network proxies instead of using
org.chromium.LibCrosService. The new service supports
asynchronous replies instead of responding via D-Bus
signals.

BUG=chromium:446115,chromium:703217
TEST=unit tests pass; also added debug logging and verified
     that chrome's proxy settings are used

Change-Id: Iebd268ea3e551c0760416d955828b9d7ebf851fb
Reviewed-on: https://chromium-review.googlesource.com/497491
Commit-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
diff --git a/common/http_fetcher.cc b/common/http_fetcher.cc
index e592cc5..bcd1ffe 100644
--- a/common/http_fetcher.cc
+++ b/common/http_fetcher.cc
@@ -46,7 +46,7 @@
 }
 
 // Proxy methods to set the proxies, then to pop them off.
-bool HttpFetcher::ResolveProxiesForUrl(const string& url,
+void HttpFetcher::ResolveProxiesForUrl(const string& url,
                                        const Closure& callback) {
   CHECK_EQ(static_cast<Closure*>(nullptr), callback_.get());
   callback_.reset(new Closure(callback));
@@ -57,10 +57,10 @@
         FROM_HERE,
         base::Bind(&HttpFetcher::NoProxyResolverCallback,
                    base::Unretained(this)));
-    return true;
+    return;
   }
-  return proxy_resolver_->GetProxiesForUrl(
-      url, base::Bind(&HttpFetcher::ProxiesResolved, base::Unretained(this)));
+  proxy_resolver_->GetProxiesForUrl(url,
+      base::Bind(&HttpFetcher::ProxiesResolved, base::Unretained(this)));
 }
 
 void HttpFetcher::NoProxyResolverCallback() {
diff --git a/common/http_fetcher.h b/common/http_fetcher.h
index 9f81879..61a83f0 100644
--- a/common/http_fetcher.h
+++ b/common/http_fetcher.h
@@ -66,8 +66,7 @@
   void SetPostData(const void* data, size_t size);
 
   // Proxy methods to set the proxies, then to pop them off.
-  // Returns true on success.
-  bool ResolveProxiesForUrl(const std::string& url,
+  void ResolveProxiesForUrl(const std::string& url,
                             const base::Closure& callback);
 
   void SetProxies(const std::deque<std::string>& proxies) {
diff --git a/common/libcurl_http_fetcher.cc b/common/libcurl_http_fetcher.cc
index 9e40eeb..a128fd8 100644
--- a/common/libcurl_http_fetcher.cc
+++ b/common/libcurl_http_fetcher.cc
@@ -285,11 +285,7 @@
   url_ = url;
   auto closure = base::Bind(&LibcurlHttpFetcher::ProxiesResolved,
                             base::Unretained(this));
-  if (!ResolveProxiesForUrl(url_, closure)) {
-    LOG(ERROR) << "Couldn't resolve proxies";
-    if (delegate_)
-      delegate_->TransferComplete(this, false);
-  }
+  ResolveProxiesForUrl(url_, closure);
 }
 
 void LibcurlHttpFetcher::ProxiesResolved() {