Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Unified Diff: net/url_request/url_request.cc

Issue 2330983002: Removes get upload progress plumbing. URLRequest queries the UploadDataStream directly. (Closed)
Patch Set: Feedback incorporated. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_http_stream_unittest.cc ('k') | net/url_request/url_request_ftp_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e97b5260400c46eda184598929a425387a85a805 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -356,13 +356,18 @@ UploadProgress URLRequest::GetUploadProgress() const {
// We haven't started or the request was cancelled
return UploadProgress();
}
+
if (final_upload_progress_.position()) {
// The first job completed and none of the subsequent series of
// GETs when following redirects will upload anything, so we return the
// cached results from the initial job, the POST.
return final_upload_progress_;
}
- return job_->GetUploadProgress();
+
+ if (upload_data_stream_)
+ return upload_data_stream_->GetUploadProgress();
+
+ return UploadProgress();
}
void URLRequest::GetResponseHeaderByName(const string& name,
@@ -961,8 +966,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_) {
« no previous file with comments | « net/spdy/spdy_http_stream_unittest.cc ('k') | net/url_request/url_request_ftp_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698