OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PPAPI_C_DEV_PPB_DIRECTORY_READER_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PPB_DIRECTORY_READER_DEV_H_ |
6 #define PPAPI_C_DEV_PPB_DIRECTORY_READER_DEV_H_ | 6 #define PPAPI_C_DEV_PPB_DIRECTORY_READER_DEV_H_ |
7 | 7 |
8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
9 #include "ppapi/c/dev/pp_file_info_dev.h" | 9 #include "ppapi/c/dev/pp_file_info_dev.h" |
10 #include "ppapi/c/pp_module.h" | 10 #include "ppapi/c/pp_module.h" |
11 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
12 | 12 |
13 struct PP_CompletionCallback; | 13 struct PP_CompletionCallback; |
14 | 14 |
15 struct PP_DirectoryEntry_Dev { | 15 struct PP_DirectoryEntry_Dev { |
16 PP_Resource file_ref; | 16 PP_Resource file_ref; |
17 PP_FileType_Dev file_type; | 17 PP_FileType_Dev file_type; |
| 18 |
| 19 /** Ensure that this struct is 16-bytes wide by padding the end. Because |
| 20 * PP_Resource is an 8-byte type, some compilers align this struct on 8-byte |
| 21 * boundaries and pad it to 16 bytes even without @a padding. This makes its |
| 22 * size consistent across compilers. |
| 23 */ |
| 24 int32_t padding; |
18 }; | 25 }; |
| 26 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_DirectoryEntry_Dev, 16); |
19 | 27 |
20 #define PPB_DIRECTORYREADER_DEV_INTERFACE "PPB_DirectoryReader(Dev);0.2" | 28 #define PPB_DIRECTORYREADER_DEV_INTERFACE "PPB_DirectoryReader(Dev);0.2" |
21 | 29 |
22 struct PPB_DirectoryReader_Dev { | 30 struct PPB_DirectoryReader_Dev { |
23 // Creates a DirectoryReader for the given directory. Upon success, the | 31 // Creates a DirectoryReader for the given directory. Upon success, the |
24 // corresponding directory is classified as "in use" by the resulting | 32 // corresponding directory is classified as "in use" by the resulting |
25 // DirectoryReader object until such time as the DirectoryReader object is | 33 // DirectoryReader object until such time as the DirectoryReader object is |
26 // destroyed. | 34 // destroyed. |
27 PP_Resource (*Create)(PP_Resource directory_ref); | 35 PP_Resource (*Create)(PP_Resource directory_ref); |
28 | 36 |
(...skipping 17 matching lines...) Expand all Loading... |
46 // ProcessDirectoryEntry(entry); | 54 // ProcessDirectoryEntry(entry); |
47 // } | 55 // } |
48 // core_funcs->ReleaseResource(reader); | 56 // core_funcs->ReleaseResource(reader); |
49 // | 57 // |
50 int32_t (*GetNextEntry)(PP_Resource directory_reader, | 58 int32_t (*GetNextEntry)(PP_Resource directory_reader, |
51 struct PP_DirectoryEntry_Dev* entry, | 59 struct PP_DirectoryEntry_Dev* entry, |
52 struct PP_CompletionCallback callback); | 60 struct PP_CompletionCallback callback); |
53 }; | 61 }; |
54 | 62 |
55 #endif // PPAPI_C_DEV_PPB_DIRECTORY_READER_DEV_H_ | 63 #endif // PPAPI_C_DEV_PPB_DIRECTORY_READER_DEV_H_ |
OLD | NEW |