Fast-fail WPAD detection.

Right now, if there's no WPAD host on the local network, we have to wait up to
two seconds for ProxyScriptDecider to time out, during which all requests are
stalled waiting to find out what proxy to use. This is a pretty crappy
experience when you have proxy autodetection turned on and no WPAD host.

Therefore, add a new state to ProxyScriptDecider's state machine: "QuickCheck".
When we're in this state, we are doing a DNS query only for WPAD, with a timeout
of 1 second; if this query doesn't succeed, we abort the entire WPAD process. We
also upload an UMA report saying how long the WPAD resolution took to succeed.
In future, once we have a good idea how long WPAD requests usually actually
take, we'll turn this timeout down, probably to something extremely low (from
experiments, IE appears to use a timeout of 50ms).

TEST=unit,trybot,manual
BUG=chromium:161826

Review URL: https://chromiumcodereview.appspot.com/23181010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224030 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
index 90b7d36..e4098d0 100644
--- a/net/dns/host_resolver_impl.cc
+++ b/net/dns/host_resolver_impl.cc
@@ -1455,8 +1455,12 @@
                                 queue_time_after_change);
     }
 
+    bool system_only =
+        (key_.host_resolver_flags & HOST_RESOLVER_SYSTEM_ONLY) != 0;
+
     // Caution: Job::Start must not complete synchronously.
-    if (had_dns_config_ && !ResemblesMulticastDNSName(key_.hostname)) {
+    if (!system_only && had_dns_config_ &&
+        !ResemblesMulticastDNSName(key_.hostname)) {
       StartDnsTask();
     } else {
       StartProcTask();