OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 | 5 |
6 /** | 6 /** |
7 * This file defines the API to create a file reference or "weak pointer" to a | 7 * This file defines the API to create a file reference or "weak pointer" to a |
8 * file in a file system. | 8 * file in a file system. |
9 */ | 9 */ |
10 | 10 |
11 label Chrome { | 11 label Chrome { |
12 M14 = 1.0, | 12 M14 = 1.0, |
13 M28 = 1.1, | 13 M28 = 1.1 |
14 [channel=dev] M34 = 1.2 | |
15 }; | |
16 | |
17 /** | |
18 * The <code>PP_MakeDirectoryFlags</code> enum contains flags used to control | |
19 * behavior of <code>PPB_FileRef.MakeDirectory()</code>. | |
20 */ | |
21 enum PP_MakeDirectoryFlags { | |
22 PP_MAKEDIRECTORYFLAG_NONE = 0 << 0, | |
23 | |
24 /** Requests that ancestor directories are created if they do not exist. */ | |
25 PP_MAKEDIRECTORYFLAG_WITH_ANCESTORS = 1 << 0, | |
26 | |
27 /** | |
28 * Requests that the PPB_FileRef.MakeDirectory() call fails if the directory | |
29 * already exists. | |
30 */ | |
31 PP_MAKEDIRECTORYFLAG_EXCLUSIVE = 1 << 1 | |
32 }; | 14 }; |
33 | 15 |
34 /** | 16 /** |
35 * The <code>PPB_FileRef</code> struct represents a "weak pointer" to a file in | 17 * The <code>PPB_FileRef</code> struct represents a "weak pointer" to a file in |
36 * a file system. This struct contains a <code>PP_FileSystemType</code> | 18 * a file system. This struct contains a <code>PP_FileSystemType</code> |
37 * identifier and a file path string. | 19 * identifier and a file path string. |
38 */ | 20 */ |
39 interface PPB_FileRef { | 21 interface PPB_FileRef { |
40 /** | 22 /** |
41 * Create() creates a weak pointer to a file in the given file system. File | 23 * Create() creates a weak pointer to a file in the given file system. File |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 * MakeDirectory() makes a new directory in the file system as well as any | 98 * MakeDirectory() makes a new directory in the file system as well as any |
117 * parent directories if the <code>make_ancestors</code> argument is | 99 * parent directories if the <code>make_ancestors</code> argument is |
118 * <code>PP_TRUE</code>. It is not valid to make a directory in the external | 100 * <code>PP_TRUE</code>. It is not valid to make a directory in the external |
119 * file system. | 101 * file system. |
120 * | 102 * |
121 * @param[in] file_ref A <code>PP_Resource</code> corresponding to a file | 103 * @param[in] file_ref A <code>PP_Resource</code> corresponding to a file |
122 * reference. | 104 * reference. |
123 * @param[in] make_ancestors A <code>PP_Bool</code> set to | 105 * @param[in] make_ancestors A <code>PP_Bool</code> set to |
124 * <code>PP_TRUE</code> to make ancestor directories or <code>PP_FALSE</code> | 106 * <code>PP_TRUE</code> to make ancestor directories or <code>PP_FALSE</code> |
125 * if ancestor directories are not needed. | 107 * if ancestor directories are not needed. |
126 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | |
127 * completion of MakeDirectory(). | |
128 * | 108 * |
129 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | 109 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
130 * Succeeds if the directory already exists. Fails if ancestor directories | 110 * Succeeds if the directory already exists. Fails if ancestor directories |
131 * do not exist and <code>make_ancestors</code> was passed as | 111 * do not exist and <code>make_ancestors</code> was passed as |
132 * <code>PP_FALSE</code>. | 112 * <code>PP_FALSE</code>. |
133 */ | 113 */ |
134 [deprecate=1.2] | |
135 int32_t MakeDirectory([in] PP_Resource directory_ref, | 114 int32_t MakeDirectory([in] PP_Resource directory_ref, |
136 [in] PP_Bool make_ancestors, | 115 [in] PP_Bool make_ancestors, |
137 [in] PP_CompletionCallback callback); | 116 [in] PP_CompletionCallback callback); |
138 | 117 |
139 /** | 118 /** |
140 * MakeDirectory() makes a new directory in the file system according to the | |
141 * given <code>make_directory_flags</code>, which is a bit-mask of the | |
142 * <code>PP_MakeDirectoryFlags</code> values. It is not valid to make a | |
143 * directory in the external file system. | |
144 * | |
145 * @param[in] file_ref A <code>PP_Resource</code> corresponding to a file | |
146 * reference. | |
147 * @param[in] make_directory_flags A bit-mask of the | |
148 * <code>PP_MakeDirectoryFlags</code> values. | |
149 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | |
150 * completion of MakeDirectory(). | |
151 * | |
152 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | |
153 */ | |
154 [version=1.2] | |
155 int32_t MakeDirectory([in] PP_Resource directory_ref, | |
156 [in] int32_t make_directory_flags, | |
157 [in] PP_CompletionCallback callback); | |
158 | |
159 /** | |
160 * Touch() Updates time stamps for a file. You must have write access to the | 119 * Touch() Updates time stamps for a file. You must have write access to the |
161 * file if it exists in the external filesystem. | 120 * file if it exists in the external filesystem. |
162 * | 121 * |
163 * @param[in] file_ref A <code>PP_Resource</code> corresponding to a file | 122 * @param[in] file_ref A <code>PP_Resource</code> corresponding to a file |
164 * reference. | 123 * reference. |
165 * @param[in] last_access_time The last time the file was accessed. | 124 * @param[in] last_access_time The last time the file was accessed. |
166 * @param[in] last_modified_time The last time the file was modified. | 125 * @param[in] last_modified_time The last time the file was modified. |
167 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 126 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
168 * completion of Touch(). | 127 * completion of Touch(). |
169 * | 128 * |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 * completion. | 197 * completion. |
239 * | 198 * |
240 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | 199 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
241 */ | 200 */ |
242 [version=1.1] | 201 [version=1.1] |
243 int32_t ReadDirectoryEntries([in] PP_Resource file_ref, | 202 int32_t ReadDirectoryEntries([in] PP_Resource file_ref, |
244 [in] PP_ArrayOutput output, | 203 [in] PP_ArrayOutput output, |
245 [in] PP_CompletionCallback callback); | 204 [in] PP_CompletionCallback callback); |
246 }; | 205 }; |
247 | 206 |
OLD | NEW |