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

Unified Diff: chrome/common/extensions/api/file_system.idl

Issue 14607023: Add support for persistent file access in apps. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 7 years, 7 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: chrome/common/extensions/api/file_system.idl
diff --git a/chrome/common/extensions/api/file_system.idl b/chrome/common/extensions/api/file_system.idl
index 06e2be22db1a55e7f69ba2918bc85b14b87a198f..89db7dfb7df26eb8f91f46082d3e61df86a60f35 100644
--- a/chrome/common/extensions/api/file_system.idl
+++ b/chrome/common/extensions/api/file_system.idl
@@ -55,6 +55,7 @@ namespace fileSystem {
callback GetDisplayPathCallback = void (DOMString displayPath);
callback FileEntryCallback = void ([instanceOf=FileEntry] object fileEntry);
callback IsWritableCallback = void (boolean isWritable);
+ callback IsRestorableCallback = void (boolean isRestorable);
interface Functions {
// Get the display path of a FileEntry object. The display path is based on
@@ -76,14 +77,17 @@ namespace fileSystem {
static void chooseEntry(optional ChooseEntryOptions options,
FileEntryCallback callback);
- // Returns the file entry with the given id.
- [nocompile] static FileEntry getEntryById(DOMString id);
+ // Returns the file entry with the given id if it can be restored. This call
+ // will fail otherwise.
+ static void restoreEntry(DOMString id, FileEntryCallback callback);
- // Returns the id of the given file entry. This can be used to retrieve file
- // entries with getEntryById(). When an app is restarted (ie: it is sent the
- // onRestarted event) it can regain access to the file entries it had by
- // remembering their ids and calling getEntryById().
- [nocompile] static DOMString getEntryId(
- [instanceOf=FileEntry] object fileEntry);
+ // Returns whether a file entry for the given id can be restored, i.e.
+ // whether restoreEntry would succeed with this id now.
+ static void isRestorable(DOMString id, IsRestorableCallback callback);
+
+ // Returns an id that can be passed to restoreEntry to regain access to a
+ // given file entry. Only the 500 most recently used entries are retained,
+ // where calls to retainEntry and restoreEntry count as use.
+ static DOMString retainEntry([instanceOf=FileEntry] object fileEntry);
};
};
« no previous file with comments | « chrome/common/extensions/api/_permission_features.json ('k') | chrome/common/extensions/permissions/api_permission.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698