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

Unified Diff: net/base/dnsrr_resolver.cc

Issue 11464028: Introduce ERR_NETWORK_CHANGED and allow URLFetcher to automatically retry on that error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed nits Created 8 years 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 | « google_apis/gaia/gaia_oauth_client.cc ('k') | net/base/dnsrr_resolver_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/dnsrr_resolver.cc
diff --git a/net/base/dnsrr_resolver.cc b/net/base/dnsrr_resolver.cc
index cfe63e2bba53854e18a8bbd26fe07d5156225a6f..3fecfe332acdd72348836ed4c418ab7a223289b4 100644
--- a/net/base/dnsrr_resolver.cc
+++ b/net/base/dnsrr_resolver.cc
@@ -509,11 +509,7 @@ class RRResolverJob {
}
~RRResolverJob() {
- if (worker_) {
- worker_->Cancel();
- worker_ = NULL;
- PostAll(ERR_ABORTED, NULL);
- }
+ Cancel(ERR_ABORTED);
}
void AddHandle(RRResolverHandle* handle) {
@@ -525,6 +521,14 @@ class RRResolverJob {
PostAll(result, &response);
}
+ void Cancel(int result) {
+ if (worker_) {
+ worker_->Cancel();
+ worker_ = NULL;
+ PostAll(result, NULL);
+ }
+ }
+
private:
void PostAll(int result, const RRResponse* response) {
std::vector<RRResolverHandle*> handles;
@@ -643,6 +647,9 @@ void DnsRRResolver::OnIPAddressChanged() {
inflight.swap(inflight_);
cache_.clear();
+ std::map<std::pair<std::string, uint16>, RRResolverJob*>::iterator it;
+ for (it = inflight.begin(); it != inflight.end(); ++it)
+ it->second->Cancel(ERR_NETWORK_CHANGED);
STLDeleteValues(&inflight);
}
« no previous file with comments | « google_apis/gaia/gaia_oauth_client.cc ('k') | net/base/dnsrr_resolver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698