Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: net/dns/dns_client.h

Issue 9705017: [net/dns] Serve requests from HOSTS file if possible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle lack of IPv6 support. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/net_log_event_type_list.h ('k') | net/dns/dns_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_client.h
diff --git a/net/dns/dns_client.h b/net/dns/dns_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..c5461ec3fdc0911440285f887a238fa62e441dd4
--- /dev/null
+++ b/net/dns/dns_client.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2012 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_DNS_CLIENT_H_
+#define NET_DNS_DNS_CLIENT_H_
+#pragma once
+
+#include "base/memory/scoped_ptr.h"
+#include "net/base/net_export.h"
+
+namespace net {
+
+struct DnsConfig;
+class DnsTransactionFactory;
+class NetLog;
+
+// Convenience wrapper allows easy injection of DnsTransaction into
+// HostResolverImpl.
+class NET_EXPORT DnsClient {
+ public:
+ virtual ~DnsClient() {}
+
+ // Creates a new DnsTransactionFactory according to the new |config|.
+ virtual void SetConfig(const DnsConfig& config) = 0;
+
+ // Returns NULL if the current config is not valid.
+ virtual const DnsConfig* GetConfig() const = 0;
+
+ // Returns NULL if the current config is not valid.
+ virtual DnsTransactionFactory* GetTransactionFactory() = 0;
+
+ // Creates default client.
+ static scoped_ptr<DnsClient> CreateClient(NetLog* net_log);
+};
+
+} // namespace net
+
+#endif // NET_DNS_DNS_CLIENT_H_
+
« no previous file with comments | « net/base/net_log_event_type_list.h ('k') | net/dns/dns_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698