diff options
author | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-12 03:09:11 +0000 |
---|---|---|
committer | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-12 03:09:11 +0000 |
commit | 489d1a8055c3ed8389630cd537999a6715eaa4a5 (patch) | |
tree | 2b4315dec568337f68b5b615bff663f71463a031 /net/dns | |
parent | 3218f80dfc2d5310d6078f55bf535df303f1d9d9 (diff) | |
download | chromium_src-489d1a8055c3ed8389630cd537999a6715eaa4a5.zip chromium_src-489d1a8055c3ed8389630cd537999a6715eaa4a5.tar.gz chromium_src-489d1a8055c3ed8389630cd537999a6715eaa4a5.tar.bz2 |
Add GetHostCache to HostResolver interface, and use the
new method to hook up AsyncHostResolver to
about:net-internals#dns and to clear DNS cache hooks.
Also fix up DNSTransaction's NetLog logging a little.
R=eroman,cbentzel,szym
BUG=99847
TEST=manual
Review URL: http://codereview.chromium.org/8233013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104988 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/dns')
-rw-r--r-- | net/dns/async_host_resolver.cc | 4 | ||||
-rw-r--r-- | net/dns/async_host_resolver.h | 2 | ||||
-rw-r--r-- | net/dns/dns_transaction.cc | 8 | ||||
-rw-r--r-- | net/dns/dns_transaction.h | 6 |
4 files changed, 11 insertions, 9 deletions
diff --git a/net/dns/async_host_resolver.cc b/net/dns/async_host_resolver.cc index ed0d70f..70c9277 100644 --- a/net/dns/async_host_resolver.cc +++ b/net/dns/async_host_resolver.cc @@ -351,8 +351,8 @@ AddressFamily AsyncHostResolver::GetDefaultAddressFamily() const { return ADDRESS_FAMILY_IPV4; } -HostResolverImpl* AsyncHostResolver::GetAsHostResolverImpl() { - return NULL; +HostCache* AsyncHostResolver::GetHostCache() { + return cache_.get(); } void AsyncHostResolver::OnTransactionComplete( diff --git a/net/dns/async_host_resolver.h b/net/dns/async_host_resolver.h index 9906720..f7e5c53 100644 --- a/net/dns/async_host_resolver.h +++ b/net/dns/async_host_resolver.h @@ -52,7 +52,7 @@ class NET_EXPORT AsyncHostResolver virtual void RemoveObserver(HostResolver::Observer* observer) OVERRIDE; virtual void SetDefaultAddressFamily(AddressFamily address_family) OVERRIDE; virtual AddressFamily GetDefaultAddressFamily() const OVERRIDE; - virtual HostResolverImpl* GetAsHostResolverImpl() OVERRIDE; + virtual HostCache* GetHostCache() OVERRIDE; // DnsTransaction::Delegate interface virtual void OnTransactionComplete( diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc index 30fd7bf..a7fa922 100644 --- a/net/dns/dns_transaction.cc +++ b/net/dns/dns_transaction.cc @@ -84,7 +84,8 @@ class DnsTransactionStartParameters : public NetLog::EventParameters { dict->SetString("dns_server", dns_server_.ToString()); dict->SetString("hostname", hostname); dict->SetInteger("query_type", key_.second); - dict->Set("source_dependency", source_.ToValue()); + if (source_.is_valid()) + dict->Set("source_dependency", source_.ToValue()); return dict; } @@ -107,7 +108,8 @@ class DnsTransactionFinishParameters : public NetLog::EventParameters { list->Append(Value::CreateStringValue(IPAddressToString(*it))); DictionaryValue* dict = new DictionaryValue(); - dict->SetInteger("net_error", net_error_); + if (net_error_) + dict->SetInteger("net_error", net_error_); dict->Set("address_list", list); return dict; } @@ -247,7 +249,7 @@ int DnsTransaction::DoConnect() { socket_.reset(socket_factory_->CreateDatagramClientSocket( DatagramSocket::RANDOM_BIND, base::Bind(&base::RandInt), - NULL, + net_log_.net_log(), net_log_.source())); net_log_.AddEvent( diff --git a/net/dns/dns_transaction.h b/net/dns/dns_transaction.h index 27da32a..c126193 100644 --- a/net/dns/dns_transaction.h +++ b/net/dns/dns_transaction.h @@ -29,15 +29,15 @@ class DnsQuery; class DnsResponse; // Performs (with fixed retries) a single asynchronous DNS transaction, -// which consists of sending out a DNS query, waiting for response, and +// which consists of sending out a DNS query, waiting for a response, and // parsing and returning the IP addresses that it matches. class NET_EXPORT_PRIVATE DnsTransaction : NON_EXPORTED_BASE(public base::NonThreadSafe) { public: typedef std::pair<std::string, uint16> Key; - // Interface that should implemented by DnsTransaction consumer and - // passed to |Start| method to be notified when the transaction has + // Interface that should be implemented by DnsTransaction consumers and + // passed to the |Start| method to be notified when the transaction has // completed. class NET_EXPORT_PRIVATE Delegate { public: |