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

Unified Diff: net/url_request/url_request_throttler_manager.cc

Issue 1148603003: Remove X-Chrome-Exponential-Throttling header (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments 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_manager.cc
diff --git a/net/url_request/url_request_throttler_manager.cc b/net/url_request/url_request_throttler_manager.cc
index 7eede6f62bb6be60e52c6337c1ee5ff97a50f503..6bf3f5440441436b64fd831d2b431f94764aefed 100644
--- a/net/url_request/url_request_throttler_manager.cc
+++ b/net/url_request/url_request_throttler_manager.cc
@@ -75,12 +75,9 @@ scoped_refptr<URLRequestThrottlerEntryInterface>
// We only disable back-off throttling on an entry that we have
// just constructed. This is to allow unit tests to explicitly override
- // the entry for localhost URLs. Given that we do not attempt to
- // disable throttling for entries already handed out (see comment
- // in AddToOptOutList), this is not a problem.
+ // the entry for localhost URLs.
std::string host = url.host();
- if (opt_out_hosts_.find(host) != opt_out_hosts_.end() ||
- IsLocalhost(host)) {
+ if (IsLocalhost(host)) {
if (!logged_for_localhost_disabled_ && IsLocalhost(host)) {
logged_for_localhost_disabled_ = true;
net_log_.AddEvent(NetLog::TYPE_THROTTLING_DISABLED_FOR_HOST,
@@ -89,8 +86,7 @@ scoped_refptr<URLRequestThrottlerEntryInterface>
// TODO(joi): Once sliding window is separate from back-off throttling,
// we can simply return a dummy implementation of
- // URLRequestThrottlerEntryInterface here that never blocks anything (and
- // not keep entries in url_entries_ for opted-out sites).
+ // URLRequestThrottlerEntryInterface here that never blocks anything.
entry->DisableBackoffThrottling();
}
}
@@ -98,21 +94,6 @@ scoped_refptr<URLRequestThrottlerEntryInterface>
return entry;
}
-void URLRequestThrottlerManager::AddToOptOutList(const std::string& host) {
- // There is an edge case here that we are not handling, to keep things
- // simple. If a host starts adding the opt-out header to its responses
- // after there are already one or more entries in url_entries_ for that
- // host, the pre-existing entries may still perform back-off throttling.
- // In practice, this would almost never occur.
- if (opt_out_hosts_.find(host) == opt_out_hosts_.end()) {
- UMA_HISTOGRAM_COUNTS("Throttling.SiteOptedOut", 1);
-
- net_log_.EndEvent(NetLog::TYPE_THROTTLING_DISABLED_FOR_HOST,
- NetLog::StringCallback("host", &host));
- opt_out_hosts_.insert(host);
- }
-}
-
void URLRequestThrottlerManager::OverrideEntryForTests(
const GURL& url,
URLRequestThrottlerEntry* entry) {
« no previous file with comments | « net/url_request/url_request_throttler_manager.h ('k') | net/url_request/url_request_throttler_simulation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698