Chromium Code Reviews| Index: net/url_request/url_request.cc |
| diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc |
| index 593ee18a382dc3974b9d9a3fd4d10e7837a94ea2..37d8139795c4d7dfd408e70a320d64148b0270ad 100644 |
| --- a/net/url_request/url_request.cc |
| +++ b/net/url_request/url_request.cc |
| @@ -362,7 +362,10 @@ UploadProgress URLRequest::GetUploadProgress() const { |
| // cached results from the initial job, the POST. |
| return final_upload_progress_; |
| } |
| - return job_->GetUploadProgress(); |
| + if (upload_data_stream_) { |
| + return upload_data_stream_->GetUploadProgress(); |
| + } |
|
mmenke
2016/09/12 19:35:31
nit: Don't use braces on single-line if.
shivanisha
2016/09/14 20:40:25
done.
|
| + return UploadProgress(); |
| } |
| void URLRequest::GetResponseHeaderByName(const string& name, |
| @@ -961,8 +964,8 @@ int URLRequest::Redirect(const RedirectInfo& redirect_info) { |
| return ERR_UNSAFE_REDIRECT; |
| } |
| - if (!final_upload_progress_.position()) |
| - final_upload_progress_ = job_->GetUploadProgress(); |
| + if (!final_upload_progress_.position() && upload_data_stream_) |
| + final_upload_progress_ = upload_data_stream_->GetUploadProgress(); |
| PrepareToRestart(); |
| if (redirect_info.new_method != method_) { |