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

Side by Side Diff: net/url_request/url_request_http_job.cc

Issue 6711046: Add an opt-out header for HTTP throttling. Never throttle for localhost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments. Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/url_request/url_request_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 response_info_ = transaction_->GetResponseInfo(); 204 response_info_ = transaction_->GetResponseInfo();
205 205
206 // Save boolean, as we'll need this info at destruction time, and filters may 206 // Save boolean, as we'll need this info at destruction time, and filters may
207 // also need this info. 207 // also need this info.
208 is_cached_content_ = response_info_->was_cached; 208 is_cached_content_ = response_info_->was_cached;
209 209
210 if (!is_cached_content_) { 210 if (!is_cached_content_) {
211 URLRequestThrottlerHeaderAdapter response_adapter( 211 URLRequestThrottlerHeaderAdapter response_adapter(
212 response_info_->headers); 212 response_info_->headers);
213 throttling_entry_->UpdateWithResponse(&response_adapter); 213 throttling_entry_->UpdateWithResponse(request_info_.url.host(),
214 &response_adapter);
214 } 215 }
215 216
216 ProcessStrictTransportSecurityHeader(); 217 ProcessStrictTransportSecurityHeader();
217 218
218 if (SdchManager::Global() && 219 if (SdchManager::Global() &&
219 SdchManager::Global()->IsInSupportedDomain(request_->url())) { 220 SdchManager::Global()->IsInSupportedDomain(request_->url())) {
220 static const std::string name = "Get-Dictionary"; 221 static const std::string name = "Get-Dictionary";
221 std::string url_text; 222 std::string url_text;
222 void* iter = NULL; 223 void* iter = NULL;
223 // TODO(jar): We need to not fetch dictionaries the first time they are 224 // TODO(jar): We need to not fetch dictionaries the first time they are
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 void URLRequestHttpJob::ResetTimer() { 1073 void URLRequestHttpJob::ResetTimer() {
1073 if (!request_creation_time_.is_null()) { 1074 if (!request_creation_time_.is_null()) {
1074 NOTREACHED() 1075 NOTREACHED()
1075 << "The timer was reset before it was recorded."; 1076 << "The timer was reset before it was recorded.";
1076 return; 1077 return;
1077 } 1078 }
1078 request_creation_time_ = base::Time::Now(); 1079 request_creation_time_ = base::Time::Now();
1079 } 1080 }
1080 1081
1081 } // namespace net 1082 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698