summaryrefslogtreecommitdiffstats
path: root/ppapi/c
diff options
context:
space:
mode:
authornhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-22 06:45:46 +0000
committernhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-22 06:45:46 +0000
commit81568bb35a07b5acd14cde15d6726a3c6c467f35 (patch)
tree644e623cfcfae1ad1de8e4c928239ddd7b3538c4 /ppapi/c
parent15a709678b5d23e9c6f9021bb1c5a32be5d9336c (diff)
downloadchromium_src-81568bb35a07b5acd14cde15d6726a3c6c467f35.zip
chromium_src-81568bb35a07b5acd14cde15d6726a3c6c467f35.tar.gz
chromium_src-81568bb35a07b5acd14cde15d6726a3c6c467f35.tar.bz2
Implement ReadEntries API for PPB_DirectoryReader
The ReadEntries API returns all file entries in the given directory at once. API discussion is here: https://codereview.chromium.org/12026008/ BUG=113086 TEST=browser_tests --gtest_filter=\*DirectoryReader\* Review URL: https://chromiumcodereview.appspot.com/12090071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184054 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c')
-rw-r--r--ppapi/c/dev/ppb_directory_reader_dev.h38
-rw-r--r--ppapi/c/pp_macros.h4
2 files changed, 19 insertions, 23 deletions
diff --git a/ppapi/c/dev/ppb_directory_reader_dev.h b/ppapi/c/dev/ppb_directory_reader_dev.h
index eda9e8f..060e489 100644
--- a/ppapi/c/dev/ppb_directory_reader_dev.h
+++ b/ppapi/c/dev/ppb_directory_reader_dev.h
@@ -3,11 +3,12 @@
* found in the LICENSE file.
*/
-/* From dev/ppb_directory_reader_dev.idl modified Mon Nov 26 13:52:22 2012. */
+/* From dev/ppb_directory_reader_dev.idl modified Fri Feb 15 16:46:46 2013. */
#ifndef PPAPI_C_DEV_PPB_DIRECTORY_READER_DEV_H_
#define PPAPI_C_DEV_PPB_DIRECTORY_READER_DEV_H_
+#include "ppapi/c/pp_array_output.h"
#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_file_info.h"
@@ -15,8 +16,8 @@
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_stdint.h"
-#define PPB_DIRECTORYREADER_DEV_INTERFACE_0_5 "PPB_DirectoryReader(Dev);0.5"
-#define PPB_DIRECTORYREADER_DEV_INTERFACE PPB_DIRECTORYREADER_DEV_INTERFACE_0_5
+#define PPB_DIRECTORYREADER_DEV_INTERFACE_0_6 "PPB_DirectoryReader(Dev);0.6"
+#define PPB_DIRECTORYREADER_DEV_INTERFACE PPB_DIRECTORYREADER_DEV_INTERFACE_0_6
/**
* @file
@@ -42,7 +43,7 @@ PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_DirectoryEntry_Dev, 8);
* @addtogroup Interfaces
* @{
*/
-struct PPB_DirectoryReader_Dev_0_5 {
+struct PPB_DirectoryReader_Dev_0_6 {
/* Creates a DirectoryReader for the given directory. Upon success, the
* corresponding directory is classified as "in use" by the resulting
* DirectoryReader object until such time as the DirectoryReader object is
@@ -52,28 +53,23 @@ struct PPB_DirectoryReader_Dev_0_5 {
* PP_FALSE if the resource is invalid or some type other than a
* DirectoryReader. */
PP_Bool (*IsDirectoryReader)(PP_Resource resource);
- /* Reads the next entry in the directory. Returns PP_OK and sets
- * entry->file_ref to 0 to indicate reaching the end of the directory. If
- * entry->file_ref is non-zero when passed to GetNextEntry, it will be
- * released before the next file_ref is stored.
+ /* Reads all entries in the directory.
*
- * EXAMPLE USAGE:
+ * @param[in] directory_reader A <code>PP_Resource</code>
+ * corresponding to a directory reader resource.
+ * @param[in] output An output array which will receive
+ * <code>PP_DirectoryEntry_Dev</code> objects on success.
+ * @param[in] callback A <code>PP_CompletionCallback</code> to run on
+ * completion.
*
- * PP_Resource reader = reader_funcs->Create(dir_ref);
- * PP_DirectoryEntry entry = {0};
- * while ((reader_funcs->GetNextEntry(reader, &entry,
- * PP_BlockUntilComplete()) == PP_OK) &&
- * entry->file_ref) {
- * ProcessDirectoryEntry(entry);
- * }
- * core_funcs->ReleaseResource(reader);
+ * @return An error code from <code>pp_errors.h</code>.
*/
- int32_t (*GetNextEntry)(PP_Resource directory_reader,
- struct PP_DirectoryEntry_Dev* entry,
- struct PP_CompletionCallback callback);
+ int32_t (*ReadEntries)(PP_Resource directory_reader,
+ struct PP_ArrayOutput output,
+ struct PP_CompletionCallback callback);
};
-typedef struct PPB_DirectoryReader_Dev_0_5 PPB_DirectoryReader_Dev;
+typedef struct PPB_DirectoryReader_Dev_0_6 PPB_DirectoryReader_Dev;
/**
* @}
*/
diff --git a/ppapi/c/pp_macros.h b/ppapi/c/pp_macros.h
index 1f8b6d8..83f85d6 100644
--- a/ppapi/c/pp_macros.h
+++ b/ppapi/c/pp_macros.h
@@ -3,13 +3,13 @@
* found in the LICENSE file.
*/
-/* From pp_macros.idl modified Wed Jan 9 18:07:46 2013. */
+/* From pp_macros.idl modified Fri Feb 15 16:46:46 2013. */
#ifndef PPAPI_C_PP_MACROS_H_
#define PPAPI_C_PP_MACROS_H_
-#define PPAPI_RELEASE 25
+#define PPAPI_RELEASE 27
/**
* @file