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

Unified Diff: webkit/fileapi/file_system_file_util.h

Issue 10815003: Adding FileUtil::CreateSnapshotFile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 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() {}
« 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