Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: ppapi/api/ppb_file_ref.idl

Issue 113363004: PPAPI: Add new PPB_FileRef.MakeDirectory to support exclusive operation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/pepper/plugin_module.cc ('k') | ppapi/c/ppb_file_ref.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>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 };
33
34 /**
17 * The <code>PPB_FileRef</code> struct represents a "weak pointer" to a file in 35 * 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> 36 * a file system. This struct contains a <code>PP_FileSystemType</code>
19 * identifier and a file path string. 37 * identifier and a file path string.
20 */ 38 */
21 interface PPB_FileRef { 39 interface PPB_FileRef {
22 /** 40 /**
23 * Create() creates a weak pointer to a file in the given file system. File 41 * Create() creates a weak pointer to a file in the given file system. File
24 * paths are POSIX style. 42 * paths are POSIX style.
25 * 43 *
26 * @param[in] resource A <code>PP_Resource</code> corresponding to a file 44 * @param[in] resource A <code>PP_Resource</code> corresponding to a file
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 * MakeDirectory() makes a new directory in the file system as well as any 116 * MakeDirectory() makes a new directory in the file system as well as any
99 * parent directories if the <code>make_ancestors</code> argument is 117 * 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 118 * <code>PP_TRUE</code>. It is not valid to make a directory in the external
101 * file system. 119 * file system.
102 * 120 *
103 * @param[in] file_ref A <code>PP_Resource</code> corresponding to a file 121 * @param[in] file_ref A <code>PP_Resource</code> corresponding to a file
104 * reference. 122 * reference.
105 * @param[in] make_ancestors A <code>PP_Bool</code> set to 123 * @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> 124 * <code>PP_TRUE</code> to make ancestor directories or <code>PP_FALSE</code>
107 * if ancestor directories are not needed. 125 * if ancestor directories are not needed.
126 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
127 * completion of MakeDirectory().
108 * 128 *
109 * @return An int32_t containing an error code from <code>pp_errors.h</code>. 129 * @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 130 * Succeeds if the directory already exists. Fails if ancestor directories
111 * do not exist and <code>make_ancestors</code> was passed as 131 * do not exist and <code>make_ancestors</code> was passed as
112 * <code>PP_FALSE</code>. 132 * <code>PP_FALSE</code>.
113 */ 133 */
134 [deprecate=1.2]
114 int32_t MakeDirectory([in] PP_Resource directory_ref, 135 int32_t MakeDirectory([in] PP_Resource directory_ref,
115 [in] PP_Bool make_ancestors, 136 [in] PP_Bool make_ancestors,
116 [in] PP_CompletionCallback callback); 137 [in] PP_CompletionCallback callback);
117 138
118 /** 139 /**
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 /**
119 * Touch() Updates time stamps for a file. You must have write access to the 160 * Touch() Updates time stamps for a file. You must have write access to the
120 * file if it exists in the external filesystem. 161 * file if it exists in the external filesystem.
121 * 162 *
122 * @param[in] file_ref A <code>PP_Resource</code> corresponding to a file 163 * @param[in] file_ref A <code>PP_Resource</code> corresponding to a file
123 * reference. 164 * reference.
124 * @param[in] last_access_time The last time the file was accessed. 165 * @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. 166 * @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 167 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
127 * completion of Touch(). 168 * completion of Touch().
128 * 169 *
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 * completion. 238 * completion.
198 * 239 *
199 * @return An int32_t containing an error code from <code>pp_errors.h</code>. 240 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
200 */ 241 */
201 [version=1.1] 242 [version=1.1]
202 int32_t ReadDirectoryEntries([in] PP_Resource file_ref, 243 int32_t ReadDirectoryEntries([in] PP_Resource file_ref,
203 [in] PP_ArrayOutput output, 244 [in] PP_ArrayOutput output,
204 [in] PP_CompletionCallback callback); 245 [in] PP_CompletionCallback callback);
205 }; 246 };
206 247
OLDNEW
« no previous file with comments | « content/renderer/pepper/plugin_module.cc ('k') | ppapi/c/ppb_file_ref.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698