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

Unified Diff: net/dns/host_resolver_impl.cc

Issue 1908543002: DNS: Retain stale entries in HostCache and return when requested (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, make all members of Entry private Created 4 years, 7 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/dns/host_cache_unittest.cc ('k') | net/dns/host_resolver_mojo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/host_resolver_impl.cc
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
index bb00a8322f2b9b59a2bf32db0842e6a64845eb79..5fc531bbf46fb8486d335e0fe833efb7fdefff26 100644
--- a/net/dns/host_resolver_impl.cc
+++ b/net/dns/host_resolver_impl.cc
@@ -1748,19 +1748,19 @@ class HostResolverImpl::Job : public PrioritizedDispatcher::Job,
}
net_log_.EndEventWithNetErrorCode(NetLog::TYPE_HOST_RESOLVER_IMPL_JOB,
- entry.error);
+ entry.error());
DCHECK(!requests_.empty());
- if (entry.error == OK) {
+ if (entry.error() == OK) {
// Record this histogram here, when we know the system has a valid DNS
// configuration.
UMA_HISTOGRAM_BOOLEAN("AsyncDNS.HaveDnsConfig",
resolver_->received_dns_config_);
}
- bool did_complete = (entry.error != ERR_NETWORK_CHANGED) &&
- (entry.error != ERR_HOST_RESOLVER_QUEUE_TOO_LARGE);
+ bool did_complete = (entry.error() != ERR_NETWORK_CHANGED) &&
+ (entry.error() != ERR_HOST_RESOLVER_QUEUE_TOO_LARGE);
if (did_complete)
resolver_->CacheResult(key_, entry, ttl);
@@ -1771,13 +1771,13 @@ class HostResolverImpl::Job : public PrioritizedDispatcher::Job,
DCHECK_EQ(this, req->job());
// Update the net log and notify registered observers.
- LogFinishRequest(req->source_net_log(), req->info(), entry.error);
+ LogFinishRequest(req->source_net_log(), req->info(), entry.error());
if (did_complete) {
// Record effective total time from creation to completion.
RecordTotalTime(had_dns_config_, req->info().is_speculative(),
base::TimeTicks::Now() - req->request_time());
}
- req->OnComplete(entry.error, entry.addrlist);
+ req->OnComplete(entry.error(), entry.addresses());
// Check if the resolver was destroyed as a result of running the
// callback. If it was, we could continue, but we choose to bail.
@@ -2141,11 +2141,11 @@ bool HostResolverImpl::ServeFromCache(const Key& key,
if (!cache_entry)
return false;
- *net_error = cache_entry->error;
+ *net_error = cache_entry->error();
if (*net_error == OK) {
if (cache_entry->has_ttl())
- RecordTTL(cache_entry->ttl);
- *addresses = EnsurePortOnAddressList(cache_entry->addrlist, info.port());
+ RecordTTL(cache_entry->ttl());
+ *addresses = EnsurePortOnAddressList(cache_entry->addresses(), info.port());
}
return true;
}
« no previous file with comments | « net/dns/host_cache_unittest.cc ('k') | net/dns/host_resolver_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698