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

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: 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 d00dc8245177ce01b0bc820851ff373d0bc9003a..743b82bab3816a752db5fe3e5fa7a774a8b09e49 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() {}
@@ -289,8 +293,13 @@ 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.
+ //
+ // 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.
//

Powered by Google App Engine
This is Rietveld 408576698