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

Unified 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: fix win build 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/api/ppb_file_ref.idl
diff --git a/ppapi/api/ppb_file_ref.idl b/ppapi/api/ppb_file_ref.idl
index d9226471a9f23cc6e9c862369ef905c25a9731b5..ae23d12d5949b96a1b9712e40155d24823e38707 100644
--- a/ppapi/api/ppb_file_ref.idl
+++ b/ppapi/api/ppb_file_ref.idl
@@ -10,7 +10,26 @@
label Chrome {
M14 = 1.0,
- M28 = 1.1
+ M28 = 1.1,
+ [channel=dev] M34 = 1.2
+};
+
+/**
+ * The <code>PP_MakeDirectoryFlags</code> enum contains flags used to control
+ * 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.
+ */
+[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.
+enum PP_MakeDirectoryFlags {
+ PP_MAKEDIRECTORYFLAG_NONE = 0 << 0,
+
+ /** Requests that ancestor directories are created if they do not exist. */
+ PP_MAKEDIRECTORYFLAG_WITH_ANCESTORS = 1 << 0,
+
+ /**
+ * 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.
+ * already exists.
+ */
+ PP_MAKEDIRECTORYFLAG_EXCLUSIVE = 1 << 1
};
/**
@@ -105,17 +124,40 @@ interface PPB_FileRef {
* @param[in] make_ancestors A <code>PP_Bool</code> set to
* <code>PP_TRUE</code> to make ancestor directories or <code>PP_FALSE</code>
* if ancestor directories are not needed.
+ * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
+ * completion of MakeDirectory().
*
* @return An int32_t containing an error code from <code>pp_errors.h</code>.
* Succeeds if the directory already exists. Fails if ancestor directories
* do not exist and <code>make_ancestors</code> was passed as
* <code>PP_FALSE</code>.
*/
+ [deprecate=1.2]
int32_t MakeDirectory([in] PP_Resource directory_ref,
[in] PP_Bool make_ancestors,
[in] PP_CompletionCallback callback);
/**
+ * MakeDirectory() makes a new directory in the file system according to the
+ * given <code>make_directory_flags</code>, which is a bit-mask of the
+ * <code>PP_MakeDirectoryFlags</code> values. It is not valid to make a
+ * directory in the external file system.
+ *
+ * @param[in] file_ref A <code>PP_Resource</code> corresponding to a file
+ * reference.
+ * @param[in] make_directory_flags A bit-mask of the
+ * <code>PP_MakeDirectoryFlags</code> values.
+ * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
+ * completion of MakeDirectory().
+ *
+ * @return An int32_t containing an error code from <code>pp_errors.h</code>.
+ */
+ [version=1.2]
+ int32_t MakeDirectory([in] PP_Resource directory_ref,
+ [in] int32_t make_directory_flags,
+ [in] PP_CompletionCallback callback);
+
+ /**
* Touch() Updates time stamps for a file. You must have write access to the
* file if it exists in the external filesystem.
*

Powered by Google App Engine
This is Rietveld 408576698