Index: webkit/browser/fileapi/file_system_context.cc |
diff --git a/webkit/browser/fileapi/file_system_context.cc b/webkit/browser/fileapi/file_system_context.cc |
index 549293959aac5d891256b30ea686913989e7b98c..0df0a1dfced0ce0301d6cd098540311e0f717675 100644 |
--- a/webkit/browser/fileapi/file_system_context.cc |
+++ b/webkit/browser/fileapi/file_system_context.cc |
@@ -479,6 +479,20 @@ bool FileSystemContext::CanServeURLRequest(const FileSystemURL& url) const { |
return !is_incognito_ || !FileSystemContext::IsSandboxFileSystem(url.type()); |
} |
+bool FileSystemContext::ShouldFlushOnWriteCompletion( |
+ FileSystemType type) const { |
+ if (IsSandboxFileSystem(type)) { |
+ // Disable Flush() for each write operation on SandboxFileSystems since it |
+ // hurts the performance, assuming the FileSystems are stored in a local |
+ // disk, we don't need to keep calling fsync() for it. |
+ // On the other hand, other FileSystems that may stored on a removable media |
+ // should be Flush()ed as soon as a write operation is completed, so that |
+ // written data is saved over sudden media removal. |
+ return false; |
+ } |
+ return true; |
+} |
+ |
void FileSystemContext::OpenPluginPrivateFileSystem( |
const GURL& origin_url, |
FileSystemType type, |