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

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: Update copyright years. 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 response_info_ = transaction_->GetResponseInfo(); 153 response_info_ = transaction_->GetResponseInfo();
154 154
155 // Save boolean, as we'll need this info at destruction time, and filters may 155 // Save boolean, as we'll need this info at destruction time, and filters may
156 // also need this info. 156 // also need this info.
157 is_cached_content_ = response_info_->was_cached; 157 is_cached_content_ = response_info_->was_cached;
158 158
159 if (!is_cached_content_) { 159 if (!is_cached_content_) {
160 URLRequestThrottlerHeaderAdapter response_adapter( 160 URLRequestThrottlerHeaderAdapter response_adapter(
161 response_info_->headers); 161 response_info_->headers);
162 throttling_entry_->UpdateWithResponse(&response_adapter); 162 throttling_entry_->UpdateWithResponse(request_info_.url.host(),
yzshen1 2011/03/18 22:49:51 A throttling entry is used for a specific URL (and
Jói 2011/03/23 23:38:24 Storing the host would increase the required stora
yzshen1 2011/03/24 20:06:37 Okay. On 2011/03/23 23:38:24, Jói wrote:
163 &response_adapter);
163 } 164 }
164 165
165 ProcessStrictTransportSecurityHeader(); 166 ProcessStrictTransportSecurityHeader();
166 167
167 if (SdchManager::Global() && 168 if (SdchManager::Global() &&
168 SdchManager::Global()->IsInSupportedDomain(request_->url())) { 169 SdchManager::Global()->IsInSupportedDomain(request_->url())) {
169 static const std::string name = "Get-Dictionary"; 170 static const std::string name = "Get-Dictionary";
170 std::string url_text; 171 std::string url_text;
171 void* iter = NULL; 172 void* iter = NULL;
172 // TODO(jar): We need to not fetch dictionaries the first time they are 173 // TODO(jar): We need to not fetch dictionaries the first time they are
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 void URLRequestHttpJob::ResetTimer() { 994 void URLRequestHttpJob::ResetTimer() {
994 if (!request_creation_time_.is_null()) { 995 if (!request_creation_time_.is_null()) {
995 NOTREACHED() 996 NOTREACHED()
996 << "The timer was reset before it was recorded."; 997 << "The timer was reset before it was recorded.";
997 return; 998 return;
998 } 999 }
999 request_creation_time_ = base::Time::Now(); 1000 request_creation_time_ = base::Time::Now();
1000 } 1001 }
1001 1002
1002 } // namespace net 1003 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698