Disable ChromeBrowserProxyResolver behind a flag.
In Brillo and Android targets, there isn't a Chrome instance running
to resolve the proxies for a given URL. While this is not a fatal error
it logs abundant error messages on each request, confusing developers.
This patch compiles the ChromeBrowserProxyResolver only when the
USE_LIBCROS flag is set. This is now disabled by default in Brillo and
Android, but enabled in Chrome OS.
Bug: 24277309
TEST=`mma` on edison-eng. Applied an update, no more proxy error logs.
Change-Id: I27779572bf2fc810cb7846d63e123643d0386b0a
diff --git a/update_attempter.h b/update_attempter.h
index 8f6fd18..bbc4b4e 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -306,9 +306,13 @@
void MarkDeltaUpdateFailure();
ProxyResolver* GetProxyResolver() {
+#if USE_LIBCROS
return obeying_proxies_ ?
reinterpret_cast<ProxyResolver*>(&chrome_proxy_resolver_) :
reinterpret_cast<ProxyResolver*>(&direct_proxy_resolver_);
+#else
+ return &direct_proxy_resolver_;
+#endif // USE_LIBCROS
}
// Sends a ping to Omaha.
@@ -454,7 +458,9 @@
// Our two proxy resolvers
DirectProxyResolver direct_proxy_resolver_;
+#if USE_LIBCROS
ChromeBrowserProxyResolver chrome_proxy_resolver_;
+#endif // USE_LIBCROS
// Originally, both of these flags are false. Once UpdateBootFlags is called,
// |update_boot_flags_running_| is set to true. As soon as UpdateBootFlags