Add source and cache selection to HostResolver::CreateRequest.

ResolveHostParameters::allow_cached_response is a direct replacement for
RequestInfo::allow_cached_response.  Defaulting to true, it controls
whether or not a result can come from the host cache.

ResolveHostParameters::source allows specifying a source (system vs
async resolver) for a request.  This is a replacement for setting the
HOST_RESOLVER_SYSTEM_ONLY flag or directly using the async resolver
classes.

Just adding to C++ net/ API for now.  Mojo version in next CL.

Bug: 846423
Change-Id: Ie945745f595302ae745ffdab355ae1b13a993c4a
Reviewed-on: https://chromium-review.googlesource.com/1185216
Commit-Queue: Eric Orth <[email protected]>
Reviewed-by: Helen Li <[email protected]>
Cr-Commit-Position: refs/heads/master@{#585641}
diff --git a/net/dns/host_resolver_source.h b/net/dns/host_resolver_source.h
new file mode 100644
index 0000000..4985dfc
--- /dev/null
+++ b/net/dns/host_resolver_source.h
@@ -0,0 +1,25 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_DNS_HOST_RESOLVER_SOURCE_H_
+#define NET_DNS_HOST_RESOLVER_SOURCE_H_
+
+// Enumeration to specify the allowed results source for HostResolver
+// requests.
+enum class HostResolverSource {
+  // Resolver will pick an appropriate source. Results could come from DNS,
+  // MulticastDNS, HOSTS file, etc.
+  ANY,
+
+  // Results will only be retrieved from the system or OS, eg via the
+  // getaddrinfo() system call.
+  SYSTEM,
+
+  // Results will only come from DNS queries.
+  DNS,
+
+  // TODO(crbug.com/846423): Add MDNS support.
+};
+
+#endif  // NET_DNS_HOST_RESOLVER_SOURCE_H_