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