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

Unified Diff: content/browser/download/base_file.cc

Issue 7646025: Detect file system errors during downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk. Created 9 years, 4 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: content/browser/download/base_file.cc
diff --git a/content/browser/download/base_file.cc b/content/browser/download/base_file.cc
index 0a40369c675d4b24f5fac0d14adff45d70ce349c..87d60f85276b4727d2cc658a085e2399e46f40a0 100644
--- a/content/browser/download/base_file.cc
+++ b/content/browser/download/base_file.cc
@@ -203,6 +203,10 @@ void BaseFile::AnnotateWithSourceInformation() {
#endif
}
+void BaseFile::CreateFileStream() {
+ file_stream_.reset(new net::FileStream);
+}
+
bool BaseFile::Open() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK(!detached_);
@@ -210,7 +214,7 @@ bool BaseFile::Open() {
// Create a new file stream if it is not provided.
if (!file_stream_.get()) {
- file_stream_.reset(new net::FileStream);
+ CreateFileStream();
if (file_stream_->Open(full_path_,
base::PLATFORM_FILE_OPEN_ALWAYS |
base::PLATFORM_FILE_WRITE) != net::OK) {

Powered by Google App Engine
This is Rietveld 408576698