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

Unified Diff: net/url_request/url_request_throttler_entry.cc

Issue 1148603003: Remove X-Chrome-Exponential-Throttling header (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 5 years, 7 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
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_;
}
« no previous file with comments | « net/url_request/url_request_throttler_entry.h ('k') | net/url_request/url_request_throttler_entry_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698