Index: content/browser/indexed_db/indexed_db_backing_store.cc |
diff --git a/content/browser/indexed_db/indexed_db_backing_store.cc b/content/browser/indexed_db/indexed_db_backing_store.cc |
index 4ae9ed4f236722b4c76dbcb62ee677b4223794c9..9a8421f5d403138c7110a97c7d720496aa337f10 100644 |
--- a/content/browser/indexed_db/indexed_db_backing_store.cc |
+++ b/content/browser/indexed_db/indexed_db_backing_store.cc |
@@ -2360,11 +2360,8 @@ class LocalWriteClosure : public FileWriterDelegate::DelegateWriteCallback, |
net::URLRequestContext* request_context) { |
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
scoped_ptr<storage::FileStreamWriter> writer( |
- storage::FileStreamWriter::CreateForLocalFile( |
- task_runner_.get(), |
- file_path, |
- 0, |
- storage::FileStreamWriter::CREATE_NEW_FILE)); |
+ storage::FileStreamWriter::CreateForLocalFile(task_runner_.get(), |
+ file_path, 0)); |
scoped_ptr<FileWriterDelegate> delegate(new FileWriterDelegate( |
writer.Pass(), storage::FlushPolicy::FLUSH_ON_COMPLETION)); |
@@ -2456,6 +2453,11 @@ bool IndexedDBBackingStore::WriteBlobFile( |
DCHECK(descriptor.url().is_valid()); |
scoped_refptr<LocalWriteClosure> write_closure( |
new LocalWriteClosure(chained_blob_writer, task_runner_.get())); |
+ { |
+ // FileStreamWriter needs an existing file, so create one now. |
+ base::File file(path, |
jsbell
2015/03/03 01:01:48
Should we do this in WriteBlobToFileOnIOThread ins
cmumford
2015/03/03 22:26:09
Can't do file I/O on that thread - only reason why
|
+ base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); |
michaeln
2015/03/03 00:02:51
nit: ditto file.Close()
cmumford
2015/03/03 22:26:09
Done.
|
+ } |
content::BrowserThread::PostTask( |
content::BrowserThread::IO, |
FROM_HERE, |