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

Unified Diff: webkit/fileapi/async_file_util.h

Issue 14075016: Change some snapshot- or temporary-file related changes to use ScopedFile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 8 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
Index: webkit/fileapi/async_file_util.h
diff --git a/webkit/fileapi/async_file_util.h b/webkit/fileapi/async_file_util.h
index 10b76af8ef74137b1213d15a40c3e7c8d66807e5..298a7a16c5dfda09aa4ea716ba250db74ab18a70 100644
--- a/webkit/fileapi/async_file_util.h
+++ b/webkit/fileapi/async_file_util.h
@@ -9,13 +9,16 @@
#include "base/callback_forward.h"
#include "base/files/file_util_proxy.h"
#include "base/platform_file.h"
-#include "webkit/fileapi/file_snapshot_policy.h"
#include "webkit/storage/webkit_storage_export.h"
namespace base {
class Time;
}
+namespace webkit_blob {
+class ShareableFileReference;
+}
+
namespace fileapi {
class FileSystemOperationContext;
@@ -55,7 +58,8 @@ class WEBKIT_STORAGE_EXPORT AsyncFileUtil {
void(base::PlatformFileError result,
const base::PlatformFileInfo& file_info,
const base::FilePath& platform_path,
- SnapshotFilePolicy policy)> CreateSnapshotFileCallback;
+ const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref
+ )> CreateSnapshotFileCallback;
AsyncFileUtil() {}
virtual ~AsyncFileUtil() {}
@@ -297,9 +301,17 @@ class WEBKIT_STORAGE_EXPORT AsyncFileUtil {
//
// In the callback, it returns:
// |file_info| is the metadata of the snapshot file created.
- // |platform_path| is the path to the snapshot file created.
- // |policy| should indicate the policy how the fileapi backend
- // should handle the returned file.
+ // |platform_path| is the full absolute platform path to the snapshot
+ // file created. If a file is not backed by a real local file in
+ // the implementor's FileSystem, the implementor must create a
+ // local snapshot file and return the path of the created file.
+ //
+ // If implementors creates a temporary file for snapshotting and wants
+ // FileAPI backend to take care of the lifetime of the file (so that
+ // it won't get deleted while JS layer has any references to the created
+ // File/Blob object), it should return non-empty |file_ref|.
+ // Via the |file_ref| implementors can schedule a file deletion
+ // or arbitrary callbacks when the last reference of File/Blob is dropped.
//
// LocalFileSystemOperation::CreateSnapshotFile calls this.
//
« no previous file with comments | « chrome/browser/sync_file_system/drive_file_sync_service.cc ('k') | webkit/fileapi/async_file_util_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698