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

Unified Diff: net/url_request/url_request.cc

Issue 10830182: net: Return size of upload as well as position from URLRequest::GetUploadProgress() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 8 years, 4 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/url_request/url_request.h ('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 65dabe908c0f9cbc1cfe9a1095ec703e7e57759c..6f578a3fb1d8eb54c4053127caf948a8b3a01cb3 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -146,7 +146,6 @@ URLRequest::URLRequest(const GURL& url,
delegate_(delegate),
is_pending_(false),
redirect_limit_(kMaxRedirects),
- final_upload_progress_(0),
priority_(LOWEST),
identifier_(GenerateURLRequestIdentifier()),
blocked_on_delegate_(false),
@@ -286,12 +285,12 @@ LoadStateWithParam URLRequest::GetLoadState() const {
string16());
}
-uint64 URLRequest::GetUploadProgress() const {
+UploadProgress URLRequest::GetUploadProgress() const {
if (!job_) {
// We haven't started or the request was cancelled
- return 0;
+ return UploadProgress();
}
- if (final_upload_progress_) {
+ 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.
@@ -744,7 +743,7 @@ int URLRequest::Redirect(const GURL& location, int http_status_code) {
url_chain_.push_back(location);
--redirect_limit_;
- if (!final_upload_progress_)
+ if (!final_upload_progress_.position)
final_upload_progress_ = job_->GetUploadProgress();
PrepareToRestart();
« no previous file with comments | « net/url_request/url_request.h ('k') | net/url_request/url_request_ftp_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698