summaryrefslogtreecommitdiffstats
path: root/ppapi/c
diff options
context:
space:
mode:
authorteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-02 09:10:41 +0000
committerteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-02 09:10:41 +0000
commitd4edb10981caaa389d94036be4f522925ea3d159 (patch)
treebf80a6ddc3f546c458cfbe07b22b985c98751a8a /ppapi/c
parent9c01b408cf7799799d1a3acec89685510ef94e51 (diff)
downloadchromium_src-d4edb10981caaa389d94036be4f522925ea3d159.zip
chromium_src-d4edb10981caaa389d94036be4f522925ea3d159.tar.gz
chromium_src-d4edb10981caaa389d94036be4f522925ea3d159.tar.bz2
Add Query() support to FileRef.
This change brings Query() support back to FileRef for in-process and out-of-process plugins. I've added testing for a file that exists and one that doesn't. BUG=170721 Review URL: https://chromiumcodereview.appspot.com/12817009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191805 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c')
-rw-r--r--ppapi/c/ppb_file_ref.h46
1 files changed, 42 insertions, 4 deletions
diff --git a/ppapi/c/ppb_file_ref.h b/ppapi/c/ppb_file_ref.h
index d359a7b..910fd80 100644
--- a/ppapi/c/ppb_file_ref.h
+++ b/ppapi/c/ppb_file_ref.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From ppb_file_ref.idl modified Wed Oct 5 14:06:02 2011. */
+/* From ppb_file_ref.idl modified Thu Mar 7 12:02:53 2013. */
#ifndef PPAPI_C_PPB_FILE_REF_H_
#define PPAPI_C_PPB_FILE_REF_H_
@@ -18,7 +18,8 @@
#include "ppapi/c/pp_var.h"
#define PPB_FILEREF_INTERFACE_1_0 "PPB_FileRef;1.0"
-#define PPB_FILEREF_INTERFACE PPB_FILEREF_INTERFACE_1_0
+#define PPB_FILEREF_INTERFACE_1_1 "PPB_FileRef;1.1"
+#define PPB_FILEREF_INTERFACE PPB_FILEREF_INTERFACE_1_1
/**
* @file
@@ -36,7 +37,7 @@
* a file system. This struct contains a <code>PP_FileSystemType</code>
* identifier and a file path string.
*/
-struct PPB_FileRef_1_0 {
+struct PPB_FileRef_1_1 {
/**
* Create() creates a weak pointer to a file in the given file system. File
* paths are POSIX style.
@@ -177,9 +178,46 @@ struct PPB_FileRef_1_0 {
int32_t (*Rename)(PP_Resource file_ref,
PP_Resource new_file_ref,
struct PP_CompletionCallback callback);
+ /*
+ * Query() queries info about a file or directory. You must have access to
+ * read this file or directory if it exists in the external filesystem.
+ *
+ * @param[in] file_ref A <code>PP_Resource</code> corresponding to a file
+ * reference.
+ * @param[out] info A pointer to a <code>PP_FileInfo</code> which will be
+ * populated with information about the file or directory.
+ * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
+ * completion of Query().
+ *
+ * @return An int32_t containing an error code from <code>pp_errors.h</code>.
+ */
+ int32_t (*Query)(PP_Resource file_ref,
+ struct PP_FileInfo* info,
+ struct PP_CompletionCallback callback);
};
-typedef struct PPB_FileRef_1_0 PPB_FileRef;
+typedef struct PPB_FileRef_1_1 PPB_FileRef;
+
+struct PPB_FileRef_1_0 {
+ PP_Resource (*Create)(PP_Resource file_system, const char* path);
+ PP_Bool (*IsFileRef)(PP_Resource resource);
+ PP_FileSystemType (*GetFileSystemType)(PP_Resource file_ref);
+ struct PP_Var (*GetName)(PP_Resource file_ref);
+ struct PP_Var (*GetPath)(PP_Resource file_ref);
+ PP_Resource (*GetParent)(PP_Resource file_ref);
+ int32_t (*MakeDirectory)(PP_Resource directory_ref,
+ PP_Bool make_ancestors,
+ struct PP_CompletionCallback callback);
+ int32_t (*Touch)(PP_Resource file_ref,
+ PP_Time last_access_time,
+ PP_Time last_modified_time,
+ struct PP_CompletionCallback callback);
+ int32_t (*Delete)(PP_Resource file_ref,
+ struct PP_CompletionCallback callback);
+ int32_t (*Rename)(PP_Resource file_ref,
+ PP_Resource new_file_ref,
+ struct PP_CompletionCallback callback);
+};
/**
* @}
*/