Add an opt-out header for HTTP throttling. Never throttle for localhost.
Added net::IsLocalhost() function to net/base/net_utils.h
Unit tests for the above. Also fix flakiness in the ReceivedContentMalformed test that was caused by non-zero jitter.
Modify back-off policy to ignore first 4 errors to help avoid back-off from erroneously kicking in on flaky connections. Make maximum back-off period 15 minutes instead of 60. Added documentation of results of analyzing behavior this new policy will give.
Add a simple server for manual testing of the throttling feature.
BUG=66062
TEST=net_unittests
Review URL: http://codereview.chromium.org/6711046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79464 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index a51e239..68212eb 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -248,7 +248,8 @@
if (!is_cached_content_) {
URLRequestThrottlerHeaderAdapter response_adapter(
response_info_->headers);
- throttling_entry_->UpdateWithResponse(&response_adapter);
+ throttling_entry_->UpdateWithResponse(request_info_.url.host(),
+ &response_adapter);
}
ProcessStrictTransportSecurityHeader();