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

Unified Diff: content/common/net/url_fetcher.cc

Issue 7282032: Move backoff_delay_ to the inner Core class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: set_backoff_delay has been renamed. Created 9 years, 2 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
« no previous file with comments | « content/common/net/url_fetcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/net/url_fetcher.cc
===================================================================
--- content/common/net/url_fetcher.cc (revision 105661)
+++ content/common/net/url_fetcher.cc (working copy)
@@ -285,6 +285,8 @@
bool automatically_retry_on_5xx_;
// Maximum retries allowed.
int max_retries_;
+ // Back-off time delay. 0 by default.
+ base::TimeDelta backoff_delay_;
static base::LazyInstance<Registry> g_registry;
@@ -479,7 +481,7 @@
int response_code,
const net::ResponseCookies& cookies,
const std::string& data) {
- NOTREACHED() << "If you don't implemnt this, the no-params version "
+ NOTREACHED() << "If you don't implement this, the no-params version "
<< "should also be implemented, in which case this "
<< "method won't be called...";
}
@@ -729,7 +731,7 @@
// after backoff time.
++num_retries_;
- // Note that backoff_delay_ may be 0 because (a) the URLRequestThrottler
+ // Note that backoff_delay may be 0 because (a) the URLRequestThrottler
// code does not necessarily back off on the first error, and (b) it
// only backs off on some of the 5xx status codes.
base::TimeTicks backoff_release_time = GetBackoffReleaseTime();
@@ -881,7 +883,7 @@
// Save the status and backoff_delay so that delegates can read it.
if (delegate_) {
- fetcher_->backoff_delay_ = backoff_delay;
+ backoff_delay_ = backoff_delay;
InformDelegateFetchIsComplete();
}
}
@@ -997,6 +999,15 @@
core_->max_retries_ = max_retries;
}
+base::TimeDelta URLFetcher::backoff_delay() const {
+ return core_->backoff_delay_;
+}
+
+void URLFetcher::set_backoff_delay_for_testing(
+ base::TimeDelta backoff_delay) {
+ core_->backoff_delay_ = backoff_delay;
+}
+
void URLFetcher::SaveResponseToTemporaryFile(
scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy) {
core_->file_message_loop_proxy_ = file_message_loop_proxy;
« no previous file with comments | « content/common/net/url_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698