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

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: Merge to head. 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 response_info_ = transaction_->GetResponseInfo(); 242 response_info_ = transaction_->GetResponseInfo();
243 243
244 // Save boolean, as we'll need this info at destruction time, and filters may 244 // Save boolean, as we'll need this info at destruction time, and filters may
245 // also need this info. 245 // also need this info.
246 is_cached_content_ = response_info_->was_cached; 246 is_cached_content_ = response_info_->was_cached;
247 247
248 if (!is_cached_content_) { 248 if (!is_cached_content_) {
249 URLRequestThrottlerHeaderAdapter response_adapter( 249 URLRequestThrottlerHeaderAdapter response_adapter(
250 response_info_->headers); 250 response_info_->headers);
251 throttling_entry_->UpdateWithResponse(&response_adapter); 251 throttling_entry_->UpdateWithResponse(request_info_.url.host(),
252 &response_adapter);
252 } 253 }
253 254
254 ProcessStrictTransportSecurityHeader(); 255 ProcessStrictTransportSecurityHeader();
255 256
256 if (SdchManager::Global() && 257 if (SdchManager::Global() &&
257 SdchManager::Global()->IsInSupportedDomain(request_->url())) { 258 SdchManager::Global()->IsInSupportedDomain(request_->url())) {
258 static const std::string name = "Get-Dictionary"; 259 static const std::string name = "Get-Dictionary";
259 std::string url_text; 260 std::string url_text;
260 void* iter = NULL; 261 void* iter = NULL;
261 // TODO(jar): We need to not fetch dictionaries the first time they are 262 // TODO(jar): We need to not fetch dictionaries the first time they are
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 } 1348 }
1348 1349
1349 bool URLRequestHttpJob::IsCompressibleContent() const { 1350 bool URLRequestHttpJob::IsCompressibleContent() const {
1350 std::string mime_type; 1351 std::string mime_type;
1351 return GetMimeType(&mime_type) && 1352 return GetMimeType(&mime_type) &&
1352 (IsSupportedJavascriptMimeType(mime_type.c_str()) || 1353 (IsSupportedJavascriptMimeType(mime_type.c_str()) ||
1353 IsSupportedNonImageMimeType(mime_type.c_str())); 1354 IsSupportedNonImageMimeType(mime_type.c_str()));
1354 } 1355 }
1355 1356
1356 } // namespace net 1357 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698