Index: webkit/fileapi/file_system_file_util.h |
diff --git a/webkit/fileapi/file_system_file_util.h b/webkit/fileapi/file_system_file_util.h |
index e1c98fae6fb8d56a5ac0b6256ff10058df68efec..8205dfd5148736c6d511eddef34a4f7587bf7c4d 100644 |
--- a/webkit/fileapi/file_system_file_util.h |
+++ b/webkit/fileapi/file_system_file_util.h |
@@ -46,6 +46,20 @@ class FILEAPI_EXPORT FileSystemFileUtil { |
virtual bool IsDirectory() = 0; |
}; |
+ // A policy flag for CreateSnapshotFile. |
+ enum SnapshotFilePolicy { |
+ kSnapshotFileUnknown, |
+ |
+ // The implementation just uses the local file as the snapshot file. |
+ // The FileAPI backend does nothing on the returned file. |
+ kSnapshotFileLocal, |
+ |
+ // The implementation returns a temporary file as the snapshot file. |
+ // The FileAPI backend takes care of the lifetime of the returned file |
+ // and will delete when the last reference of the file is dropped. |
+ kSnapshotFileTemporary, |
+ }; |
+ |
class EmptyFileEnumerator : public AbstractFileEnumerator { |
virtual FilePath Next() OVERRIDE { return FilePath(); } |
virtual int64 Size() OVERRIDE { return 0; } |
@@ -183,20 +197,16 @@ class FILEAPI_EXPORT FileSystemFileUtil { |
// temporary snapshot file which holds the file data and return |
// the metadata of the temporary file. |
// |
- // |result| is the return code of the operation. |
// |file_info| is the metadata of the snapshot file created. |
// |platform_path| is the path to the snapshot file created. |
- // |
- // The implementation can optionally return a file reference |
- // to let the fileapi backend manage the lifetime of the returned |
- // snapshot file. Otherwise it is ok to return NULL. |
- // Please see the comment for ShareableFileReference for details. |
- virtual scoped_refptr<webkit_blob::ShareableFileReference> |
- CreateSnapshotFile(FileSystemOperationContext* context, |
- const FileSystemURL& url, |
- base::PlatformFileError* result, |
- base::PlatformFileInfo* file_info, |
- FilePath* platform_path) = 0; |
+ // |policy| should indicate the policy how the fileapi backend |
+ // should handle the returned file. |
+ virtual base::PlatformFileError CreateSnapshotFile( |
+ FileSystemOperationContext* context, |
+ const FileSystemURL& url, |
+ base::PlatformFileInfo* file_info, |
+ FilePath* platform_path, |
+ SnapshotFilePolicy* policy) = 0; |
protected: |
FileSystemFileUtil() {} |