| 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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 } | 441 } |
| 442 | 442 |
| 443 if (rv == OK) { | 443 if (rv == OK) { |
| 444 transaction_->SetBeforeNetworkStartCallback( | 444 transaction_->SetBeforeNetworkStartCallback( |
| 445 base::Bind(&URLRequestHttpJob::NotifyBeforeNetworkStart, | 445 base::Bind(&URLRequestHttpJob::NotifyBeforeNetworkStart, |
| 446 base::Unretained(this))); | 446 base::Unretained(this))); |
| 447 transaction_->SetBeforeProxyHeadersSentCallback( | 447 transaction_->SetBeforeProxyHeadersSentCallback( |
| 448 base::Bind(&URLRequestHttpJob::NotifyBeforeSendProxyHeadersCallback, | 448 base::Bind(&URLRequestHttpJob::NotifyBeforeSendProxyHeadersCallback, |
| 449 base::Unretained(this))); | 449 base::Unretained(this))); |
| 450 | 450 |
| 451 if (!throttling_entry_.get() || | 451 if (!throttling_entry_ || |
| 452 !throttling_entry_->ShouldRejectRequest(*request_)) { | 452 !throttling_entry_->ShouldRejectRequest( |
| 453 *request_, network_delegate())) { |
| 453 rv = transaction_->Start( | 454 rv = transaction_->Start( |
| 454 &request_info_, start_callback_, request_->net_log()); | 455 &request_info_, start_callback_, request_->net_log()); |
| 455 start_time_ = base::TimeTicks::Now(); | 456 start_time_ = base::TimeTicks::Now(); |
| 456 } else { | 457 } else { |
| 457 // Special error code for the exponential back-off module. | 458 // Special error code for the exponential back-off module. |
| 458 rv = ERR_TEMPORARILY_THROTTLED; | 459 rv = ERR_TEMPORARILY_THROTTLED; |
| 459 } | 460 } |
| 460 } | 461 } |
| 461 } | 462 } |
| 462 | 463 |
| (...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1523 return override_response_headers_.get() ? | 1524 return override_response_headers_.get() ? |
| 1524 override_response_headers_.get() : | 1525 override_response_headers_.get() : |
| 1525 transaction_->GetResponseInfo()->headers.get(); | 1526 transaction_->GetResponseInfo()->headers.get(); |
| 1526 } | 1527 } |
| 1527 | 1528 |
| 1528 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1529 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
| 1529 awaiting_callback_ = false; | 1530 awaiting_callback_ = false; |
| 1530 } | 1531 } |
| 1531 | 1532 |
| 1532 } // namespace net | 1533 } // namespace net |
| OLD | NEW |