Comment #26 on issue 128574 by
sato...@chromium.org: Fileupload using html
I created a patch for the fix, and got this now: "Yay, non-zero" from
thomas's server. Now working on a test...
% git diff
diff --git a/net/base/upload_data.cc b/net/base/upload_data.cc
index 71d77ae..1c7ee20 100644
--- a/net/base/upload_data.cc
+++ b/net/base/upload_data.cc
@@ -114,6 +114,17 @@ uint64 UploadData::Element::BytesRemaining() {
return GetContentLength() - offset_;
}
+void UploadData::Element::ResetOffset() {
+ if (file_stream_) {
+ // Temporarily allow until fix:
http://crbug.com/72001.
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+ file_stream_->CloseSync();
+ delete file_stream_;
+ file_stream_ = NULL;
+ }
+ offset_ = 0;
+}
+
FileStream* UploadData::Element::OpenFileStream() {
scoped_ptr<FileStream> file(new FileStream(NULL));
int64 rv = file->OpenSync(
diff --git a/net/base/upload_data.h b/net/base/upload_data.h
index c9796ac..9212625 100644
--- a/net/base/upload_data.h
+++ b/net/base/upload_data.h
@@ -130,7 +130,7 @@ class NET_EXPORT UploadData
uint64 BytesRemaining();
// Resets the offset to zero, so that the element can be reread.
- void ResetOffset() { offset_ = 0; }
+ void ResetOffset();
private:
// Returns a FileStream opened for reading for this element, positioned