Index: ppapi/c/private/ppb_flash_file.h |
diff --git a/ppapi/c/private/ppb_flash_file.h b/ppapi/c/private/ppb_flash_file.h |
index 8e1f29109a64e7a2efce4a5abf3b6e74f09a7d2e..9e2def9c9914ec5183a8281eae0fd12023017a1a 100644 |
--- a/ppapi/c/private/ppb_flash_file.h |
+++ b/ppapi/c/private/ppb_flash_file.h |
@@ -38,45 +38,45 @@ struct PP_DirContents_Dev { |
#define PPB_FLASH_FILE_MODULELOCAL_INTERFACE "PPB_Flash_File_ModuleLocal;1" |
+// This interface provides (for Flash) synchronous access to module-local files. |
+// Module-local file paths are '/'-separated UTF-8 strings, relative to a |
+// module-specific root. |
struct PPB_Flash_File_ModuleLocal { |
- // Opens a module-local file, returning a file descriptor (posix) or a HANDLE |
- // (win32) into file. Module-local file paths (here and below) are |
- // '/'-separated UTF-8 strings, relative to a module-specific root. The return |
- // value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in case |
- // of failure. |
+ // Opens a file, returning a file descriptor (posix) or a HANDLE (win32) into |
+ // file. The return value is the ppapi error, PP_OK if success, one of the |
+ // PP_ERROR_* in case of failure. |
int32_t (*OpenFile)(PP_Instance instance, |
const char* path, |
int32_t mode, |
PP_FileHandle* file); |
- // Renames a module-local file. The return value is the ppapi error, PP_OK if |
- // success, one of the PP_ERROR_* in case of failure. |
+ // Renames a file. The return value is the ppapi error, PP_OK if success, one |
+ // of the PP_ERROR_* in case of failure. |
int32_t (*RenameFile)(PP_Instance instance, |
const char* path_from, |
const char* path_to); |
- // Deletes a module-local file or directory. If recursive is set and the path |
- // points to a directory, deletes all the contents of the directory. The |
- // return value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in |
- // case of failure. |
+ // Deletes a file or directory. If recursive is set and the path points to a |
+ // directory, deletes all the contents of the directory. The return value is |
+ // the ppapi error, PP_OK if success, one of the PP_ERROR_* in case of |
+ // failure. |
int32_t (*DeleteFileOrDir)(PP_Instance instance, |
const char* path, |
PP_Bool recursive); |
- // Creates a module-local directory. The return value is the ppapi error, |
- // PP_OK if success, one of the PP_ERROR_* in case of failure. |
+ // Creates a directory. The return value is the ppapi error, PP_OK if success, |
+ // one of the PP_ERROR_* in case of failure. |
int32_t (*CreateDir)(PP_Instance instance, const char* path); |
- // Queries information about a module-local file. The return value is the |
- // ppapi error, PP_OK if success, one of the PP_ERROR_* in case of failure. |
+ // Queries information about a file. The return value is the ppapi error, |
+ // PP_OK if success, one of the PP_ERROR_* in case of failure. |
int32_t (*QueryFile)(PP_Instance instance, |
const char* path, |
struct PP_FileInfo_Dev* info); |
- // Gets the list of files contained in a module-local directory. The return |
- // value is the ppapi error, PP_OK if success, one of the PP_ERROR_* in case |
- // of failure. If non-NULL, the returned contents should be freed with |
- // FreeDirContents. |
+ // Gets the list of files contained in a directory. The return value is the |
+ // ppapi error, PP_OK if success, one of the PP_ERROR_* in case of failure. If |
+ // non-NULL, the returned contents should be freed with FreeDirContents. |
int32_t (*GetDirContents)(PP_Instance instance, |
const char* path, |
struct PP_DirContents_Dev** contents); |
@@ -86,4 +86,30 @@ struct PPB_Flash_File_ModuleLocal { |
struct PP_DirContents_Dev* contents); |
}; |
+// PPB_Flash_File_FileRef ------------------------------------------------------ |
+ |
+#define PPB_FLASH_FILE_FILEREF_INTERFACE "PPB_Flash_File_FileRef;1" |
+ |
+// This interface provides (for Flash) synchronous access to files whose paths |
+// are given by a Pepper FileRef. Such FileRefs are typically obtained via the |
+// Pepper file chooser. |
+struct PPB_Flash_File_FileRef { |
+ // The functions below correspond exactly to the ones in the module-local file |
+ // interface (except in taking FileRefs instead of paths, of course). |
+ int32_t (*OpenFile)(PP_Resource file_ref_id, |
+ int32_t mode, |
+ PP_FileHandle* file); |
+ int32_t (*RenameFile)(PP_Resource from_file_ref_id, |
+ PP_Resource to_file_ref_id); |
+ int32_t (*DeleteFileOrDir)(PP_Resource file_ref_id, |
+ PP_Bool recursive); |
+ int32_t (*CreateDir)(PP_Resource file_ref_id); |
+ int32_t (*QueryFile)(PP_Resource file_ref_id, |
+ struct PP_FileInfo_Dev* info); |
+ int32_t (*GetDirContents)(PP_Resource file_ref_id, |
+ struct PP_DirContents_Dev** contents); |
+ void (*FreeDirContents)(PP_Instance instance, |
+ struct PP_DirContents_Dev* contents); |
+}; |
+ |
#endif // PPAPI_C_PRIVATE_PPB_FLASH_FILE_H_ |