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

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..728bb378b8f6c25f38819ad77b6390fa08d4b2ad 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,16 @@ 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.
Matt Giuca 2013/05/22 08:26:14 Otherwise, returns ...?
Sam McNally 2013/05/23 03:47:28 Otherwise, fails.
Matt Giuca 2013/05/23 04:53:43 What does "fail" mean? Silently? This is user-faci
+ 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);
};
};

Powered by Google App Engine
This is Rietveld 408576698