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

Unified Diff: chrome/browser/automation/url_request_automation_job.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
Index: chrome/browser/automation/url_request_automation_job.cc
diff --git a/chrome/browser/automation/url_request_automation_job.cc b/chrome/browser/automation/url_request_automation_job.cc
index 8b41e57c54151dc9dada0ffb5736f99c6e652651..c985ff4f64593619fc432a758eb734419ce76a2e 100644
--- a/chrome/browser/automation/url_request_automation_job.cc
+++ b/chrome/browser/automation/url_request_automation_job.cc
@@ -229,17 +229,22 @@ bool URLRequestAutomationJob::IsRedirectResponse(
return true;
}
-uint64 URLRequestAutomationJob::GetUploadProgress() const {
- if (request_ && request_->status().is_success()) {
+net::UploadProgress URLRequestAutomationJob::GetUploadProgress() const {
+ if (!request_)
+ return net::UploadProgress();
+
+ const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request_);
+ if (!info)
+ return net::UploadProgress();
+
+ const uint64 size = info->GetUploadSize();
+ if (request_->status().is_success()) {
// We don't support incremental progress notifications in ChromeFrame. When
// we receive a response for the POST request from Chromeframe, it means
// that the upload is fully complete.
- const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request_);
- if (info) {
- return info->GetUploadSize();
- }
+ return net::UploadProgress(size, size);
}
- return 0;
+ return net::UploadProgress(0, size);
}
net::HostPortPair URLRequestAutomationJob::GetSocketAddress() const {
« no previous file with comments | « chrome/browser/automation/url_request_automation_job.h ('k') | content/browser/renderer_host/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698