| 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 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 weak_factory_.InvalidateWeakPtrs(); | 886 weak_factory_.InvalidateWeakPtrs(); |
| 887 DestroyTransaction(); | 887 DestroyTransaction(); |
| 888 URLRequestJob::Kill(); | 888 URLRequestJob::Kill(); |
| 889 } | 889 } |
| 890 | 890 |
| 891 LoadState URLRequestHttpJob::GetLoadState() const { | 891 LoadState URLRequestHttpJob::GetLoadState() const { |
| 892 return transaction_.get() ? | 892 return transaction_.get() ? |
| 893 transaction_->GetLoadState() : LOAD_STATE_IDLE; | 893 transaction_->GetLoadState() : LOAD_STATE_IDLE; |
| 894 } | 894 } |
| 895 | 895 |
| 896 uint64 URLRequestHttpJob::GetUploadProgress() const { | 896 UploadProgress URLRequestHttpJob::GetUploadProgress() const { |
| 897 return transaction_.get() ? transaction_->GetUploadProgress().position : 0; | 897 return transaction_.get() ? |
| 898 transaction_->GetUploadProgress() : UploadProgress(); |
| 898 } | 899 } |
| 899 | 900 |
| 900 bool URLRequestHttpJob::GetMimeType(std::string* mime_type) const { | 901 bool URLRequestHttpJob::GetMimeType(std::string* mime_type) const { |
| 901 DCHECK(transaction_.get()); | 902 DCHECK(transaction_.get()); |
| 902 | 903 |
| 903 if (!response_info_) | 904 if (!response_info_) |
| 904 return false; | 905 return false; |
| 905 | 906 |
| 906 return GetResponseHeaders()->GetMimeType(mime_type); | 907 return GetResponseHeaders()->GetMimeType(mime_type); |
| 907 } | 908 } |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 | 1468 |
| 1468 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1469 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
| 1469 awaiting_callback_ = false; | 1470 awaiting_callback_ = false; |
| 1470 } | 1471 } |
| 1471 | 1472 |
| 1472 void URLRequestHttpJob::OnDetachRequest() { | 1473 void URLRequestHttpJob::OnDetachRequest() { |
| 1473 http_transaction_delegate_->OnDetachRequest(); | 1474 http_transaction_delegate_->OnDetachRequest(); |
| 1474 } | 1475 } |
| 1475 | 1476 |
| 1476 } // namespace net | 1477 } // namespace net |
| OLD | NEW |