Chromium Code Reviews| 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 fdaaf7ff0d89f9a612521e4ab61f7cf6bc589242..af39a5cf006d331c6c26697b229913b56fcb6e25 100644 |
| --- a/net/url_request/url_request_throttler_entry.cc |
| +++ b/net/url_request/url_request_throttler_entry.cc |
| @@ -16,7 +16,6 @@ |
| #include "net/log/net_log.h" |
| #include "net/url_request/url_request.h" |
| #include "net/url_request/url_request_context.h" |
| -#include "net/url_request/url_request_throttler_header_interface.h" |
| #include "net/url_request/url_request_throttler_manager.h" |
| namespace net { |
| @@ -46,10 +45,6 @@ const double URLRequestThrottlerEntry::kDefaultMultiplyFactor = 1.4; |
| const double URLRequestThrottlerEntry::kDefaultJitterFactor = 0.4; |
| const int URLRequestThrottlerEntry::kDefaultMaximumBackoffMs = 15 * 60 * 1000; |
| const int URLRequestThrottlerEntry::kDefaultEntryLifetimeMs = 2 * 60 * 1000; |
| -const char URLRequestThrottlerEntry::kExponentialThrottlingHeader[] = |
| - "X-Chrome-Exponential-Throttling"; |
| -const char URLRequestThrottlerEntry::kExponentialThrottlingDisableValue[] = |
| - "disable"; |
| // Returns NetLog parameters when a request is rejected by throttling. |
| base::Value* NetLogRejectedRequestCallback( |
| @@ -222,18 +217,12 @@ base::TimeTicks |
| return GetBackoffEntry()->GetReleaseTime(); |
| } |
| -void URLRequestThrottlerEntry::UpdateWithResponse( |
| - const std::string& host, |
| - const URLRequestThrottlerHeaderInterface* response) { |
| - if (IsConsideredError(response->GetResponseCode())) { |
| +void URLRequestThrottlerEntry::UpdateWithResponse(const std::string& host, |
|
mmenke
2015/05/19 19:18:37
This method no longer needs the "host" argument.
xunjieli
2015/05/19 20:06:44
Done. thanks!
|
| + int status_code) { |
| + if (IsConsideredError(status_code)) { |
| GetBackoffEntry()->InformOfRequest(false); |
| } else { |
| GetBackoffEntry()->InformOfRequest(true); |
| - |
| - std::string throttling_header = response->GetNormalizedValue( |
| - kExponentialThrottlingHeader); |
| - if (!throttling_header.empty()) |
| - HandleThrottlingHeader(throttling_header, host); |
| } |
|
mmenke
2015/05/19 19:18:37
nit: Can just collapse this block to:
GetBackoff
xunjieli
2015/05/19 20:06:44
Done.
|
| } |
| @@ -294,16 +283,6 @@ base::TimeTicks URLRequestThrottlerEntry::ImplGetTimeNow() const { |
| return base::TimeTicks::Now(); |
| } |
| -void URLRequestThrottlerEntry::HandleThrottlingHeader( |
| - const std::string& header_value, |
| - const std::string& host) { |
| - if (header_value == kExponentialThrottlingDisableValue) { |
| - DisableBackoffThrottling(); |
| - if (manager_) |
| - manager_->AddToOptOutList(host); |
| - } |
| -} |
| - |
| const BackoffEntry* URLRequestThrottlerEntry::GetBackoffEntry() const { |
| return &backoff_entry_; |
| } |