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

Unified Diff: webkit/fileapi/file_system_file_util.h

Issue 10834167: Create ShareableFileReference on IO thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adding unknown policy for DCHECK Created 8 years, 4 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
« no previous file with comments | « no previous file | webkit/fileapi/file_system_file_util_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {}
« no previous file with comments | « no previous file | webkit/fileapi/file_system_file_util_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698