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

Unified Diff: chrome/common/net/url_fetcher.h

Issue 4194001: Implement exponential back-off mechanism and enforce it at the URLRequestHttpJob level. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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 | « chrome/chrome_common.gypi ('k') | chrome/common/net/url_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/net/url_fetcher.h
===================================================================
--- chrome/common/net/url_fetcher.h (revision 67336)
+++ chrome/common/net/url_fetcher.h (working copy)
@@ -16,6 +16,7 @@
#pragma once
#include <string>
+#include <vector>
#include "base/message_loop.h"
#include "base/ref_counted.h"
@@ -152,6 +153,10 @@
// after backoff_delay() elapses. URLFetcher has it set to true by default.
void set_automatically_retry_on_5xx(bool retry);
+ int max_retries() const { return max_retries_; }
+
+ void set_max_retries(int max_retries) { max_retries_ = max_retries; }
+
// Returns the back-off delay before the request will be retried,
// when a 5xx response was received.
base::TimeDelta backoff_delay() const { return backoff_delay_; }
@@ -174,6 +179,9 @@
// Return the URL that this fetcher is processing.
const GURL& url() const;
+ // Reports that the received content was malformed.
+ void ReceivedContentWasMalformed();
+
// Cancels all existing URLRequests. Will notify the URLFetcher::Delegates.
// Note that any new URLFetchers created while this is running will not be
// cancelled. Typically, one would call this in the CleanUp() method of an IO
@@ -203,6 +211,8 @@
bool automatically_retry_on_5xx_;
// Back-off time delay. 0 by default.
base::TimeDelta backoff_delay_;
+ // Maximum retries allowed.
+ int max_retries_;
static bool g_interception_enabled;
« no previous file with comments | « chrome/chrome_common.gypi ('k') | chrome/common/net/url_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698