| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 void URLRequestHttpJob::Kill() { | 281 void URLRequestHttpJob::Kill() { |
| 282 if (!transaction_.get()) | 282 if (!transaction_.get()) |
| 283 return; | 283 return; |
| 284 | 284 |
| 285 weak_factory_.InvalidateWeakPtrs(); | 285 weak_factory_.InvalidateWeakPtrs(); |
| 286 DestroyTransaction(); | 286 DestroyTransaction(); |
| 287 URLRequestJob::Kill(); | 287 URLRequestJob::Kill(); |
| 288 } | 288 } |
| 289 | 289 |
| 290 void URLRequestHttpJob::NotifyBeforeSendProxyHeadersCallback( | 290 void URLRequestHttpJob::NotifyBeforeSendProxyHeadersCallback( |
| 291 const ProxyInfo& proxy_info) { | 291 const ProxyInfo& proxy_info, |
| 292 HttpRequestHeaders* request_headers) { |
| 293 DCHECK(request_headers); |
| 292 DCHECK_NE(URLRequestStatus::CANCELED, GetStatus().status()); | 294 DCHECK_NE(URLRequestStatus::CANCELED, GetStatus().status()); |
| 293 if (network_delegate()) { | 295 if (network_delegate()) { |
| 294 network_delegate()->NotifyBeforeSendProxyHeaders( | 296 network_delegate()->NotifyBeforeSendProxyHeaders( |
| 295 request_, | 297 request_, |
| 296 proxy_info, | 298 proxy_info, |
| 297 &request_info_.extra_headers); | 299 request_headers); |
| 298 } | 300 } |
| 299 } | 301 } |
| 300 | 302 |
| 301 void URLRequestHttpJob::NotifyHeadersComplete() { | 303 void URLRequestHttpJob::NotifyHeadersComplete() { |
| 302 DCHECK(!response_info_); | 304 DCHECK(!response_info_); |
| 303 | 305 |
| 304 response_info_ = transaction_->GetResponseInfo(); | 306 response_info_ = transaction_->GetResponseInfo(); |
| 305 | 307 |
| 306 // Save boolean, as we'll need this info at destruction time, and filters may | 308 // Save boolean, as we'll need this info at destruction time, and filters may |
| 307 // also need this info. | 309 // also need this info. |
| (...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1520 return override_response_headers_.get() ? | 1522 return override_response_headers_.get() ? |
| 1521 override_response_headers_.get() : | 1523 override_response_headers_.get() : |
| 1522 transaction_->GetResponseInfo()->headers.get(); | 1524 transaction_->GetResponseInfo()->headers.get(); |
| 1523 } | 1525 } |
| 1524 | 1526 |
| 1525 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1527 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
| 1526 awaiting_callback_ = false; | 1528 awaiting_callback_ = false; |
| 1527 } | 1529 } |
| 1528 | 1530 |
| 1529 } // namespace net | 1531 } // namespace net |
| OLD | NEW |