summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorsatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-02 00:36:26 +0000
committersatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-02 00:36:26 +0000
commitf2bd2b6eeb8cb2f1711df91f43536a1764657c80 (patch)
tree6396e169b94b0ea4bec35be69d7f95747fb1e54a /net
parent467f4ba71e27452e02fe93101075a9cec0bd43bc (diff)
downloadchromium_src-f2bd2b6eeb8cb2f1711df91f43536a1764657c80.zip
chromium_src-f2bd2b6eeb8cb2f1711df91f43536a1764657c80.tar.gz
chromium_src-f2bd2b6eeb8cb2f1711df91f43536a1764657c80.tar.bz2
net: Explicitly close a file stream in UploadDataStream.
This is to make it clear that a file stream is closed there, hence file access is performed. Add ScopedIOAllowIO as well. BUG=72001 TEST=net_unittests Review URL: http://codereview.chromium.org/9316048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120134 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/upload_data_stream.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/base/upload_data_stream.cc b/net/base/upload_data_stream.cc
index 2d2a3a5..8c94e08 100644
--- a/net/base/upload_data_stream.cc
+++ b/net/base/upload_data_stream.cc
@@ -165,7 +165,12 @@ void UploadDataStream::AdvanceToNextElement() {
++element_index_;
element_offset_ = 0;
element_file_bytes_remaining_ = 0;
- element_file_stream_.reset();
+ if (element_file_stream_.get()) {
+ // Temporarily allow until fix: http://crbug.com/72001.
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+ element_file_stream_->Close();
+ element_file_stream_.reset();
+ }
}
bool UploadDataStream::IsEOF() const {