summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authormtomasz <mtomasz@chromium.org>2014-12-08 02:45:10 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-08 10:46:23 +0000
commit96dac8504963c1786641e7f4ac7bfd210ddce60b (patch)
treef6610ba92f656ab932c3680832f2ba61946a9a93 /storage
parent5662df670706ad5b29689b809005f7c985b18d20 (diff)
downloadchromium_src-96dac8504963c1786641e7f4ac7bfd210ddce60b.zip
chromium_src-96dac8504963c1786641e7f4ac7bfd210ddce60b.tar.gz
chromium_src-96dac8504963c1786641e7f4ac7bfd210ddce60b.tar.bz2
Flush on completion of copying.
The COPY_SYNC_OPTION_SYNC flag was missing when registering FSP file systems. As a result, when copying between file systems the last chunk could be lost. TEST=Tested manually in Files app. BUG=439830 Review URL: https://codereview.chromium.org/778103003 Cr-Commit-Position: refs/heads/master@{#307219}
Diffstat (limited to 'storage')
-rw-r--r--storage/browser/fileapi/external_mount_points.cc4
-rw-r--r--storage/common/fileapi/file_system_mount_option.h7
2 files changed, 7 insertions, 4 deletions
diff --git a/storage/browser/fileapi/external_mount_points.cc b/storage/browser/fileapi/external_mount_points.cc
index 07df4f4..04b715f 100644
--- a/storage/browser/fileapi/external_mount_points.cc
+++ b/storage/browser/fileapi/external_mount_points.cc
@@ -96,10 +96,6 @@ bool ExternalMountPoints::RegisterFileSystem(
FileSystemType type,
const FileSystemMountOption& mount_option,
const base::FilePath& path_in) {
- // COPY_SYNC_OPTION_SYNC is only applicable to native local file system.
- DCHECK(type == kFileSystemTypeNativeLocal ||
- mount_option.copy_sync_option() != COPY_SYNC_OPTION_SYNC);
-
base::AutoLock locker(lock_);
base::FilePath path = NormalizeFilePath(path_in);
diff --git a/storage/common/fileapi/file_system_mount_option.h b/storage/common/fileapi/file_system_mount_option.h
index dc5cdc4..38daa96 100644
--- a/storage/common/fileapi/file_system_mount_option.h
+++ b/storage/common/fileapi/file_system_mount_option.h
@@ -9,7 +9,14 @@ namespace storage {
// Option for specifying if disk sync operation is wanted after copying.
enum CopySyncOption {
+ // No syncing is required after an operation is completed.
COPY_SYNC_OPTION_NO_SYNC,
+
+ // Syncing is required in order to commit written data. Note, that syncing
+ // is only invoked via FileStreamWriter::Flush() and via base::File::Flush()
+ // for native files. Hence, syncing will not be performed for copying within
+ // non-native file systems as well as for non-native copies performed with
+ // snapshots.
COPY_SYNC_OPTION_SYNC,
};