| Index: net/url_request/url_request_throttler_entry.cc
|
| diff --git a/net/url_request/url_request_throttler_entry.cc b/net/url_request/url_request_throttler_entry.cc
|
| index b7c06122df2703851936416ccf0408b1107e4338..7dac0e2ebafb5a120a8bbadc93ed47c0fd7cf3c3 100644
|
| --- a/net/url_request/url_request_throttler_entry.cc
|
| +++ b/net/url_request/url_request_throttler_entry.cc
|
| @@ -73,8 +73,9 @@ URLRequestThrottlerEntry::URLRequestThrottlerEntry(
|
| backoff_entry_(&backoff_policy_),
|
| manager_(manager),
|
| url_id_(url_id),
|
| - net_log_(BoundNetLog::Make(
|
| - manager->net_log(), NetLog::SOURCE_EXPONENTIAL_BACKOFF_THROTTLING)) {
|
| + net_log_(
|
| + BoundNetLog::Make(manager->net_log(),
|
| + NetLog::SOURCE_EXPONENTIAL_BACKOFF_THROTTLING)) {
|
| DCHECK(manager_);
|
| Initialize();
|
| }
|
| @@ -160,17 +161,17 @@ bool URLRequestThrottlerEntry::ShouldRejectRequest(
|
| int release_after_ms =
|
| GetBackoffEntry()->GetTimeUntilRelease().InMilliseconds();
|
|
|
| - net_log_.AddEvent(
|
| - NetLog::TYPE_THROTTLING_REJECTED_REQUEST,
|
| - base::Bind(&NetLogRejectedRequestCallback,
|
| - &url_id_, num_failures, release_after_ms));
|
| + net_log_.AddEvent(NetLog::TYPE_THROTTLING_REJECTED_REQUEST,
|
| + base::Bind(&NetLogRejectedRequestCallback,
|
| + &url_id_,
|
| + num_failures,
|
| + release_after_ms));
|
|
|
| reject_request = true;
|
| }
|
|
|
| int reject_count = reject_request ? 1 : 0;
|
| - UMA_HISTOGRAM_ENUMERATION(
|
| - "Throttling.RequestThrottled", reject_count, 2);
|
| + UMA_HISTOGRAM_ENUMERATION("Throttling.RequestThrottled", reject_count, 2);
|
|
|
| return reject_request;
|
| }
|
| @@ -187,8 +188,7 @@ int64 URLRequestThrottlerEntry::ReserveSendingTimeForNextRequest(
|
| std::max(GetBackoffEntry()->GetReleaseTime(),
|
| sliding_window_release_time_));
|
|
|
| - DCHECK(send_log_.empty() ||
|
| - recommended_sending_time >= send_log_.back());
|
| + DCHECK(send_log_.empty() || recommended_sending_time >= send_log_.back());
|
| // Log the new send event.
|
| send_log_.push(recommended_sending_time);
|
|
|
| @@ -210,8 +210,8 @@ int64 URLRequestThrottlerEntry::ReserveSendingTimeForNextRequest(
|
| return (recommended_sending_time - now).InMillisecondsRoundedUp();
|
| }
|
|
|
| -base::TimeTicks
|
| - URLRequestThrottlerEntry::GetExponentialBackoffReleaseTime() const {
|
| +base::TimeTicks URLRequestThrottlerEntry::GetExponentialBackoffReleaseTime()
|
| + const {
|
| // If a site opts out, it's likely because they have problems that trigger
|
| // the back-off mechanism when it shouldn't be triggered, in which case
|
| // returning the calculated back-off release time would probably be the
|
| @@ -231,8 +231,8 @@ void URLRequestThrottlerEntry::UpdateWithResponse(
|
| } else {
|
| GetBackoffEntry()->InformOfRequest(true);
|
|
|
| - std::string throttling_header = response->GetNormalizedValue(
|
| - kExponentialThrottlingHeader);
|
| + std::string throttling_header =
|
| + response->GetNormalizedValue(kExponentialThrottlingHeader);
|
| if (!throttling_header.empty())
|
| HandleThrottlingHeader(throttling_header, host);
|
| }
|
| @@ -286,9 +286,7 @@ bool URLRequestThrottlerEntry::IsConsideredError(int response_code) {
|
| // have not made it to the destination server and so we do not actually
|
| // know that it is down or busy. One degenerate case could be a proxy on
|
| // localhost, where you are not actually connected to the network.
|
| - return (response_code == 500 ||
|
| - response_code == 503 ||
|
| - response_code == 509);
|
| + return (response_code == 500 || response_code == 503 || response_code == 509);
|
| }
|
|
|
| base::TimeTicks URLRequestThrottlerEntry::ImplGetTimeNow() const {
|
|
|