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

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

Issue 5961008: Give user the ability to disable the URL request throttler:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 12 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
« no previous file with comments | « chrome/renderer/localized_error.cc ('k') | net/url_request/url_request_throttler_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 rv = transaction_->RestartWithAuth(username_, password_, &start_callback_); 689 rv = transaction_->RestartWithAuth(username_, password_, &start_callback_);
690 username_.clear(); 690 username_.clear();
691 password_.clear(); 691 password_.clear();
692 } else { 692 } else {
693 DCHECK(request_->context()); 693 DCHECK(request_->context());
694 DCHECK(request_->context()->http_transaction_factory()); 694 DCHECK(request_->context()->http_transaction_factory());
695 695
696 rv = request_->context()->http_transaction_factory()->CreateTransaction( 696 rv = request_->context()->http_transaction_factory()->CreateTransaction(
697 &transaction_); 697 &transaction_);
698 if (rv == OK) { 698 if (rv == OK) {
699 if (!throttling_entry_->IsDuringExponentialBackoff()) { 699 if (!throttling_entry_->IsDuringExponentialBackoff() ||
700 !net::URLRequestThrottlerManager::GetInstance()->
701 enforce_throttling()) {
700 rv = transaction_->Start( 702 rv = transaction_->Start(
701 &request_info_, &start_callback_, request_->net_log()); 703 &request_info_, &start_callback_, request_->net_log());
702 } else { 704 } else {
703 // Special error code for the exponential back-off module. 705 // Special error code for the exponential back-off module.
704 rv = ERR_TEMPORARILY_THROTTLED; 706 rv = ERR_TEMPORARILY_THROTTLED;
705 } 707 }
706 // Make sure the context is alive for the duration of the 708 // Make sure the context is alive for the duration of the
707 // transaction. 709 // transaction.
708 context_ = request_->context(); 710 context_ = request_->context();
709 } 711 }
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 include_subdomains, 960 include_subdomains,
959 ctx->transport_security_state()); 961 ctx->transport_security_state());
960 if (!prober->ProbeHost(request_info_.url.host(), request()->context(), 962 if (!prober->ProbeHost(request_info_.url.host(), request()->context(),
961 delegate)) { 963 delegate)) {
962 delete delegate; 964 delete delegate;
963 } 965 }
964 } 966 }
965 } 967 }
966 968
967 } // namespace net 969 } // namespace net
OLDNEW
« no previous file with comments | « chrome/renderer/localized_error.cc ('k') | net/url_request/url_request_throttler_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698