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

Unified Diff: net/base/upload_data_stream.cc

Issue 9321003: net: Make UploadData::GetContentLength() asynchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 11 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: net/base/upload_data_stream.cc
diff --git a/net/base/upload_data_stream.cc b/net/base/upload_data_stream.cc
index 550a117e90a253927c304a28b658c36b1f0b9ebc..181b3f7ba9bcf27c9b60dce5afbdb45fb00955ed 100644
--- a/net/base/upload_data_stream.cc
+++ b/net/base/upload_data_stream.cc
@@ -22,7 +22,7 @@ UploadDataStream::~UploadDataStream() {
int UploadDataStream::Init() {
DCHECK(!initialized_successfully_);
- total_size_ = upload_data_->GetContentLength();
+ total_size_ = upload_data_->GetContentLengthSyncHack();
const int result = FillBuffer();
initialized_successfully_ = (result == OK);
return result;
@@ -114,6 +114,8 @@ int UploadDataStream::FillBuffer() {
}
}
element_file_bytes_remaining_ = element.GetContentLength();
+ // Temporarily allow until fix: http://crbug.com/72001.
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
element_file_stream_.reset(element.NewFileStreamForReading());
}

Powered by Google App Engine
This is Rietveld 408576698