OLD | NEW |
1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 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_FILE_SYSTEM_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PPB_FILE_SYSTEM_DEV_H_ |
6 #define PPAPI_C_DEV_PPB_FILE_SYSTEM_DEV_H_ | 6 #define PPAPI_C_DEV_PPB_FILE_SYSTEM_DEV_H_ |
7 | 7 |
8 #include "ppapi/c/dev/pp_file_info_dev.h" | 8 #include "ppapi/c/dev/pp_file_info_dev.h" |
9 #include "ppapi/c/pp_bool.h" | 9 #include "ppapi/c/pp_bool.h" |
10 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
11 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
12 #include "ppapi/c/pp_stdint.h" | 12 #include "ppapi/c/pp_stdint.h" |
13 #include "ppapi/c/pp_time.h" | 13 #include "ppapi/c/pp_time.h" |
14 | 14 |
15 struct PP_CompletionCallback; | 15 struct PP_CompletionCallback; |
16 | 16 |
17 #define PPB_FILESYSTEM_DEV_INTERFACE_0_5 "PPB_FileSystem(Dev);0.5" | 17 #define PPB_FILESYSTEM_DEV_INTERFACE_0_6 "PPB_FileSystem(Dev);0.6" |
18 #define PPB_FILESYSTEM_DEV_INTERFACE PPB_FILESYSTEM_DEV_INTERFACE_0_5 | 18 #define PPB_FILESYSTEM_DEV_INTERFACE PPB_FILESYSTEM_DEV_INTERFACE_0_6 |
19 | 19 |
20 struct PPB_FileSystem_Dev { | 20 struct PPB_FileSystem_Dev { |
21 /** Creates a filesystem object of the given type. */ | 21 /** Creates a filesystem object of the given type. */ |
22 PP_Resource (*Create)(PP_Instance instance, PP_FileSystemType_Dev type); | 22 PP_Resource (*Create)(PP_Instance instance, PP_FileSystemType_Dev type); |
23 | 23 |
24 /** Returns PP_TRUE if the given resource is a FileSystem. */ | 24 /** Returns PP_TRUE if the given resource is a FileSystem. */ |
25 PP_Bool (*IsFileSystem)(PP_Resource resource); | 25 PP_Bool (*IsFileSystem)(PP_Resource resource); |
26 | 26 |
27 /** | 27 /** |
28 * Opens the file system. A file system must be opened before running any | 28 * Opens the file system. A file system must be opened before running any |
29 * other operation on it. | 29 * other operation on it. |
30 * | 30 * |
31 * TODO(brettw) clarify whether this must have completed before a file can | 31 * TODO(brettw) clarify whether this must have completed before a file can |
32 * be opened in it. Clarify what it means to be "completed." | 32 * be opened in it. Clarify what it means to be "completed." |
33 */ | 33 */ |
34 int32_t (*Open)(PP_Resource file_system, | 34 int32_t (*Open)(PP_Resource file_system, |
35 int64_t expected_size, | 35 int64_t expected_size, |
36 struct PP_CompletionCallback callback); | 36 struct PP_CompletionCallback callback); |
37 | 37 |
38 /** | 38 /** |
39 * Returns the type of the given file system. | 39 * Returns the type of the given file system. |
40 * | 40 * |
41 * Returns PP_FILESYSTEMTYPE_INVALID if the given resource is not a valid | 41 * Returns PP_FILESYSTEMTYPE_INVALID if the given resource is not a valid |
42 * filesystem. It is valid to call this function even before Open completes. | 42 * filesystem. It is valid to call this function even before Open completes. |
43 */ | 43 */ |
44 PP_FileSystemType_Dev (*GetType)(PP_Resource file_system); | 44 PP_FileSystemType_Dev (*GetType)(PP_Resource file_system); |
45 }; | 45 }; |
46 | 46 |
47 #endif /* PPAPI_C_DEV_PPB_FILE_SYSTEM_DEV_H_ */ | 47 #endif /* PPAPI_C_DEV_PPB_FILE_SYSTEM_DEV_H_ */ |
48 | |
OLD | NEW |