| Index: net/url_request/url_fetcher_core.cc
|
| diff --git a/net/url_request/url_fetcher_core.cc b/net/url_request/url_fetcher_core.cc
|
| index e8da0e1ee992ce3c48ca032512baeae970325bc1..2bce40144710ba9507e14b55aeeeb815289d2f54 100644
|
| --- a/net/url_request/url_fetcher_core.cc
|
| +++ b/net/url_request/url_fetcher_core.cc
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "net/url_request/url_fetcher_core.h"
|
|
|
| +#include <stdint.h>
|
| +
|
| #include "base/bind.h"
|
| #include "base/logging.h"
|
| #include "base/metrics/histogram.h"
|
| @@ -608,8 +610,8 @@ void URLFetcherCore::StartURLRequestWhenAppropriate() {
|
|
|
| DCHECK(request_context_getter_.get());
|
|
|
| - int64 delay = 0LL;
|
| - if (original_url_throttler_entry_.get() == NULL) {
|
| + int64 delay = INT64_C(0);
|
| + if (!original_url_throttler_entry_.get()) {
|
| URLRequestThrottlerManager* manager =
|
| request_context_getter_->GetURLRequestContext()->throttler_manager();
|
| if (manager) {
|
| @@ -617,12 +619,12 @@ void URLFetcherCore::StartURLRequestWhenAppropriate() {
|
| manager->RegisterRequestUrl(original_url_);
|
| }
|
| }
|
| - if (original_url_throttler_entry_.get() != NULL) {
|
| + if (original_url_throttler_entry_.get()) {
|
| delay = original_url_throttler_entry_->ReserveSendingTimeForNextRequest(
|
| GetBackoffReleaseTime());
|
| }
|
|
|
| - if (delay == 0) {
|
| + if (delay == INT64_C(0)) {
|
| StartURLRequest();
|
| } else {
|
| base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
|
| @@ -678,7 +680,7 @@ void URLFetcherCore::InformDelegateFetchIsComplete() {
|
|
|
| void URLFetcherCore::NotifyMalformedContent() {
|
| DCHECK(network_task_runner_->BelongsToCurrentThread());
|
| - if (url_throttler_entry_.get() != NULL) {
|
| + if (url_throttler_entry_.get()) {
|
| int status_code = response_code_;
|
| if (status_code == URLFetcher::RESPONSE_CODE_INVALID) {
|
| // The status code will generally be known by the time clients
|
| @@ -768,21 +770,20 @@ void URLFetcherCore::ReleaseRequest() {
|
| base::TimeTicks URLFetcherCore::GetBackoffReleaseTime() {
|
| DCHECK(network_task_runner_->BelongsToCurrentThread());
|
|
|
| - if (original_url_throttler_entry_.get()) {
|
| - base::TimeTicks original_url_backoff =
|
| - original_url_throttler_entry_->GetExponentialBackoffReleaseTime();
|
| - base::TimeTicks destination_url_backoff;
|
| - if (url_throttler_entry_.get() != NULL &&
|
| - original_url_throttler_entry_.get() != url_throttler_entry_.get()) {
|
| - destination_url_backoff =
|
| - url_throttler_entry_->GetExponentialBackoffReleaseTime();
|
| - }
|
| -
|
| - return original_url_backoff > destination_url_backoff ?
|
| - original_url_backoff : destination_url_backoff;
|
| - } else {
|
| + if (!original_url_throttler_entry_.get())
|
| return base::TimeTicks();
|
| +
|
| + base::TimeTicks original_url_backoff =
|
| + original_url_throttler_entry_->GetExponentialBackoffReleaseTime();
|
| + base::TimeTicks destination_url_backoff;
|
| + if (url_throttler_entry_.get() &&
|
| + original_url_throttler_entry_.get() != url_throttler_entry_.get()) {
|
| + destination_url_backoff =
|
| + url_throttler_entry_->GetExponentialBackoffReleaseTime();
|
| }
|
| +
|
| + return original_url_backoff > destination_url_backoff ?
|
| + original_url_backoff : destination_url_backoff;
|
| }
|
|
|
| void URLFetcherCore::CompleteAddingUploadDataChunk(
|
|
|