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

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, 10 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 937ee094336da3a9f92f2a9422c9485cf6c17182..4962eb77f21768eeca3e89de13e487d1e1e4d00b 100644
--- a/net/base/upload_data_stream.cc
+++ b/net/base/upload_data_stream.cc
@@ -31,7 +31,7 @@ UploadDataStream::~UploadDataStream() {
int UploadDataStream::Init() {
DCHECK(!initialized_successfully_);
- total_size_ = upload_data_->GetContentLength();
+ total_size_ = upload_data_->GetContentLengthSyncHack();
// If the underlying file has been changed and the expected file
// modification time is set, treat it as error. Note that the expected
@@ -98,6 +98,8 @@ int UploadDataStream::Read(IOBuffer* buf, int buf_len) {
// Open the file of the current element if not yet opened.
if (!element_file_stream_.get()) {
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