OLD | NEW |
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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 username_.clear(); | 390 username_.clear(); |
391 password_.clear(); | 391 password_.clear(); |
392 } else { | 392 } else { |
393 DCHECK(request_->context()); | 393 DCHECK(request_->context()); |
394 DCHECK(request_->context()->http_transaction_factory()); | 394 DCHECK(request_->context()->http_transaction_factory()); |
395 | 395 |
396 rv = request_->context()->http_transaction_factory()->CreateTransaction( | 396 rv = request_->context()->http_transaction_factory()->CreateTransaction( |
397 &transaction_); | 397 &transaction_); |
398 if (rv == OK) { | 398 if (rv == OK) { |
399 if (!URLRequestThrottlerManager::GetInstance()->enforce_throttling() || | 399 if (!URLRequestThrottlerManager::GetInstance()->enforce_throttling() || |
400 !throttling_entry_->IsDuringExponentialBackoff()) { | 400 !throttling_entry_->ShouldRejectRequest(request_info_.load_flags)) { |
401 rv = transaction_->Start( | 401 rv = transaction_->Start( |
402 &request_info_, &start_callback_, request_->net_log()); | 402 &request_info_, &start_callback_, request_->net_log()); |
403 start_time_ = base::TimeTicks::Now(); | 403 start_time_ = base::TimeTicks::Now(); |
404 } else { | 404 } else { |
405 // Special error code for the exponential back-off module. | 405 // Special error code for the exponential back-off module. |
406 rv = ERR_TEMPORARILY_THROTTLED; | 406 rv = ERR_TEMPORARILY_THROTTLED; |
407 } | 407 } |
408 // Make sure the context is alive for the duration of the | 408 // Make sure the context is alive for the duration of the |
409 // transaction. | 409 // transaction. |
410 context_ = request_->context(); | 410 context_ = request_->context(); |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 if (done_) | 1477 if (done_) |
1478 return; | 1478 return; |
1479 done_ = true; | 1479 done_ = true; |
1480 | 1480 |
1481 RecordPerfHistograms(reason); | 1481 RecordPerfHistograms(reason); |
1482 if (reason == FINISHED) | 1482 if (reason == FINISHED) |
1483 RecordCompressionHistograms(); | 1483 RecordCompressionHistograms(); |
1484 } | 1484 } |
1485 | 1485 |
1486 } // namespace net | 1486 } // namespace net |
OLD | NEW |