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

Unified Diff: webkit/browser/fileapi/file_system_context.cc

Issue 264993002: [FileAPI] Remove Flush() on write completion on SandboxFileSystems (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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: 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,
« no previous file with comments | « webkit/browser/fileapi/file_system_context.h ('k') | webkit/browser/fileapi/file_system_operation_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698