summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authornhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-09 07:45:29 +0000
committernhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-09 07:45:29 +0000
commitd1dea5daa1c8a8fcf0bd81ec473e78a69655fa65 (patch)
treedfd21bd5eed4d1cd5f572237e819c1d2e9a76022 /ppapi
parent600dc3d30376f58f5b3960fc04ac407c39e9daa1 (diff)
downloadchromium_src-d1dea5daa1c8a8fcf0bd81ec473e78a69655fa65.zip
chromium_src-d1dea5daa1c8a8fcf0bd81ec473e78a69655fa65.tar.gz
chromium_src-d1dea5daa1c8a8fcf0bd81ec473e78a69655fa65.tar.bz2
PPAPI: Add new PPB_FileRef.MakeDirectory to support exclusive operation
Current PPB_FileRef.MakeDirectory returns PP_OK if a directory exists on the given path. This makes it difficult to create POSIX compatible API on top of PPAPI. This change introduces new PPB_FileRef.MakeDirectory as dev channel API. That makes a new directory according to the given PP_MakeDirectoryFlags values. The flags provide exclusive operation option. If exclusive flag is specified and a directory exists on the given path, the function fails and returns PP_ERROR_FILEEXISTS. BUG=314879 TEST=browser_tests Review URL: https://codereview.chromium.org/113363004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243802 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/api/ppb_file_ref.idl43
-rw-r--r--ppapi/c/ppb_file_ref.h78
-rw-r--r--ppapi/cpp/file_ref.cc91
-rw-r--r--ppapi/cpp/file_ref.h28
-rw-r--r--ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c87
-rw-r--r--ppapi/proxy/file_ref_resource.cc4
-rw-r--r--ppapi/proxy/file_ref_resource.h4
-rw-r--r--ppapi/proxy/interface_list.cc8
-rw-r--r--ppapi/proxy/ppapi_messages.h2
-rw-r--r--ppapi/tests/test_file_io.cc3
-rw-r--r--ppapi/tests/test_file_ref.cc77
-rw-r--r--ppapi/thunk/interfaces_ppb_public_dev_channel.h1
-rw-r--r--ppapi/thunk/ppb_file_ref_api.h2
-rw-r--r--ppapi/thunk/ppb_file_ref_thunk.cc36
-rw-r--r--ppapi/thunk/thunk.h1
15 files changed, 363 insertions, 102 deletions
diff --git a/ppapi/api/ppb_file_ref.idl b/ppapi/api/ppb_file_ref.idl
index d922647..7685836 100644
--- a/ppapi/api/ppb_file_ref.idl
+++ b/ppapi/api/ppb_file_ref.idl
@@ -10,7 +10,25 @@
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>PPB_FileRef.MakeDirectory()</code>.
+ */
+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 PPB_FileRef.MakeDirectory() call fails if the directory
+ * already exists.
+ */
+ PP_MAKEDIRECTORYFLAG_EXCLUSIVE = 1 << 1
};
/**
@@ -105,17 +123,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.
*
diff --git a/ppapi/c/ppb_file_ref.h b/ppapi/c/ppb_file_ref.h
index 873ef18..035e3ee 100644
--- a/ppapi/c/ppb_file_ref.h
+++ b/ppapi/c/ppb_file_ref.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From ppb_file_ref.idl modified Thu Aug 15 10:50:43 2013. */
+/* From ppb_file_ref.idl modified Wed Jan 8 12:40:12 2014. */
#ifndef PPAPI_C_PPB_FILE_REF_H_
#define PPAPI_C_PPB_FILE_REF_H_
@@ -20,6 +20,7 @@
#define PPB_FILEREF_INTERFACE_1_0 "PPB_FileRef;1.0"
#define PPB_FILEREF_INTERFACE_1_1 "PPB_FileRef;1.1"
+#define PPB_FILEREF_INTERFACE_1_2 "PPB_FileRef;1.2" /* dev */
#define PPB_FILEREF_INTERFACE PPB_FILEREF_INTERFACE_1_1
/**
@@ -30,6 +31,28 @@
/**
+ * @addtogroup Enums
+ * @{
+ */
+/**
+ * The <code>PP_MakeDirectoryFlags</code> enum contains flags used to control
+ * behavior of <code>PPB_FileRef.MakeDirectory()</code>.
+ */
+typedef enum {
+ 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 PPB_FileRef.MakeDirectory() call fails if the directory
+ * already exists.
+ */
+ PP_MAKEDIRECTORYFLAG_EXCLUSIVE = 1 << 1
+} PP_MakeDirectoryFlags;
+/**
+ * @}
+ */
+
+/**
* @addtogroup Interfaces
* @{
*/
@@ -38,7 +61,7 @@
* a file system. This struct contains a <code>PP_FileSystemType</code>
* identifier and a file path string.
*/
-struct PPB_FileRef_1_1 {
+struct PPB_FileRef_1_2 { /* dev */
/**
* Create() creates a weak pointer to a file in the given file system. File
* paths are POSIX style.
@@ -110,24 +133,22 @@ struct PPB_FileRef_1_1 {
*/
PP_Resource (*GetParent)(PP_Resource file_ref);
/**
- * MakeDirectory() makes a new directory in the file system as well as any
- * parent directories if the <code>make_ancestors</code> argument is
- * <code>PP_TRUE</code>. It is not valid to make a directory in the external
- * file system.
+ * 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_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] 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>.
- * 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>.
*/
int32_t (*MakeDirectory)(PP_Resource directory_ref,
- PP_Bool make_ancestors,
+ int32_t make_directory_flags,
struct PP_CompletionCallback callback);
/**
* Touch() Updates time stamps for a file. You must have write access to the
@@ -212,8 +233,6 @@ struct PPB_FileRef_1_1 {
struct PP_CompletionCallback callback);
};
-typedef struct PPB_FileRef_1_1 PPB_FileRef;
-
struct PPB_FileRef_1_0 {
PP_Resource (*Create)(PP_Resource file_system, const char* path);
PP_Bool (*IsFileRef)(PP_Resource resource);
@@ -234,6 +253,35 @@ struct PPB_FileRef_1_0 {
PP_Resource new_file_ref,
struct PP_CompletionCallback callback);
};
+
+struct PPB_FileRef_1_1 {
+ PP_Resource (*Create)(PP_Resource file_system, const char* path);
+ PP_Bool (*IsFileRef)(PP_Resource resource);
+ PP_FileSystemType (*GetFileSystemType)(PP_Resource file_ref);
+ struct PP_Var (*GetName)(PP_Resource file_ref);
+ struct PP_Var (*GetPath)(PP_Resource file_ref);
+ PP_Resource (*GetParent)(PP_Resource file_ref);
+ int32_t (*MakeDirectory)(PP_Resource directory_ref,
+ PP_Bool make_ancestors,
+ struct PP_CompletionCallback callback);
+ int32_t (*Touch)(PP_Resource file_ref,
+ PP_Time last_access_time,
+ PP_Time last_modified_time,
+ struct PP_CompletionCallback callback);
+ int32_t (*Delete)(PP_Resource file_ref,
+ struct PP_CompletionCallback callback);
+ int32_t (*Rename)(PP_Resource file_ref,
+ PP_Resource new_file_ref,
+ struct PP_CompletionCallback callback);
+ int32_t (*Query)(PP_Resource file_ref,
+ struct PP_FileInfo* info,
+ struct PP_CompletionCallback callback);
+ int32_t (*ReadDirectoryEntries)(PP_Resource file_ref,
+ struct PP_ArrayOutput output,
+ struct PP_CompletionCallback callback);
+};
+
+typedef struct PPB_FileRef_1_1 PPB_FileRef;
/**
* @}
*/
diff --git a/ppapi/cpp/file_ref.cc b/ppapi/cpp/file_ref.cc
index 0bc9487..f9294a7 100644
--- a/ppapi/cpp/file_ref.cc
+++ b/ppapi/cpp/file_ref.cc
@@ -4,6 +4,7 @@
#include "ppapi/cpp/file_ref.h"
+#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/cpp/completion_callback.h"
#include "ppapi/cpp/directory_entry.h"
@@ -22,6 +23,10 @@ template <> const char* interface_name<PPB_FileRef_1_1>() {
return PPB_FILEREF_INTERFACE_1_1;
}
+template <> const char* interface_name<PPB_FileRef_1_2>() {
+ return PPB_FILEREF_INTERFACE_1_2;
+}
+
} // namespace
FileRef::FileRef(PP_Resource resource) : Resource(resource) {
@@ -32,7 +37,10 @@ FileRef::FileRef(PassRef, PP_Resource resource) : Resource(PASS_REF, resource) {
FileRef::FileRef(const FileSystem& file_system,
const char* path) {
- if (has_interface<PPB_FileRef_1_1>()) {
+ if (has_interface<PPB_FileRef_1_2>()) {
+ PassRefFromConstructor(get_interface<PPB_FileRef_1_2>()->Create(
+ file_system.pp_resource(), path));
+ } else if (has_interface<PPB_FileRef_1_1>()) {
PassRefFromConstructor(get_interface<PPB_FileRef_1_1>()->Create(
file_system.pp_resource(), path));
} else if (has_interface<PPB_FileRef_1_0>()) {
@@ -46,6 +54,8 @@ FileRef::FileRef(const FileRef& other)
}
PP_FileSystemType FileRef::GetFileSystemType() const {
+ if (has_interface<PPB_FileRef_1_2>())
+ return get_interface<PPB_FileRef_1_2>()->GetFileSystemType(pp_resource());
if (has_interface<PPB_FileRef_1_1>())
return get_interface<PPB_FileRef_1_1>()->GetFileSystemType(pp_resource());
if (has_interface<PPB_FileRef_1_0>())
@@ -54,6 +64,10 @@ PP_FileSystemType FileRef::GetFileSystemType() const {
}
Var FileRef::GetName() const {
+ if (has_interface<PPB_FileRef_1_2>()) {
+ return Var(PASS_REF,
+ get_interface<PPB_FileRef_1_2>()->GetName(pp_resource()));
+ }
if (has_interface<PPB_FileRef_1_1>()) {
return Var(PASS_REF,
get_interface<PPB_FileRef_1_1>()->GetName(pp_resource()));
@@ -66,6 +80,10 @@ Var FileRef::GetName() const {
}
Var FileRef::GetPath() const {
+ if (has_interface<PPB_FileRef_1_2>()) {
+ return Var(PASS_REF,
+ get_interface<PPB_FileRef_1_2>()->GetPath(pp_resource()));
+ }
if (has_interface<PPB_FileRef_1_1>()) {
return Var(PASS_REF,
get_interface<PPB_FileRef_1_1>()->GetPath(pp_resource()));
@@ -78,6 +96,10 @@ Var FileRef::GetPath() const {
}
FileRef FileRef::GetParent() const {
+ if (has_interface<PPB_FileRef_1_2>()) {
+ return FileRef(PASS_REF,
+ get_interface<PPB_FileRef_1_2>()->GetParent(pp_resource()));
+ }
if (has_interface<PPB_FileRef_1_1>()) {
return FileRef(PASS_REF,
get_interface<PPB_FileRef_1_1>()->GetParent(pp_resource()));
@@ -89,34 +111,28 @@ FileRef FileRef::GetParent() const {
return FileRef();
}
-int32_t FileRef::MakeDirectory(const CompletionCallback& cc) {
- if (has_interface<PPB_FileRef_1_1>()) {
- return get_interface<PPB_FileRef_1_1>()->MakeDirectory(
- pp_resource(),
- PP_FALSE, // make_ancestors
- cc.pp_completion_callback());
- }
- if (has_interface<PPB_FileRef_1_0>()) {
- return get_interface<PPB_FileRef_1_0>()->MakeDirectory(
+int32_t FileRef::MakeDirectory(int32_t make_directory_flags,
+ const CompletionCallback& cc) {
+ if (has_interface<PPB_FileRef_1_2>()) {
+ return get_interface<PPB_FileRef_1_2>()->MakeDirectory(
pp_resource(),
- PP_FALSE, // make_ancestors
+ make_directory_flags,
cc.pp_completion_callback());
}
- return cc.MayForce(PP_ERROR_NOINTERFACE);
-}
-
-int32_t FileRef::MakeDirectoryIncludingAncestors(
- const CompletionCallback& cc) {
if (has_interface<PPB_FileRef_1_1>()) {
+ if (make_directory_flags & ~PP_MAKEDIRECTORYFLAG_WITH_ANCESTORS)
+ return cc.MayForce(PP_ERROR_NOTSUPPORTED);
return get_interface<PPB_FileRef_1_1>()->MakeDirectory(
pp_resource(),
- PP_TRUE, // make_ancestors
+ PP_FromBool(make_directory_flags & PP_MAKEDIRECTORYFLAG_WITH_ANCESTORS),
cc.pp_completion_callback());
}
if (has_interface<PPB_FileRef_1_0>()) {
+ if (make_directory_flags & ~PP_MAKEDIRECTORYFLAG_WITH_ANCESTORS)
+ return cc.MayForce(PP_ERROR_NOTSUPPORTED);
return get_interface<PPB_FileRef_1_0>()->MakeDirectory(
pp_resource(),
- PP_TRUE, // make_ancestors
+ PP_FromBool(make_directory_flags & PP_MAKEDIRECTORYFLAG_WITH_ANCESTORS),
cc.pp_completion_callback());
}
return cc.MayForce(PP_ERROR_NOINTERFACE);
@@ -125,6 +141,11 @@ int32_t FileRef::MakeDirectoryIncludingAncestors(
int32_t FileRef::Touch(PP_Time last_access_time,
PP_Time last_modified_time,
const CompletionCallback& cc) {
+ if (has_interface<PPB_FileRef_1_2>()) {
+ return get_interface<PPB_FileRef_1_2>()->Touch(
+ pp_resource(), last_access_time, last_modified_time,
+ cc.pp_completion_callback());
+ }
if (has_interface<PPB_FileRef_1_1>()) {
return get_interface<PPB_FileRef_1_1>()->Touch(
pp_resource(), last_access_time, last_modified_time,
@@ -139,6 +160,10 @@ int32_t FileRef::Touch(PP_Time last_access_time,
}
int32_t FileRef::Delete(const CompletionCallback& cc) {
+ if (has_interface<PPB_FileRef_1_2>()) {
+ return get_interface<PPB_FileRef_1_2>()->Delete(
+ pp_resource(), cc.pp_completion_callback());
+ }
if (has_interface<PPB_FileRef_1_1>()) {
return get_interface<PPB_FileRef_1_1>()->Delete(
pp_resource(), cc.pp_completion_callback());
@@ -152,6 +177,10 @@ int32_t FileRef::Delete(const CompletionCallback& cc) {
int32_t FileRef::Rename(const FileRef& new_file_ref,
const CompletionCallback& cc) {
+ if (has_interface<PPB_FileRef_1_2>()) {
+ return get_interface<PPB_FileRef_1_2>()->Rename(
+ pp_resource(), new_file_ref.pp_resource(), cc.pp_completion_callback());
+ }
if (has_interface<PPB_FileRef_1_1>()) {
return get_interface<PPB_FileRef_1_1>()->Rename(
pp_resource(), new_file_ref.pp_resource(), cc.pp_completion_callback());
@@ -164,19 +193,29 @@ int32_t FileRef::Rename(const FileRef& new_file_ref,
}
int32_t FileRef::Query(const CompletionCallbackWithOutput<PP_FileInfo>& cc) {
- if (!has_interface<PPB_FileRef_1_1>())
- return cc.MayForce(PP_ERROR_NOINTERFACE);
- return get_interface<PPB_FileRef_1_1>()->Query(
- pp_resource(), cc.output(), cc.pp_completion_callback());
+ if (has_interface<PPB_FileRef_1_2>()) {
+ return get_interface<PPB_FileRef_1_2>()->Query(
+ pp_resource(), cc.output(), cc.pp_completion_callback());
+ }
+ if (has_interface<PPB_FileRef_1_1>()) {
+ return get_interface<PPB_FileRef_1_1>()->Query(
+ pp_resource(), cc.output(), cc.pp_completion_callback());
+ }
+ return cc.MayForce(PP_ERROR_NOINTERFACE);
}
int32_t FileRef::ReadDirectoryEntries(
const CompletionCallbackWithOutput<std::vector<DirectoryEntry> >&
callback) {
- if (!has_interface<PPB_FileRef_1_1>())
- return callback.MayForce(PP_ERROR_NOINTERFACE);
- return get_interface<PPB_FileRef_1_1>()->ReadDirectoryEntries(
- pp_resource(), callback.output(), callback.pp_completion_callback());
+ if (has_interface<PPB_FileRef_1_2>()) {
+ return get_interface<PPB_FileRef_1_2>()->ReadDirectoryEntries(
+ pp_resource(), callback.output(), callback.pp_completion_callback());
+ }
+ if (has_interface<PPB_FileRef_1_1>()) {
+ return get_interface<PPB_FileRef_1_1>()->ReadDirectoryEntries(
+ pp_resource(), callback.output(), callback.pp_completion_callback());
+ }
+ return callback.MayForce(PP_ERROR_NOINTERFACE);
}
} // namespace pp
diff --git a/ppapi/cpp/file_ref.h b/ppapi/cpp/file_ref.h
index 452d2a6..9f94088 100644
--- a/ppapi/cpp/file_ref.h
+++ b/ppapi/cpp/file_ref.h
@@ -90,30 +90,20 @@ class FileRef : public Resource {
/// <code>PP_FileSystemType_External</code>.
FileRef GetParent() const;
- /// MakeDirectory() makes a new directory in the file system. It is not
- /// valid to make a directory in the external file system.
- /// <strong>Note:</strong> Use MakeDirectoryIncludingAncestors() to create
- /// parent directories.
- ///
- /// @param[in] cc A <code>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
- /// directortories do not exist (see MakeDirectoryIncludingAncestors for the
- /// alternative).
- int32_t MakeDirectory(const CompletionCallback& cc);
-
- /// MakeDirectoryIncludingAncestors() makes a new directory in the file
- /// system as well as any parent directories. It is not valid to make a
+ /// 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] make_directory_flags A bit-mask of the
+ /// <code>PP_MakeDirectoryFlags</code> values.
+ /// See <code>ppb_file_ref.h</code> for more details.
/// @param[in] cc A <code>CompletionCallback</code> to be called upon
- /// completion of MakeDirectoryIncludingAncestors().
+ /// completion of MakeDirectory().
///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
- /// Succeeds if the directory already exists.
- int32_t MakeDirectoryIncludingAncestors(const CompletionCallback& cc);
+ int32_t MakeDirectory(int32_t make_directory_flags,
+ const CompletionCallback& cc);
/// Touch() Updates time stamps for a file. You must have write access to the
/// file if it exists in the external filesystem.
diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
index 4bf9407..b83b98f 100644
--- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
+++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
@@ -143,6 +143,7 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_FileIO_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_FileIO_1_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_FileRef_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_FileRef_1_1;
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_FileRef_1_2;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_FileSystem_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Graphics2D_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Graphics2D_1_1;
@@ -526,6 +527,70 @@ static int32_t Pnacl_M28_PPB_FileRef_ReadDirectoryEntries(PP_Resource file_ref,
/* End wrapper methods for PPB_FileRef_1_1 */
+/* Begin wrapper methods for PPB_FileRef_1_2 */
+
+static PP_Resource Pnacl_M34_PPB_FileRef_Create(PP_Resource file_system, const char* path) {
+ const struct PPB_FileRef_1_2 *iface = Pnacl_WrapperInfo_PPB_FileRef_1_2.real_iface;
+ return iface->Create(file_system, path);
+}
+
+static PP_Bool Pnacl_M34_PPB_FileRef_IsFileRef(PP_Resource resource) {
+ const struct PPB_FileRef_1_2 *iface = Pnacl_WrapperInfo_PPB_FileRef_1_2.real_iface;
+ return iface->IsFileRef(resource);
+}
+
+static PP_FileSystemType Pnacl_M34_PPB_FileRef_GetFileSystemType(PP_Resource file_ref) {
+ const struct PPB_FileRef_1_2 *iface = Pnacl_WrapperInfo_PPB_FileRef_1_2.real_iface;
+ return iface->GetFileSystemType(file_ref);
+}
+
+static void Pnacl_M34_PPB_FileRef_GetName(struct PP_Var* _struct_result, PP_Resource file_ref) {
+ const struct PPB_FileRef_1_2 *iface = Pnacl_WrapperInfo_PPB_FileRef_1_2.real_iface;
+ *_struct_result = iface->GetName(file_ref);
+}
+
+static void Pnacl_M34_PPB_FileRef_GetPath(struct PP_Var* _struct_result, PP_Resource file_ref) {
+ const struct PPB_FileRef_1_2 *iface = Pnacl_WrapperInfo_PPB_FileRef_1_2.real_iface;
+ *_struct_result = iface->GetPath(file_ref);
+}
+
+static PP_Resource Pnacl_M34_PPB_FileRef_GetParent(PP_Resource file_ref) {
+ const struct PPB_FileRef_1_2 *iface = Pnacl_WrapperInfo_PPB_FileRef_1_2.real_iface;
+ return iface->GetParent(file_ref);
+}
+
+static int32_t Pnacl_M34_PPB_FileRef_MakeDirectory(PP_Resource directory_ref, int32_t make_directory_flags, struct PP_CompletionCallback* callback) {
+ const struct PPB_FileRef_1_2 *iface = Pnacl_WrapperInfo_PPB_FileRef_1_2.real_iface;
+ return iface->MakeDirectory(directory_ref, make_directory_flags, *callback);
+}
+
+static int32_t Pnacl_M34_PPB_FileRef_Touch(PP_Resource file_ref, PP_Time last_access_time, PP_Time last_modified_time, struct PP_CompletionCallback* callback) {
+ const struct PPB_FileRef_1_2 *iface = Pnacl_WrapperInfo_PPB_FileRef_1_2.real_iface;
+ return iface->Touch(file_ref, last_access_time, last_modified_time, *callback);
+}
+
+static int32_t Pnacl_M34_PPB_FileRef_Delete(PP_Resource file_ref, struct PP_CompletionCallback* callback) {
+ const struct PPB_FileRef_1_2 *iface = Pnacl_WrapperInfo_PPB_FileRef_1_2.real_iface;
+ return iface->Delete(file_ref, *callback);
+}
+
+static int32_t Pnacl_M34_PPB_FileRef_Rename(PP_Resource file_ref, PP_Resource new_file_ref, struct PP_CompletionCallback* callback) {
+ const struct PPB_FileRef_1_2 *iface = Pnacl_WrapperInfo_PPB_FileRef_1_2.real_iface;
+ return iface->Rename(file_ref, new_file_ref, *callback);
+}
+
+static int32_t Pnacl_M34_PPB_FileRef_Query(PP_Resource file_ref, struct PP_FileInfo* info, struct PP_CompletionCallback* callback) {
+ const struct PPB_FileRef_1_2 *iface = Pnacl_WrapperInfo_PPB_FileRef_1_2.real_iface;
+ return iface->Query(file_ref, info, *callback);
+}
+
+static int32_t Pnacl_M34_PPB_FileRef_ReadDirectoryEntries(PP_Resource file_ref, struct PP_ArrayOutput* output, struct PP_CompletionCallback* callback) {
+ const struct PPB_FileRef_1_2 *iface = Pnacl_WrapperInfo_PPB_FileRef_1_2.real_iface;
+ return iface->ReadDirectoryEntries(file_ref, *output, *callback);
+}
+
+/* End wrapper methods for PPB_FileRef_1_2 */
+
/* Begin wrapper methods for PPB_FileSystem_1_0 */
static PP_Resource Pnacl_M14_PPB_FileSystem_Create(PP_Instance instance, PP_FileSystemType type) {
@@ -4097,6 +4162,21 @@ static struct PPB_FileRef_1_1 Pnacl_Wrappers_PPB_FileRef_1_1 = {
.ReadDirectoryEntries = (int32_t (*)(PP_Resource file_ref, struct PP_ArrayOutput output, struct PP_CompletionCallback callback))&Pnacl_M28_PPB_FileRef_ReadDirectoryEntries
};
+static struct PPB_FileRef_1_2 Pnacl_Wrappers_PPB_FileRef_1_2 = {
+ .Create = (PP_Resource (*)(PP_Resource file_system, const char* path))&Pnacl_M34_PPB_FileRef_Create,
+ .IsFileRef = (PP_Bool (*)(PP_Resource resource))&Pnacl_M34_PPB_FileRef_IsFileRef,
+ .GetFileSystemType = (PP_FileSystemType (*)(PP_Resource file_ref))&Pnacl_M34_PPB_FileRef_GetFileSystemType,
+ .GetName = (struct PP_Var (*)(PP_Resource file_ref))&Pnacl_M34_PPB_FileRef_GetName,
+ .GetPath = (struct PP_Var (*)(PP_Resource file_ref))&Pnacl_M34_PPB_FileRef_GetPath,
+ .GetParent = (PP_Resource (*)(PP_Resource file_ref))&Pnacl_M34_PPB_FileRef_GetParent,
+ .MakeDirectory = (int32_t (*)(PP_Resource directory_ref, int32_t make_directory_flags, struct PP_CompletionCallback callback))&Pnacl_M34_PPB_FileRef_MakeDirectory,
+ .Touch = (int32_t (*)(PP_Resource file_ref, PP_Time last_access_time, PP_Time last_modified_time, struct PP_CompletionCallback callback))&Pnacl_M34_PPB_FileRef_Touch,
+ .Delete = (int32_t (*)(PP_Resource file_ref, struct PP_CompletionCallback callback))&Pnacl_M34_PPB_FileRef_Delete,
+ .Rename = (int32_t (*)(PP_Resource file_ref, PP_Resource new_file_ref, struct PP_CompletionCallback callback))&Pnacl_M34_PPB_FileRef_Rename,
+ .Query = (int32_t (*)(PP_Resource file_ref, struct PP_FileInfo* info, struct PP_CompletionCallback callback))&Pnacl_M34_PPB_FileRef_Query,
+ .ReadDirectoryEntries = (int32_t (*)(PP_Resource file_ref, struct PP_ArrayOutput output, struct PP_CompletionCallback callback))&Pnacl_M34_PPB_FileRef_ReadDirectoryEntries
+};
+
static struct PPB_FileSystem_1_0 Pnacl_Wrappers_PPB_FileSystem_1_0 = {
.Create = (PP_Resource (*)(PP_Instance instance, PP_FileSystemType type))&Pnacl_M14_PPB_FileSystem_Create,
.IsFileSystem = (PP_Bool (*)(PP_Resource resource))&Pnacl_M14_PPB_FileSystem_IsFileSystem,
@@ -5119,6 +5199,12 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_FileRef_1_1 = {
.real_iface = NULL
};
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_FileRef_1_2 = {
+ .iface_macro = PPB_FILEREF_INTERFACE_1_2,
+ .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_FileRef_1_2,
+ .real_iface = NULL
+};
+
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_FileSystem_1_0 = {
.iface_macro = PPB_FILESYSTEM_INTERFACE_1_0,
.wrapped_iface = (void *) &Pnacl_Wrappers_PPB_FileSystem_1_0,
@@ -5690,6 +5776,7 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = {
&Pnacl_WrapperInfo_PPB_FileIO_1_1,
&Pnacl_WrapperInfo_PPB_FileRef_1_0,
&Pnacl_WrapperInfo_PPB_FileRef_1_1,
+ &Pnacl_WrapperInfo_PPB_FileRef_1_2,
&Pnacl_WrapperInfo_PPB_FileSystem_1_0,
&Pnacl_WrapperInfo_PPB_Graphics2D_1_0,
&Pnacl_WrapperInfo_PPB_Graphics2D_1_1,
diff --git a/ppapi/proxy/file_ref_resource.cc b/ppapi/proxy/file_ref_resource.cc
index 7cd96bc..ec6662f 100644
--- a/ppapi/proxy/file_ref_resource.cc
+++ b/ppapi/proxy/file_ref_resource.cc
@@ -129,11 +129,11 @@ PP_Resource FileRefResource::GetParent() {
}
int32_t FileRefResource::MakeDirectory(
- PP_Bool make_ancestors,
+ int32_t make_directory_flags,
scoped_refptr<TrackedCallback> callback) {
Call<PpapiPluginMsg_FileRef_MakeDirectoryReply>(
BROWSER,
- PpapiHostMsg_FileRef_MakeDirectory(PP_TRUE == make_ancestors),
+ PpapiHostMsg_FileRef_MakeDirectory(make_directory_flags),
base::Bind(&FileRefResource::RunTrackedCallback, this, callback));
return PP_OK_COMPLETIONPENDING;
}
diff --git a/ppapi/proxy/file_ref_resource.h b/ppapi/proxy/file_ref_resource.h
index f982438..96f71db 100644
--- a/ppapi/proxy/file_ref_resource.h
+++ b/ppapi/proxy/file_ref_resource.h
@@ -42,8 +42,8 @@ class PPAPI_PROXY_EXPORT FileRefResource
virtual PP_Var GetPath() const OVERRIDE;
virtual PP_Resource GetParent() OVERRIDE;
virtual int32_t MakeDirectory(
- PP_Bool make_ancestors,
- scoped_refptr<TrackedCallback> callback) OVERRIDE;
+ int32_t make_directory_flags,
+ scoped_refptr<TrackedCallback> callback) OVERRIDE;
virtual int32_t Touch(PP_Time last_access_time,
PP_Time last_modified_time,
scoped_refptr<TrackedCallback> callback) OVERRIDE;
diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc
index c734710..c1ff168 100644
--- a/ppapi/proxy/interface_list.cc
+++ b/ppapi/proxy/interface_list.cc
@@ -192,12 +192,8 @@ InterfaceList::InterfaceList() {
#endif // !defined(OS_NACL)
}
{
- // TODO(teravest): These lines should be uncommented when a dev channel
- // interface is added. They're commented right now because they cause an
- // unused variable warning.
- //
- // Permission current_required_permission = PERMISSION_DEV_CHANNEL;
- // #include "ppapi/thunk/interfaces_ppb_public_dev_channel.h"
+ Permission current_required_permission = PERMISSION_DEV_CHANNEL;
+ #include "ppapi/thunk/interfaces_ppb_public_dev_channel.h"
}
#undef PROXIED_API
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index 65d7ee2..fbccd54 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -1256,7 +1256,7 @@ IPC_MESSAGE_CONTROL2(PpapiHostMsg_FileRef_CreateInternal,
// Requests that the browser create a directory at the location indicated by
// the FileRef.
IPC_MESSAGE_CONTROL1(PpapiHostMsg_FileRef_MakeDirectory,
- bool /* make_ancestors */)
+ int32_t /* make_directory_flags */)
IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileRef_MakeDirectoryReply)
// Requests that the browser update the last accessed and last modified times
diff --git a/ppapi/tests/test_file_io.cc b/ppapi/tests/test_file_io.cc
index f699ba1..ec547f1 100644
--- a/ppapi/tests/test_file_io.cc
+++ b/ppapi/tests/test_file_io.cc
@@ -296,7 +296,8 @@ std::string TestFileIO::TestOpenDirectory() {
// Make a directory.
pp::FileRef dir_ref(file_system, "/test_dir_open_directory");
- callback.WaitForResult(dir_ref.MakeDirectory(callback.GetCallback()));
+ callback.WaitForResult(dir_ref.MakeDirectory(
+ PP_MAKEDIRECTORYFLAG_NONE, callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
ASSERT_EQ(PP_OK, callback.result());
diff --git a/ppapi/tests/test_file_ref.cc b/ppapi/tests/test_file_ref.cc
index 0a10a32..015f54c 100644
--- a/ppapi/tests/test_file_ref.cc
+++ b/ppapi/tests/test_file_ref.cc
@@ -298,41 +298,59 @@ std::string TestFileRef::TestMakeDirectory() {
CHECK_CALLBACK_BEHAVIOR(callback);
ASSERT_EQ(PP_OK, callback.result());
- // MakeDirectory.
- pp::FileRef dir_ref(file_system, "/test_dir_make_directory");
- callback.WaitForResult(dir_ref.MakeDirectory(callback.GetCallback()));
+ // Make a directory.
+ pp::FileRef dir_ref(file_system, "/dir_make_dir");
+ callback.WaitForResult(
+ dir_ref.MakeDirectory(PP_MAKEDIRECTORYFLAG_NONE, callback.GetCallback()));
+ CHECK_CALLBACK_BEHAVIOR(callback);
+ ASSERT_EQ(PP_OK, callback.result());
+
+ // Make a directory on the existing path without exclusive flag.
+ callback.WaitForResult(
+ dir_ref.MakeDirectory(PP_MAKEDIRECTORYFLAG_NONE, callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
ASSERT_EQ(PP_OK, callback.result());
- // MakeDirectory aborted.
+ // Making a directory should be aborted.
int32_t rv = PP_ERROR_FAILED;
{
- rv = pp::FileRef(file_system, "/test_dir_make_abort")
- .MakeDirectory(callback.GetCallback());
+ rv = pp::FileRef(file_system, "/dir_make_dir_abort")
+ .MakeDirectory(PP_MAKEDIRECTORYFLAG_NONE, callback.GetCallback());
}
callback.WaitForAbortResult(rv);
CHECK_CALLBACK_BEHAVIOR(callback);
- // MakeDirectoryIncludingAncestors.
- dir_ref = pp::FileRef(file_system, "/dir_make_dir_1/dir_make_dir_2");
+ // Make nested directories.
+ dir_ref = pp::FileRef(file_system, "/dir_make_nested_dir_1/dir");
callback.WaitForResult(
- dir_ref.MakeDirectoryIncludingAncestors(callback.GetCallback()));
+ dir_ref.MakeDirectory(PP_MAKEDIRECTORYFLAG_WITH_ANCESTORS,
+ callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
ASSERT_EQ(PP_OK, callback.result());
- // MakeDirectoryIncludingAncestors aborted.
- {
- rv = pp::FileRef(file_system, "/dir_make_abort_1/dir_make_abort_2")
- .MakeDirectoryIncludingAncestors(callback.GetCallback());
- }
- callback.WaitForAbortResult(rv);
+ dir_ref = pp::FileRef(file_system, "/dir_make_nested_dir_2/dir");
+ callback.WaitForResult(
+ dir_ref.MakeDirectory(PP_MAKEDIRECTORYFLAG_NONE, callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
+ ASSERT_EQ(PP_ERROR_FILENOTFOUND, callback.result());
+
+ // Ensure there is no directory on the path to test exclusive cases.
+ dir_ref = pp::FileRef(file_system, "/dir_make_dir_exclusive");
+ rv = DeleteDirectoryRecursively(&dir_ref);
+ ASSERT_TRUE(rv == PP_OK || rv == PP_ERROR_FILENOTFOUND);
+
+ // Make a directory exclusively.
+ callback.WaitForResult(
+ dir_ref.MakeDirectory(PP_MAKEDIRECTORYFLAG_EXCLUSIVE,
+ callback.GetCallback()));
+ CHECK_CALLBACK_BEHAVIOR(callback);
+ ASSERT_EQ(PP_OK, callback.result());
- // MakeDirectory with nested path should fail.
- dir_ref = pp::FileRef(file_system, "/dir_make_dir_3/dir_make_dir_4");
- callback.WaitForResult(dir_ref.MakeDirectory(callback.GetCallback()));
+ callback.WaitForResult(
+ dir_ref.MakeDirectory(PP_MAKEDIRECTORYFLAG_EXCLUSIVE,
+ callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
- ASSERT_NE(PP_OK, callback.result());
+ ASSERT_EQ(PP_ERROR_FILEEXISTS, callback.result());
PASS();
}
@@ -432,7 +450,8 @@ std::string TestFileRef::TestDeleteFileAndDirectory() {
ASSERT_EQ(PP_OK, callback.result());
pp::FileRef dir_ref(file_system, "/dir_delete");
- callback.WaitForResult(dir_ref.MakeDirectory(callback.GetCallback()));
+ callback.WaitForResult(dir_ref.MakeDirectory(
+ PP_MAKEDIRECTORYFLAG_NONE, callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
ASSERT_EQ(PP_OK, callback.result());
@@ -442,7 +461,8 @@ std::string TestFileRef::TestDeleteFileAndDirectory() {
pp::FileRef nested_dir_ref(file_system, "/dir_delete_1/dir_delete_2");
callback.WaitForResult(
- nested_dir_ref.MakeDirectoryIncludingAncestors(callback.GetCallback()));
+ nested_dir_ref.MakeDirectory(PP_MAKEDIRECTORYFLAG_WITH_ANCESTORS,
+ callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
ASSERT_EQ(PP_OK, callback.result());
@@ -496,7 +516,8 @@ std::string TestFileRef::TestRenameFileAndDirectory() {
ASSERT_EQ(PP_OK, callback.result());
pp::FileRef dir_ref(file_system, "/dir_rename");
- callback.WaitForResult(dir_ref.MakeDirectory(callback.GetCallback()));
+ callback.WaitForResult(dir_ref.MakeDirectory(
+ PP_MAKEDIRECTORYFLAG_NONE, callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
ASSERT_EQ(PP_OK, callback.result());
@@ -508,7 +529,8 @@ std::string TestFileRef::TestRenameFileAndDirectory() {
pp::FileRef nested_dir_ref(file_system, "/dir_rename_1/dir_rename_2");
callback.WaitForResult(
- nested_dir_ref.MakeDirectoryIncludingAncestors(callback.GetCallback()));
+ nested_dir_ref.MakeDirectory(PP_MAKEDIRECTORYFLAG_WITH_ANCESTORS,
+ callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
ASSERT_EQ(PP_OK, callback.result());
@@ -615,7 +637,8 @@ std::string TestFileRef::TestFileNameEscaping() {
std::string test_dir_path = "/dir_for_escaping_test";
// Create a directory in which to test.
pp::FileRef test_dir_ref(file_system, test_dir_path.c_str());
- callback.WaitForResult(test_dir_ref.MakeDirectory(callback.GetCallback()));
+ callback.WaitForResult(test_dir_ref.MakeDirectory(
+ PP_MAKEDIRECTORYFLAG_NONE, callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
ASSERT_EQ(PP_OK, callback.result());
@@ -663,7 +686,8 @@ std::string TestFileRef::TestReadDirectoryEntries() {
int32_t rv = DeleteDirectoryRecursively(&test_dir);
ASSERT_TRUE(rv == PP_OK || rv == PP_ERROR_FILENOTFOUND);
- callback.WaitForResult(test_dir.MakeDirectory(callback.GetCallback()));
+ callback.WaitForResult(test_dir.MakeDirectory(
+ PP_MAKEDIRECTORYFLAG_NONE, callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
ASSERT_EQ(PP_OK, callback.result());
@@ -690,7 +714,8 @@ std::string TestFileRef::TestReadDirectoryEntries() {
buffer << test_dir_name << '/' << dir_prefix << i;
pp::FileRef file_ref(file_system, buffer.str().c_str());
- callback.WaitForResult(file_ref.MakeDirectory(callback.GetCallback()));
+ callback.WaitForResult(file_ref.MakeDirectory(
+ PP_MAKEDIRECTORYFLAG_NONE, callback.GetCallback()));
CHECK_CALLBACK_BEHAVIOR(callback);
ASSERT_EQ(PP_OK, callback.result());
diff --git a/ppapi/thunk/interfaces_ppb_public_dev_channel.h b/ppapi/thunk/interfaces_ppb_public_dev_channel.h
index a70442b..43c16b5 100644
--- a/ppapi/thunk/interfaces_ppb_public_dev_channel.h
+++ b/ppapi/thunk/interfaces_ppb_public_dev_channel.h
@@ -8,5 +8,6 @@
#include "ppapi/thunk/interfaces_preamble.h"
// Interfaces go here.
+PROXIED_IFACE(PPB_FILEREF_INTERFACE_1_2, PPB_FileRef_1_2)
#include "ppapi/thunk/interfaces_postamble.h"
diff --git a/ppapi/thunk/ppb_file_ref_api.h b/ppapi/thunk/ppb_file_ref_api.h
index b473ae2..2a27af5e8 100644
--- a/ppapi/thunk/ppb_file_ref_api.h
+++ b/ppapi/thunk/ppb_file_ref_api.h
@@ -28,7 +28,7 @@ class PPAPI_THUNK_EXPORT PPB_FileRef_API {
virtual PP_Var GetName() const = 0;
virtual PP_Var GetPath() const = 0;
virtual PP_Resource GetParent() = 0;
- virtual int32_t MakeDirectory(PP_Bool make_ancestors,
+ virtual int32_t MakeDirectory(int32_t make_directory_flags,
scoped_refptr<TrackedCallback> callback) = 0;
virtual int32_t Touch(PP_Time last_access_time,
PP_Time last_modified_time,
diff --git a/ppapi/thunk/ppb_file_ref_thunk.cc b/ppapi/thunk/ppb_file_ref_thunk.cc
index 64c90b5..ef31e922 100644
--- a/ppapi/thunk/ppb_file_ref_thunk.cc
+++ b/ppapi/thunk/ppb_file_ref_thunk.cc
@@ -87,8 +87,21 @@ int32_t MakeDirectory(PP_Resource directory_ref,
EnterFileRef enter(directory_ref, callback, true);
if (enter.failed())
return enter.retval();
- return enter.SetResult(enter.object()->MakeDirectory(make_ancestors,
- enter.callback()));
+ int32_t flag = make_ancestors ? PP_MAKEDIRECTORYFLAG_WITH_ANCESTORS
+ : PP_MAKEDIRECTORYFLAG_NONE;
+ return enter.SetResult(enter.object()->MakeDirectory(
+ flag, enter.callback()));
+}
+
+int32_t MakeDirectory_1_2(PP_Resource directory_ref,
+ int32_t make_directory_flags,
+ PP_CompletionCallback callback) {
+ VLOG(4) << "PPB_FileRef::MakeDirectory()";
+ EnterFileRef enter(directory_ref, callback, true);
+ if (enter.failed())
+ return enter.retval();
+ return enter.SetResult(enter.object()->MakeDirectory(
+ make_directory_flags, enter.callback()));
}
int32_t Touch(PP_Resource file_ref,
@@ -180,6 +193,21 @@ const PPB_FileRef_1_1 g_ppb_file_ref_thunk_1_1 = {
&ReadDirectoryEntries
};
+const PPB_FileRef_1_2 g_ppb_file_ref_thunk_1_2 = {
+ &Create,
+ &IsFileRef,
+ &GetFileSystemType,
+ &GetName,
+ &GetPath,
+ &GetParent,
+ &MakeDirectory_1_2,
+ &Touch,
+ &Delete,
+ &Rename,
+ &Query,
+ &ReadDirectoryEntries
+};
+
const PPB_FileRefPrivate g_ppb_file_ref_private_thunk = {
&GetAbsolutePath
};
@@ -194,6 +222,10 @@ const PPB_FileRef_1_1* GetPPB_FileRef_1_1_Thunk() {
return &g_ppb_file_ref_thunk_1_1;
}
+const PPB_FileRef_1_2* GetPPB_FileRef_1_2_Thunk() {
+ return &g_ppb_file_ref_thunk_1_2;
+}
+
const PPB_FileRefPrivate_0_1* GetPPB_FileRefPrivate_0_1_Thunk() {
return &g_ppb_file_ref_private_thunk;
}
diff --git a/ppapi/thunk/thunk.h b/ppapi/thunk/thunk.h
index 86a328f..a85ce77 100644
--- a/ppapi/thunk/thunk.h
+++ b/ppapi/thunk/thunk.h
@@ -25,6 +25,7 @@
#include "ppapi/thunk/interfaces_ppb_private_flash.h"
#include "ppapi/thunk/interfaces_ppb_public_stable.h"
#include "ppapi/thunk/interfaces_ppb_public_dev.h"
+#include "ppapi/thunk/interfaces_ppb_public_dev_channel.h"
#undef UNPROXIED_IFACE
#undef PROXIED_IFACE