summaryrefslogtreecommitdiffstats
path: root/net/url_request/url_request_http_job.h
diff options
context:
space:
mode:
authormmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-24 00:53:41 +0000
committermmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-24 00:53:41 +0000
commit7d82ac2ef03404722106db1262b605df1cb30f13 (patch)
tree6069517a6942edc0a5f8efcc7d021826ed1afe68 /net/url_request/url_request_http_job.h
parentd3cc70165671237f5c2f4956f6bbf5eaffbf9328 (diff)
downloadchromium_src-7d82ac2ef03404722106db1262b605df1cb30f13.zip
chromium_src-7d82ac2ef03404722106db1262b605df1cb30f13.tar.gz
chromium_src-7d82ac2ef03404722106db1262b605df1cb30f13.tar.bz2
Reland of http://codereview.chromium.org/10854204/, which
I reverted because of a bug in its unit tests. Retry failed network requests. R=willchan@chomium.org BUG=143425 Review URL: https://chromiumcodereview.appspot.com/10872044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153131 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/url_request_http_job.h')
-rw-r--r--net/url_request/url_request_http_job.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/net/url_request/url_request_http_job.h b/net/url_request/url_request_http_job.h
index 874955e..d028348 100644
--- a/net/url_request/url_request_http_job.h
+++ b/net/url_request/url_request_http_job.h
@@ -64,6 +64,12 @@ class URLRequestHttpJob : public URLRequestJob {
void RestartTransactionWithAuth(const AuthCredentials& credentials);
+ void RetryRequestOnError(int result);
+
+ // Returns true if this request should be retried after receiving the given
+ // error as a result of a call to Start.
+ bool ShouldRetryRequest(int result) const;
+
// Overridden from URLRequestJob:
virtual void SetUpload(UploadData* upload) OVERRIDE;
virtual void SetExtraRequestHeaders(
@@ -149,6 +155,8 @@ class URLRequestHttpJob : public URLRequestJob {
void RecordTimer();
void ResetTimer();
+ void RecordRetryResult(int result) const;
+
virtual void UpdatePacketReadTimes() OVERRIDE;
void RecordPacketStats(FilterContext::StatisticSelector statistic) const;
@@ -240,6 +248,15 @@ class URLRequestHttpJob : public URLRequestJob {
scoped_ptr<HttpTransactionDelegateImpl> http_transaction_delegate_;
+ // True if the request job has automatically retried the request as a result
+ // of an error.
+ bool has_retried_;
+
+ // The network error code error that |this| was automatically retried as a
+ // result of, if any. If this request has not been retried, must be 0.
+ // Reset once it's been used to log histograms.
+ int error_before_retry_;
+
DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob);
};