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 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 request_info_.upload_data_stream = upload; | 1013 request_info_.upload_data_stream = upload; |
1014 } | 1014 } |
1015 | 1015 |
1016 void URLRequestHttpJob::SetExtraRequestHeaders( | 1016 void URLRequestHttpJob::SetExtraRequestHeaders( |
1017 const HttpRequestHeaders& headers) { | 1017 const HttpRequestHeaders& headers) { |
1018 DCHECK(!transaction_.get()) << "cannot change once started"; | 1018 DCHECK(!transaction_.get()) << "cannot change once started"; |
1019 request_info_.extra_headers.CopyFrom(headers); | 1019 request_info_.extra_headers.CopyFrom(headers); |
1020 } | 1020 } |
1021 | 1021 |
1022 LoadState URLRequestHttpJob::GetLoadState() const { | 1022 LoadState URLRequestHttpJob::GetLoadState() const { |
| 1023 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455952 is |
| 1024 // fixed. |
| 1025 tracked_objects::ScopedTracker tracking_profile( |
| 1026 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 1027 "455952 URLRequestHttpJob::GetLoadState")); |
1023 return transaction_.get() ? | 1028 return transaction_.get() ? |
1024 transaction_->GetLoadState() : LOAD_STATE_IDLE; | 1029 transaction_->GetLoadState() : LOAD_STATE_IDLE; |
1025 } | 1030 } |
1026 | 1031 |
1027 UploadProgress URLRequestHttpJob::GetUploadProgress() const { | 1032 UploadProgress URLRequestHttpJob::GetUploadProgress() const { |
1028 return transaction_.get() ? | 1033 return transaction_.get() ? |
1029 transaction_->GetUploadProgress() : UploadProgress(); | 1034 transaction_->GetUploadProgress() : UploadProgress(); |
1030 } | 1035 } |
1031 | 1036 |
1032 bool URLRequestHttpJob::GetMimeType(std::string* mime_type) const { | 1037 bool URLRequestHttpJob::GetMimeType(std::string* mime_type) const { |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1598 return override_response_headers_.get() ? | 1603 return override_response_headers_.get() ? |
1599 override_response_headers_.get() : | 1604 override_response_headers_.get() : |
1600 transaction_->GetResponseInfo()->headers.get(); | 1605 transaction_->GetResponseInfo()->headers.get(); |
1601 } | 1606 } |
1602 | 1607 |
1603 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1608 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
1604 awaiting_callback_ = false; | 1609 awaiting_callback_ = false; |
1605 } | 1610 } |
1606 | 1611 |
1607 } // namespace net | 1612 } // namespace net |
OLD | NEW |