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

Unified Diff: net/url_request/url_request.h

Issue 137493008: Retry HttpNetworkTransactions upon receipt of ERR_NETWORK_CHANGED during host resolution and … Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Flush task queue before restart Created 6 years, 11 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
Index: net/url_request/url_request.h
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h
index 5637d423c877690223981aec13f4e8a415086d35..22b3ab4cc8f9ed42977cdc0dc5b3f18fa2efa5b2 100644
--- a/net/url_request/url_request.h
+++ b/net/url_request/url_request.h
@@ -678,6 +678,21 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
// due to HSTS. If so, |redirect_url| is rewritten to the new HTTPS URL.
bool GetHSTSRedirect(GURL* redirect_url) const;
+ // Retries up to |max_retries| times when requests fail with
+ // ERR_NETWORK_CHANGED. If ERR_NETWORK_CHANGED is received after having
+ // retried |max_retries| times then it is propagated to the Delegate.
+ // Retrying is only attempted when ERR_NETWORK_CHANGED is received during
+ // host resolution or connecting (i.e. before the request has been issued).
+ // This ensures request side-effects are never duplicated. The default
+ // number of automatic retries upon ERR_NEWORK_CHANGED is three. This only
+ // has an effect if the underlying URLRequestJob implements this behavior.
+ void set_max_automatic_retries_on_network_changes(int max_retries) {
+ max_automatic_retries_on_network_changes_ = max_retries;
+ }
+ int max_automatic_retries_on_network_changes() const {
mmenke 2014/02/13 20:20:17 Don't think we need an accessor, for now. Not a h
+ return max_automatic_retries_on_network_changes_;
+ }
+
// TODO(willchan): Undo this. Only temporarily public.
bool has_delegate() const { return delegate_ != NULL; }
@@ -892,6 +907,8 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
AuthCredentials auth_credentials_;
scoped_refptr<AuthChallengeInfo> auth_info_;
+ int max_automatic_retries_on_network_changes_;
+
int64 received_response_content_length_;
base::TimeTicks creation_time_;

Powered by Google App Engine
This is Rietveld 408576698