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

Unified Diff: net/url_request/url_fetcher.h

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 | « net/url_request/test_url_fetcher_factory.cc ('k') | net/url_request/url_fetcher_core.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_fetcher.h
diff --git a/net/url_request/url_fetcher.h b/net/url_request/url_fetcher.h
index 190e53932652eaa46f6a3450cc207b968c0ab97e..37aba0277640290120f56cc47248806b9ca74648 100644
--- a/net/url_request/url_fetcher.h
+++ b/net/url_request/url_fetcher.h
@@ -186,13 +186,21 @@ class NET_EXPORT URLFetcher {
// after backoff_delay() elapses. URLFetcher has it set to true by default.
virtual void SetAutomaticallyRetryOn5xx(bool retry) = 0;
- virtual void SetMaxRetries(int max_retries) = 0;
- virtual int GetMaxRetries() const = 0;
+ virtual void SetMaxRetriesOn5xx(int max_retries) = 0;
+ virtual int GetMaxRetriesOn5xx() const = 0;
// Returns the back-off delay before the request will be retried,
// when a 5xx response was received.
virtual base::TimeDelta GetBackoffDelay() const = 0;
+ // 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 observer.
+ // Each retry can be delayed if the network if currently offline, and will be
+ // attempted once the network connection is back. The first fetch is also
+ // delayed if the network is offline when Start() is invoked.
+ virtual void SetAutomaticallyRetryOnNetworkChanges(int max_retries) = 0;
+
// By default, the response is saved in a string. Call this method to save the
// response to a file instead. Must be called before Start().
// |file_task_runner| will be used for all file operations.
« no previous file with comments | « net/url_request/test_url_fetcher_factory.cc ('k') | net/url_request/url_fetcher_core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698