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 8ba0d17c44edbdfba89eafb859ff6482fdf493f9..e1c98fae6fb8d56a5ac0b6256ff10058df68efec 100644 |
--- a/webkit/fileapi/file_system_file_util.h |
+++ b/webkit/fileapi/file_system_file_util.h |
@@ -7,6 +7,7 @@ |
#include "base/file_path.h" |
#include "base/file_util_proxy.h" |
+#include "base/memory/ref_counted.h" |
#include "base/platform_file.h" |
#include "webkit/fileapi/file_system_url.h" |
#include "webkit/fileapi/fileapi_export.h" |
@@ -15,6 +16,10 @@ namespace base { |
class Time; |
} |
+namespace webkit_blob { |
+class ShareableFileReference; |
+} |
+ |
namespace fileapi { |
using base::PlatformFile; |
@@ -170,6 +175,29 @@ class FILEAPI_EXPORT FileSystemFileUtil { |
FileSystemOperationContext* context, |
const FileSystemURL& url) = 0; |
+ // Creates a local snapshot file for a given |url| and returns the |
+ // metadata and platform path of the snapshot file via |callback|. |
+ // In regular filesystem cases the implementation may simply return |
+ // the metadata of the file itself (as well as GetMetadata does), |
+ // while in non-regular filesystem case the backend may create a |
+ // 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; |
+ |
protected: |
FileSystemFileUtil() {} |