| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 } | 439 } |
| 440 | 440 |
| 441 if (rv == OK) { | 441 if (rv == OK) { |
| 442 transaction_->SetBeforeNetworkStartCallback( | 442 transaction_->SetBeforeNetworkStartCallback( |
| 443 base::Bind(&URLRequestHttpJob::NotifyBeforeNetworkStart, | 443 base::Bind(&URLRequestHttpJob::NotifyBeforeNetworkStart, |
| 444 base::Unretained(this))); | 444 base::Unretained(this))); |
| 445 transaction_->SetBeforeProxyHeadersSentCallback( | 445 transaction_->SetBeforeProxyHeadersSentCallback( |
| 446 base::Bind(&URLRequestHttpJob::NotifyBeforeSendProxyHeadersCallback, | 446 base::Bind(&URLRequestHttpJob::NotifyBeforeSendProxyHeadersCallback, |
| 447 base::Unretained(this))); | 447 base::Unretained(this))); |
| 448 | 448 |
| 449 if (!throttling_entry_.get() || | 449 if (!throttling_entry_ || |
| 450 !throttling_entry_->ShouldRejectRequest(*request_)) { | 450 !throttling_entry_->ShouldRejectRequest( |
| 451 *request_, network_delegate())) { |
| 451 rv = transaction_->Start( | 452 rv = transaction_->Start( |
| 452 &request_info_, start_callback_, request_->net_log()); | 453 &request_info_, start_callback_, request_->net_log()); |
| 453 start_time_ = base::TimeTicks::Now(); | 454 start_time_ = base::TimeTicks::Now(); |
| 454 } else { | 455 } else { |
| 455 // Special error code for the exponential back-off module. | 456 // Special error code for the exponential back-off module. |
| 456 rv = ERR_TEMPORARILY_THROTTLED; | 457 rv = ERR_TEMPORARILY_THROTTLED; |
| 457 } | 458 } |
| 458 } | 459 } |
| 459 } | 460 } |
| 460 | 461 |
| (...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1521 return override_response_headers_.get() ? | 1522 return override_response_headers_.get() ? |
| 1522 override_response_headers_.get() : | 1523 override_response_headers_.get() : |
| 1523 transaction_->GetResponseInfo()->headers.get(); | 1524 transaction_->GetResponseInfo()->headers.get(); |
| 1524 } | 1525 } |
| 1525 | 1526 |
| 1526 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1527 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
| 1527 awaiting_callback_ = false; | 1528 awaiting_callback_ = false; |
| 1528 } | 1529 } |
| 1529 | 1530 |
| 1530 } // namespace net | 1531 } // namespace net |
| OLD | NEW |