Chromium Code Reviews| Index: net/base/upload_data.cc |
| diff --git a/net/base/upload_data.cc b/net/base/upload_data.cc |
| index 71d77ae807a102ae0b5edf64a7184269ddabf10e..b13e9091e8cb0051caeb26a516ba1cd806f600d0 100644 |
| --- a/net/base/upload_data.cc |
| +++ b/net/base/upload_data.cc |
| @@ -114,6 +114,20 @@ uint64 UploadData::Element::BytesRemaining() { |
| return GetContentLength() - offset_; |
| } |
| +void UploadData::Element::ResetOffset() { |
| + offset_ = 0; |
| + |
| + // Delete the file stream if already opened, so we can reread the file from |
| + // the beginning. |
| + if (file_stream_) { |
| + // Temporarily allow until fix: http://crbug.com/72001. |
| + base::ThreadRestrictions::ScopedAllowIO allow_io; |
| + file_stream_->CloseSync(); |
|
willchan no longer on Chromium
2012/05/21 18:12:51
Is this call necessary? Can't we just delete the f
satorux1
2012/05/21 19:37:00
You are right, but I thought closing explicitly wo
willchan no longer on Chromium
2012/05/21 20:27:40
OIC. I think the ThreadRestrictions::ScopedAllowIO
satorux1
2012/05/21 20:40:46
Let me keep this for now as we also close explicit
|
| + delete file_stream_; |
| + file_stream_ = NULL; |
| + } |
| +} |
| + |
| FileStream* UploadData::Element::OpenFileStream() { |
| scoped_ptr<FileStream> file(new FileStream(NULL)); |
| int64 rv = file->OpenSync( |