Chromium Code Reviews| Index: content/common/url_fetcher.cc |
| =================================================================== |
| --- content/common/url_fetcher.cc (revision 91118) |
| +++ content/common/url_fetcher.cc (working copy) |
| @@ -272,6 +272,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; |
| @@ -416,7 +418,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..."; |
| } |
| @@ -642,7 +644,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. |
| backoff_delay = backoff_release_time - base::TimeTicks::Now(); |
| @@ -793,7 +795,7 @@ |
| // Save the status and backoff_delay so that delegates can read it. |
| if (delegate_) { |
| status_ = status; |
| - fetcher_->backoff_delay_ = backoff_delay; |
| + backoff_delay_ = backoff_delay; |
|
willchan no longer on Chromium
2011/06/30 15:50:24
It's never read, only written. How do tests use th
wtc
2011/06/30 21:36:02
It's never read in this file. But it can be read
|
| InformDelegateFetchIsComplete(); |
| } |
| } |
| @@ -906,6 +908,14 @@ |
| core_->max_retries_ = max_retries; |
| } |
| +base::TimeDelta URLFetcher::backoff_delay() const { |
| + return core_->backoff_delay_; |
| +} |
| + |
| +void URLFetcher::set_backoff_delay(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; |