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

Unified Diff: content/browser/renderer_host/resource_loader.cc

Issue 10825073: Stop using ScopedAllowIO in content::ResourceDispatcherHostImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove const 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: content/browser/renderer_host/resource_loader.cc
diff --git a/content/browser/renderer_host/resource_loader.cc b/content/browser/renderer_host/resource_loader.cc
index e928724af95f21d29d388deb26cd3fa196ac4d71..0cbc45569af852605b175c94c2c09cb4e46e4dcd 100644
--- a/content/browser/renderer_host/resource_loader.cc
+++ b/content/browser/renderer_host/resource_loader.cc
@@ -107,31 +107,32 @@ void ResourceLoader::ReportUploadProgress() {
if (waiting_for_upload_progress_ack_)
return; // Send one progress event at a time.
- uint64 size = info->GetUploadSize();
- if (!size)
+ net::UploadProgress progress = request_->GetUploadProgress();
+ if (!progress.size())
return; // Nothing to upload.
- uint64 position = request_->GetUploadProgress();
- if (position == last_upload_position_)
+ if (progress.position() == last_upload_position_)
return; // No progress made since last time.
const uint64 kHalfPercentIncrements = 200;
const TimeDelta kOneSecond = TimeDelta::FromMilliseconds(1000);
- uint64 amt_since_last = position - last_upload_position_;
+ uint64 amt_since_last = progress.position() - last_upload_position_;
TimeDelta time_since_last = TimeTicks::Now() - last_upload_ticks_;
- bool is_finished = (size == position);
- bool enough_new_progress = (amt_since_last > (size / kHalfPercentIncrements));
+ bool is_finished = (progress.size() == progress.position());
+ bool enough_new_progress =
+ (amt_since_last > (progress.size() / kHalfPercentIncrements));
bool too_much_time_passed = time_since_last > kOneSecond;
if (is_finished || enough_new_progress || too_much_time_passed) {
if (request_->load_flags() & net::LOAD_ENABLE_UPLOAD_PROGRESS) {
- handler_->OnUploadProgress(info->GetRequestID(), position, size);
+ handler_->OnUploadProgress(
+ info->GetRequestID(), progress.position(), progress.size());
waiting_for_upload_progress_ack_ = true;
}
last_upload_ticks_ = TimeTicks::Now();
- last_upload_position_ = position;
+ last_upload_position_ = progress.position();
}
}

Powered by Google App Engine
This is Rietveld 408576698