summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authornhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-08 06:31:11 +0000
committernhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-08 06:31:11 +0000
commit4359457426b44936559c4aff30e52756f9356310 (patch)
treecd2f3930e6375a9dc04ed7e6e1c639d860ff450f /ppapi
parent9e29120223794db9e151127256ff2c8c2e0a79f3 (diff)
downloadchromium_src-4359457426b44936559c4aff30e52756f9356310.zip
chromium_src-4359457426b44936559c4aff30e52756f9356310.tar.gz
chromium_src-4359457426b44936559c4aff30e52756f9356310.tar.bz2
PPAPI: Generalize PPB_Ext_CrxFileSystem as PPB_IsolatedFileSystem
This change generalizes PPB_Ext_CrxFileSystem_Private, built on the isolated filesystem, so that we can easily reuse its components when introducing new isolated filesystem in PPAPI. This adds PPB_IsolatedFileSystem_Private API and enum indicating isolated filesystem type. PPB_Ext_CrxFileSystem_Private API is still remaining since some plugins may use the API. Both API share pepper resource and host implementations. BUG=286242 TEST=manual (see [1] and [2]) TBR=cpu@chromium.org [1] https://code.google.com/p/chromium/issues/detail?id=271126#c7 [2] https://codereview.chromium.org/59203002/ Review URL: https://codereview.chromium.org/51653004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233807 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/api/private/ppb_ext_crx_file_system_private.idl3
-rw-r--r--ppapi/api/private/ppb_isolated_file_system_private.idl52
-rw-r--r--ppapi/c/pp_macros.h4
-rw-r--r--ppapi/c/private/ppb_ext_crx_file_system_private.h3
-rw-r--r--ppapi/c/private/ppb_isolated_file_system_private.h84
-rw-r--r--ppapi/cpp/private/isolated_file_system_private.cc40
-rw-r--r--ppapi/cpp/private/isolated_file_system_private.h34
-rw-r--r--ppapi/examples/crxfs/crxfs.cc7
-rw-r--r--ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c22
-rw-r--r--ppapi/ppapi_proxy.gypi4
-rw-r--r--ppapi/ppapi_shared.gypi3
-rw-r--r--ppapi/ppapi_sources.gypi3
-rw-r--r--ppapi/proxy/file_system_resource.cc5
-rw-r--r--ppapi/proxy/file_system_resource.h2
-rw-r--r--ppapi/proxy/interface_list.cc1
-rw-r--r--ppapi/proxy/isolated_file_system_private_resource.cc (renamed from ppapi/proxy/ext_crx_file_system_private_resource.cc)39
-rw-r--r--ppapi/proxy/isolated_file_system_private_resource.h (renamed from ppapi/proxy/ext_crx_file_system_private_resource.h)33
-rw-r--r--ppapi/proxy/ppapi_messages.h21
-rw-r--r--ppapi/proxy/ppb_instance_proxy.cc9
-rw-r--r--ppapi/proxy/resource_creation_proxy.cc1
-rw-r--r--ppapi/shared_impl/resource.h1
-rw-r--r--ppapi/shared_impl/singleton_resource_id.h2
-rw-r--r--ppapi/thunk/interfaces_ppb_private_no_permissions.h2
-rw-r--r--ppapi/thunk/ppb_ext_crx_file_system_private_thunk.cc16
-rw-r--r--ppapi/thunk/ppb_isolated_file_system_private_api.h (renamed from ppapi/thunk/ppb_ext_crx_file_system_private_api.h)16
-rw-r--r--ppapi/thunk/ppb_isolated_file_system_private_thunk.cc51
26 files changed, 379 insertions, 79 deletions
diff --git a/ppapi/api/private/ppb_ext_crx_file_system_private.idl b/ppapi/api/private/ppb_ext_crx_file_system_private.idl
index 0458641..5c46de7 100644
--- a/ppapi/api/private/ppb_ext_crx_file_system_private.idl
+++ b/ppapi/api/private/ppb_ext_crx_file_system_private.idl
@@ -3,8 +3,6 @@
* found in the LICENSE file.
*/
-[generate_thunk,thunk_include="ppapi/thunk/ppb_ext_crx_file_system_private_api.h"]
-
/**
* This file contains the <code>PPB_Ext_CrxFileSystem_Private</code> interface.
*/
@@ -27,7 +25,6 @@ interface PPB_Ext_CrxFileSystem_Private {
*
* @return An int32_t containing an error code from <code>pp_errors.h</code>.
*/
- [singleton,api=PPB_Ext_CrxFileSystem_Private_API]
int32_t Open([in] PP_Instance instance,
[out] PP_Resource file_system,
[in] PP_CompletionCallback callback);
diff --git a/ppapi/api/private/ppb_isolated_file_system_private.idl b/ppapi/api/private/ppb_isolated_file_system_private.idl
new file mode 100644
index 0000000..cbbeb03
--- /dev/null
+++ b/ppapi/api/private/ppb_isolated_file_system_private.idl
@@ -0,0 +1,52 @@
+/* Copyright 2013 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+[generate_thunk,thunk_include="ppapi/thunk/ppb_isolated_file_system_private_api.h"]
+
+/**
+ * This file contains the <code>PPB_IsolatedFileSystem_Private</code> interface.
+ */
+label Chrome {
+ M33 = 0.1
+};
+
+
+/**
+ * The <code>PP_IsolatedFileSystemType_Private</code> values indicate the type
+ * of isolated file systems.
+ */
+[assert_size(4)]
+enum PP_IsolatedFileSystemType_Private {
+ /** Type for invalid file systems */
+ PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID = 0,
+ /** Type for CRX file systems */
+ PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX = 1
+};
+
+/* <code>PPB_IsolatedFileSystem_Private</code> interface */
+interface PPB_IsolatedFileSystem_Private {
+ /**
+ * Open() opens a file system corresponding the given file system type.
+ *
+ * When opening the CRX file system, this should be called from an extension
+ * context, otherwise it will fail.
+ *
+ * @param[in] instance A <code>PP_Instance</code> identifying the instance
+ * with the file system.
+ * @param[in] type A file system type as defined by
+ * <code>PP_IsolatedFileSystemType_Private</code> enum.
+ * @param[out] file_system An output <code>PP_Resource</code> corresponding
+ * to a PPB_FileSystem.
+ * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
+ * completion of Open.
+ *
+ * @return An int32_t containing an error code from <code>pp_errors.h</code>.
+ */
+ [singleton,api=PPB_IsolatedFileSystem_Private_API]
+ int32_t Open([in] PP_Instance instance,
+ [in] PP_IsolatedFileSystemType_Private type,
+ [out] PP_Resource file_system,
+ [in] PP_CompletionCallback callback);
+};
diff --git a/ppapi/c/pp_macros.h b/ppapi/c/pp_macros.h
index 73d14f0..e143b22 100644
--- a/ppapi/c/pp_macros.h
+++ b/ppapi/c/pp_macros.h
@@ -3,13 +3,13 @@
* found in the LICENSE file.
*/
-/* From pp_macros.idl modified Tue Oct 8 17:55:09 2013. */
+/* From pp_macros.idl modified Wed Mar 6 13:04:56 2013. */
#ifndef PPAPI_C_PP_MACROS_H_
#define PPAPI_C_PP_MACROS_H_
-#define PPAPI_RELEASE 32
+#define PPAPI_RELEASE 33
/**
* @file
diff --git a/ppapi/c/private/ppb_ext_crx_file_system_private.h b/ppapi/c/private/ppb_ext_crx_file_system_private.h
index 114a016..be77411 100644
--- a/ppapi/c/private/ppb_ext_crx_file_system_private.h
+++ b/ppapi/c/private/ppb_ext_crx_file_system_private.h
@@ -4,7 +4,7 @@
*/
/* From private/ppb_ext_crx_file_system_private.idl,
- * modified Fri May 3 09:55:27 2013.
+ * modified Fri Nov 1 12:23:59 2013.
*/
#ifndef PPAPI_C_PRIVATE_PPB_EXT_CRX_FILE_SYSTEM_PRIVATE_H_
@@ -23,6 +23,7 @@
/**
* @file
+ * This file contains the <code>PPB_Ext_CrxFileSystem_Private</code> interface.
*/
diff --git a/ppapi/c/private/ppb_isolated_file_system_private.h b/ppapi/c/private/ppb_isolated_file_system_private.h
new file mode 100644
index 0000000..4b9af4f
--- /dev/null
+++ b/ppapi/c/private/ppb_isolated_file_system_private.h
@@ -0,0 +1,84 @@
+/* Copyright 2013 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* From private/ppb_isolated_file_system_private.idl,
+ * modified Sat Nov 2 00:10:18 2013.
+ */
+
+#ifndef PPAPI_C_PRIVATE_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_H_
+#define PPAPI_C_PRIVATE_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_H_
+
+#include "ppapi/c/pp_completion_callback.h"
+#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_macros.h"
+#include "ppapi/c/pp_resource.h"
+#include "ppapi/c/pp_stdint.h"
+
+#define PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE_0_1 \
+ "PPB_IsolatedFileSystem_Private;0.1"
+#define PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE \
+ PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE_0_1
+
+/**
+ * @file
+ */
+
+
+/**
+ * @addtogroup Enums
+ * @{
+ */
+/**
+ * The <code>PP_IsolatedFileSystemType_Private</code> values indicate the type
+ * of isolated file systems.
+ */
+typedef enum {
+ /** Type for invalid file systems */
+ PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID = 0,
+ /** Type for CRX file systems */
+ PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX = 1
+} PP_IsolatedFileSystemType_Private;
+PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_IsolatedFileSystemType_Private, 4);
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
+/* <code>PPB_IsolatedFileSystem_Private</code> interface */
+struct PPB_IsolatedFileSystem_Private_0_1 {
+ /**
+ * Open() opens a file system corresponding the given file system type.
+ *
+ * When opening the CRX file system, this should be called from an extension
+ * context, otherwise it will fail.
+ *
+ * @param[in] instance A <code>PP_Instance</code> identifying the instance
+ * with the file system.
+ * @param[in] type A file system type as defined by
+ * <code>PP_IsolatedFileSystemType_Private</code> enum.
+ * @param[out] file_system An output <code>PP_Resource</code> corresponding
+ * to a PPB_FileSystem.
+ * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
+ * completion of Open.
+ *
+ * @return An int32_t containing an error code from <code>pp_errors.h</code>.
+ */
+ int32_t (*Open)(PP_Instance instance,
+ PP_IsolatedFileSystemType_Private type,
+ PP_Resource* file_system,
+ struct PP_CompletionCallback callback);
+};
+
+typedef struct PPB_IsolatedFileSystem_Private_0_1
+ PPB_IsolatedFileSystem_Private;
+/**
+ * @}
+ */
+
+#endif /* PPAPI_C_PRIVATE_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_H_ */
+
diff --git a/ppapi/cpp/private/isolated_file_system_private.cc b/ppapi/cpp/private/isolated_file_system_private.cc
new file mode 100644
index 0000000..3500795
--- /dev/null
+++ b/ppapi/cpp/private/isolated_file_system_private.cc
@@ -0,0 +1,40 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/cpp/private/isolated_file_system_private.h"
+
+#include "ppapi/cpp/module_impl.h"
+
+namespace pp {
+
+namespace {
+
+template <> const char* interface_name<PPB_IsolatedFileSystem_Private_0_1>() {
+ return PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE_0_1;
+}
+
+} // namespace
+
+IsolatedFileSystemPrivate::IsolatedFileSystemPrivate()
+ : instance_(0), type_(PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID) {
+}
+
+IsolatedFileSystemPrivate::IsolatedFileSystemPrivate(
+ const InstanceHandle& instance,
+ PP_IsolatedFileSystemType_Private type)
+ : instance_(instance.pp_instance()), type_(type) {
+}
+
+IsolatedFileSystemPrivate::~IsolatedFileSystemPrivate() {
+}
+
+int32_t IsolatedFileSystemPrivate::Open(
+ const CompletionCallbackWithOutput<pp::FileSystem>& cc) {
+ if (!has_interface<PPB_IsolatedFileSystem_Private_0_1>())
+ return cc.MayForce(PP_ERROR_NOINTERFACE);
+ return get_interface<PPB_IsolatedFileSystem_Private_0_1>()->
+ Open(instance_, type_, cc.output(), cc.pp_completion_callback());
+}
+
+} // namespace pp
diff --git a/ppapi/cpp/private/isolated_file_system_private.h b/ppapi/cpp/private/isolated_file_system_private.h
new file mode 100644
index 0000000..88213d6
--- /dev/null
+++ b/ppapi/cpp/private/isolated_file_system_private.h
@@ -0,0 +1,34 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PPAPI_CPP_PRIVATE_ISOLATED_FILE_SYSTEM_PRIVATE_H_
+#define PPAPI_CPP_PRIVATE_ISOLATED_FILE_SYSTEM_PRIVATE_H_
+
+#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/private/ppb_isolated_file_system_private.h"
+#include "ppapi/cpp/completion_callback.h"
+#include "ppapi/cpp/file_system.h"
+#include "ppapi/cpp/instance_handle.h"
+
+namespace pp {
+
+class CompletionCallback;
+
+class IsolatedFileSystemPrivate {
+ public:
+ IsolatedFileSystemPrivate();
+ IsolatedFileSystemPrivate(const InstanceHandle& instance,
+ PP_IsolatedFileSystemType_Private type);
+ virtual ~IsolatedFileSystemPrivate();
+
+ int32_t Open(const CompletionCallbackWithOutput<pp::FileSystem>& cc);
+
+ private:
+ PP_Instance instance_;
+ PP_IsolatedFileSystemType_Private type_;
+};
+
+} // namespace pp
+
+#endif // PPAPI_CPP_PRIVATE_ISOLATED_FILE_SYSTEM_PRIVATE_H_
diff --git a/ppapi/examples/crxfs/crxfs.cc b/ppapi/examples/crxfs/crxfs.cc
index 5e4b422..86a212b 100644
--- a/ppapi/examples/crxfs/crxfs.cc
+++ b/ppapi/examples/crxfs/crxfs.cc
@@ -9,7 +9,7 @@
#include "ppapi/cpp/file_ref.h"
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/module.h"
-#include "ppapi/cpp/private/ext_crx_file_system_private.h"
+#include "ppapi/cpp/private/isolated_file_system_private.h"
#include "ppapi/utility/completion_callback_factory.h"
// When compiling natively on Windows, PostMessage can be #define-d to
@@ -48,7 +48,7 @@ class MyInstance : public pp::Instance {
pp::CompletionCallbackFactory<MyInstance> factory_;
pp::InstanceHandle handle_;
- pp::ExtCrxFileSystemPrivate crxfs_;
+ pp::IsolatedFileSystemPrivate crxfs_;
pp::FileRef file_ref_;
pp::FileIO file_io_;
std::string filename_;
@@ -70,7 +70,8 @@ void MyInstance::OpenCrxFsAndReadFile(const std::string& filename) {
pp::CompletionCallbackWithOutput<pp::FileSystem> callback =
factory_.NewCallbackWithOutput(&MyInstance::CrxFileSystemCallback);
- crxfs_ = pp::ExtCrxFileSystemPrivate(this);
+ crxfs_ = pp::IsolatedFileSystemPrivate(
+ this, PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX);
int32_t rv = crxfs_.Open(callback);
if (rv != PP_OK_COMPLETIONPENDING)
ReportResponse("ExtCrxFileSystemPrivate::Open", rv);
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 51c5aff..bb65441 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
@@ -101,6 +101,7 @@
#include "ppapi/c/private/ppb_flash_print.h"
#include "ppapi/c/private/ppb_host_resolver_private.h"
#include "ppapi/c/private/ppb_instance_private.h"
+#include "ppapi/c/private/ppb_isolated_file_system_private.h"
#include "ppapi/c/private/ppb_nacl_private.h"
#include "ppapi/c/private/ppb_net_address_private.h"
#include "ppapi/c/private/ppb_output_protection_private.h"
@@ -212,6 +213,7 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_DRM_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_Menu_0_2;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_HostResolver_Private_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Instance_Private_0_1;
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_IsolatedFileSystem_Private_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NaCl_Private_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetAddress_Private_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetAddress_Private_1_0;
@@ -3036,6 +3038,15 @@ static void Pnacl_M13_PPB_Instance_Private_ExecuteScript(struct PP_Var* _struct_
/* End wrapper methods for PPB_Instance_Private_0_1 */
+/* Begin wrapper methods for PPB_IsolatedFileSystem_Private_0_1 */
+
+static int32_t Pnacl_M33_PPB_IsolatedFileSystem_Private_Open(PP_Instance instance, PP_IsolatedFileSystemType_Private type, PP_Resource* file_system, struct PP_CompletionCallback* callback) {
+ const struct PPB_IsolatedFileSystem_Private_0_1 *iface = Pnacl_WrapperInfo_PPB_IsolatedFileSystem_Private_0_1.real_iface;
+ return iface->Open(instance, type, file_system, *callback);
+}
+
+/* End wrapper methods for PPB_IsolatedFileSystem_Private_0_1 */
+
/* Begin wrapper methods for PPB_NaCl_Private_1_0 */
static PP_ExternalPluginResult Pnacl_M25_PPB_NaCl_Private_LaunchSelLdr(PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, PP_Bool enable_dyncode_syscalls, PP_Bool enable_exception_handling, PP_Bool enable_crash_throttling, void* imc_handle, struct PP_Var* error_message) {
@@ -4938,6 +4949,10 @@ struct PPB_Instance_Private_0_1 Pnacl_Wrappers_PPB_Instance_Private_0_1 = {
.ExecuteScript = (struct PP_Var (*)(PP_Instance instance, struct PP_Var script, struct PP_Var* exception))&Pnacl_M13_PPB_Instance_Private_ExecuteScript
};
+struct PPB_IsolatedFileSystem_Private_0_1 Pnacl_Wrappers_PPB_IsolatedFileSystem_Private_0_1 = {
+ .Open = (int32_t (*)(PP_Instance instance, PP_IsolatedFileSystemType_Private type, PP_Resource* file_system, struct PP_CompletionCallback callback))&Pnacl_M33_PPB_IsolatedFileSystem_Private_Open
+};
+
struct PPB_NaCl_Private_1_0 Pnacl_Wrappers_PPB_NaCl_Private_1_0 = {
.LaunchSelLdr = (PP_ExternalPluginResult (*)(PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, PP_Bool enable_dyncode_syscalls, PP_Bool enable_exception_handling, PP_Bool enable_crash_throttling, void* imc_handle, struct PP_Var* error_message))&Pnacl_M25_PPB_NaCl_Private_LaunchSelLdr,
.StartPpapiProxy = (PP_ExternalPluginResult (*)(PP_Instance instance))&Pnacl_M25_PPB_NaCl_Private_StartPpapiProxy,
@@ -5668,6 +5683,12 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Instance_Private_0_1 = {
.real_iface = NULL
};
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_IsolatedFileSystem_Private_0_1 = {
+ .iface_macro = PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE_0_1,
+ .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_IsolatedFileSystem_Private_0_1,
+ .real_iface = NULL
+};
+
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NaCl_Private_1_0 = {
.iface_macro = PPB_NACL_PRIVATE_INTERFACE_1_0,
.wrapped_iface = (void *) &Pnacl_Wrappers_PPB_NaCl_Private_1_0,
@@ -5899,6 +5920,7 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = {
&Pnacl_WrapperInfo_PPB_Flash_Menu_0_2,
&Pnacl_WrapperInfo_PPB_HostResolver_Private_0_1,
&Pnacl_WrapperInfo_PPB_Instance_Private_0_1,
+ &Pnacl_WrapperInfo_PPB_IsolatedFileSystem_Private_0_1,
&Pnacl_WrapperInfo_PPB_NaCl_Private_1_0,
&Pnacl_WrapperInfo_PPB_NetAddress_Private_0_1,
&Pnacl_WrapperInfo_PPB_NetAddress_Private_1_0,
diff --git a/ppapi/ppapi_proxy.gypi b/ppapi/ppapi_proxy.gypi
index c078ef1..9246e2a 100644
--- a/ppapi/ppapi_proxy.gypi
+++ b/ppapi/ppapi_proxy.gypi
@@ -35,8 +35,6 @@
'proxy/enter_proxy.h',
'proxy/error_conversion.cc',
'proxy/error_conversion.h',
- 'proxy/ext_crx_file_system_private_resource.cc',
- 'proxy/ext_crx_file_system_private_resource.h',
'proxy/extensions_common_resource.cc',
'proxy/extensions_common_resource.h',
'proxy/file_chooser_resource.cc',
@@ -79,6 +77,8 @@
'proxy/interface_list.h',
'proxy/interface_proxy.cc',
'proxy/interface_proxy.h',
+ 'proxy/isolated_file_system_private_resource.cc',
+ 'proxy/isolated_file_system_private_resource.h',
'proxy/locking_resource_releaser.h',
'proxy/net_address_resource.cc',
'proxy/net_address_resource.h',
diff --git a/ppapi/ppapi_shared.gypi b/ppapi/ppapi_shared.gypi
index 8fe3c07..7a4ccda 100644
--- a/ppapi/ppapi_shared.gypi
+++ b/ppapi/ppapi_shared.gypi
@@ -148,7 +148,6 @@
'thunk/ppb_device_ref_api.h',
'thunk/ppb_device_ref_dev_thunk.cc',
'thunk/ppb_ext_alarms_thunk.cc',
- 'thunk/ppb_ext_crx_file_system_private_api.h',
'thunk/ppb_ext_crx_file_system_private_thunk.cc',
'thunk/ppb_ext_socket_thunk.cc',
'thunk/ppb_file_chooser_api.h',
@@ -200,6 +199,8 @@
'thunk/ppb_instance_api.h',
'thunk/ppb_instance_private_thunk.cc',
'thunk/ppb_instance_thunk.cc',
+ 'thunk/ppb_isolated_file_system_private_api.h',
+ 'thunk/ppb_isolated_file_system_private_thunk.cc',
'thunk/ppb_message_loop_api.h',
'thunk/ppb_messaging_thunk.cc',
'thunk/ppb_mouse_cursor_thunk.cc',
diff --git a/ppapi/ppapi_sources.gypi b/ppapi/ppapi_sources.gypi
index d35ff84..1cdfcb8 100644
--- a/ppapi/ppapi_sources.gypi
+++ b/ppapi/ppapi_sources.gypi
@@ -114,6 +114,7 @@
'c/private/ppb_flash_message_loop.h',
'c/private/ppb_host_resolver_private.h',
'c/private/ppb_instance_private.h',
+ 'c/private/ppb_isolated_file_system_private.h',
'c/private/ppb_nacl_private.h',
'c/private/ppb_net_address_private.h',
'c/private/ppb_output_protection_private.h',
@@ -322,6 +323,8 @@
'cpp/private/host_resolver_private.h',
'cpp/private/instance_private.cc',
'cpp/private/instance_private.h',
+ 'cpp/private/isolated_file_system_private.cc',
+ 'cpp/private/isolated_file_system_private.h',
'cpp/private/net_address_private.cc',
'cpp/private/net_address_private.h',
'cpp/private/output_protection_private.cc',
diff --git a/ppapi/proxy/file_system_resource.cc b/ppapi/proxy/file_system_resource.cc
index af1928b..1839930 100644
--- a/ppapi/proxy/file_system_resource.cc
+++ b/ppapi/proxy/file_system_resource.cc
@@ -73,6 +73,7 @@ PP_FileSystemType FileSystemResource::GetType() {
int32_t FileSystemResource::InitIsolatedFileSystem(
const std::string& fsid,
+ PP_IsolatedFileSystemType_Private type,
const base::Callback<void(int32_t)>& callback) {
// This call is mutually exclusive with Open() above, so we can reuse the
// called_open state.
@@ -82,12 +83,12 @@ int32_t FileSystemResource::InitIsolatedFileSystem(
called_open_ = true;
Call<PpapiPluginMsg_FileSystem_InitIsolatedFileSystemReply>(RENDERER,
- PpapiHostMsg_FileSystem_InitIsolatedFileSystem(fsid),
+ PpapiHostMsg_FileSystem_InitIsolatedFileSystem(fsid, type),
base::Bind(&FileSystemResource::InitIsolatedFileSystemComplete,
this,
callback));
Call<PpapiPluginMsg_FileSystem_InitIsolatedFileSystemReply>(BROWSER,
- PpapiHostMsg_FileSystem_InitIsolatedFileSystem(fsid),
+ PpapiHostMsg_FileSystem_InitIsolatedFileSystem(fsid, type),
base::Bind(&FileSystemResource::InitIsolatedFileSystemComplete,
this,
callback));
diff --git a/ppapi/proxy/file_system_resource.h b/ppapi/proxy/file_system_resource.h
index a716434..a54a1c8 100644
--- a/ppapi/proxy/file_system_resource.h
+++ b/ppapi/proxy/file_system_resource.h
@@ -9,6 +9,7 @@
#include "base/memory/ref_counted.h"
#include "ppapi/c/pp_file_info.h"
+#include "ppapi/c/private/ppb_isolated_file_system_private.h"
#include "ppapi/proxy/connection.h"
#include "ppapi/proxy/plugin_resource.h"
#include "ppapi/proxy/ppapi_proxy_export.h"
@@ -49,6 +50,7 @@ class PPAPI_PROXY_EXPORT FileSystemResource
virtual PP_FileSystemType GetType() OVERRIDE;
int32_t InitIsolatedFileSystem(const std::string& fsid,
+ PP_IsolatedFileSystemType_Private type,
const base::Callback<void(int32_t)>& callback);
private:
// Called when the host has responded to our open request.
diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc
index 00022bf..99903a3 100644
--- a/ppapi/proxy/interface_list.cc
+++ b/ppapi/proxy/interface_list.cc
@@ -81,6 +81,7 @@
#include "ppapi/c/private/ppb_flash_message_loop.h"
#include "ppapi/c/private/ppb_flash_print.h"
#include "ppapi/c/private/ppb_host_resolver_private.h"
+#include "ppapi/c/private/ppb_isolated_file_system_private.h"
#include "ppapi/c/private/ppb_net_address_private.h"
#include "ppapi/c/private/ppb_output_protection_private.h"
#include "ppapi/c/private/ppb_pdf.h"
diff --git a/ppapi/proxy/ext_crx_file_system_private_resource.cc b/ppapi/proxy/isolated_file_system_private_resource.cc
index be4c3f7..756bdb7 100644
--- a/ppapi/proxy/ext_crx_file_system_private_resource.cc
+++ b/ppapi/proxy/isolated_file_system_private_resource.cc
@@ -1,10 +1,11 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ppapi/proxy/ext_crx_file_system_private_resource.h"
+#include "ppapi/proxy/isolated_file_system_private_resource.h"
#include "base/bind.h"
+#include "base/logging.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/pp_file_info.h"
#include "ppapi/proxy/file_system_resource.h"
@@ -24,40 +25,37 @@ void RunTrackedCallback(scoped_refptr<TrackedCallback> callback,
}
} // namespace
-ExtCrxFileSystemPrivateResource::ExtCrxFileSystemPrivateResource(
+IsolatedFileSystemPrivateResource::IsolatedFileSystemPrivateResource(
Connection connection, PP_Instance instance)
- : PluginResource(connection, instance), called_open_(false) {
- SendCreate(BROWSER, PpapiHostMsg_Ext_CrxFileSystem_Create());
+ : PluginResource(connection, instance) {
+ SendCreate(BROWSER, PpapiHostMsg_IsolatedFileSystem_Create());
}
-ExtCrxFileSystemPrivateResource::~ExtCrxFileSystemPrivateResource() {
+IsolatedFileSystemPrivateResource::~IsolatedFileSystemPrivateResource() {
}
-thunk::PPB_Ext_CrxFileSystem_Private_API*
-ExtCrxFileSystemPrivateResource::AsPPB_Ext_CrxFileSystem_Private_API() {
+thunk::PPB_IsolatedFileSystem_Private_API*
+IsolatedFileSystemPrivateResource::AsPPB_IsolatedFileSystem_Private_API() {
return this;
}
-int32_t ExtCrxFileSystemPrivateResource::Open(
+int32_t IsolatedFileSystemPrivateResource::Open(
PP_Instance /* unused */,
+ PP_IsolatedFileSystemType_Private type,
PP_Resource* file_system_resource,
scoped_refptr<TrackedCallback> callback) {
- if (called_open_)
- return PP_ERROR_FAILED;
- called_open_ = true;
-
if (!file_system_resource)
return PP_ERROR_BADARGUMENT;
- Call<PpapiPluginMsg_Ext_CrxFileSystem_BrowserOpenReply>(BROWSER,
- PpapiHostMsg_Ext_CrxFileSystem_BrowserOpen(),
- base::Bind(&ExtCrxFileSystemPrivateResource::OnBrowserOpenComplete, this,
- file_system_resource,
- callback));
+ Call<PpapiPluginMsg_IsolatedFileSystem_BrowserOpenReply>(BROWSER,
+ PpapiHostMsg_IsolatedFileSystem_BrowserOpen(type),
+ base::Bind(&IsolatedFileSystemPrivateResource::OnBrowserOpenComplete,
+ this, type, file_system_resource, callback));
return PP_OK_COMPLETIONPENDING;
}
-void ExtCrxFileSystemPrivateResource::OnBrowserOpenComplete(
+void IsolatedFileSystemPrivateResource::OnBrowserOpenComplete(
+ PP_IsolatedFileSystemType_Private type,
PP_Resource* file_system_resource,
scoped_refptr<TrackedCallback> callback,
const ResourceMessageReplyParams& params,
@@ -75,7 +73,8 @@ void ExtCrxFileSystemPrivateResource::OnBrowserOpenComplete(
*file_system_resource = fs->GetReference();
if (*file_system_resource == 0)
callback->Run(PP_ERROR_FAILED);
- fs->InitIsolatedFileSystem(fsid, base::Bind(&RunTrackedCallback, callback));
+ fs->InitIsolatedFileSystem(
+ fsid, type, base::Bind(&RunTrackedCallback, callback));
}
} // namespace proxy
diff --git a/ppapi/proxy/ext_crx_file_system_private_resource.h b/ppapi/proxy/isolated_file_system_private_resource.h
index 5f2887a..6f3f5e6 100644
--- a/ppapi/proxy/ext_crx_file_system_private_resource.h
+++ b/ppapi/proxy/isolated_file_system_private_resource.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -16,8 +16,8 @@
// Once the plugin receives the fsid, it creates a PPB_FileSystem and forwards
// the fsid to PepperFileSystemHost in order to construct root url.
-#ifndef PPAPI_PROXY_EXT_CRX_FILE_SYSTEM_PRIVATE_RESOURCE_H_
-#define PPAPI_PROXY_EXT_CRX_FILE_SYSTEM_PRIVATE_RESOURCE_H_
+#ifndef PPAPI_PROXY_ISOLATED_FILE_SYSTEM_PRIVATE_RESOURCE_H_
+#define PPAPI_PROXY_ISOLATED_FILE_SYSTEM_PRIVATE_RESOURCE_H_
#include <string>
@@ -25,7 +25,7 @@
#include "ppapi/proxy/connection.h"
#include "ppapi/proxy/plugin_resource.h"
#include "ppapi/proxy/ppapi_proxy_export.h"
-#include "ppapi/thunk/ppb_ext_crx_file_system_private_api.h"
+#include "ppapi/thunk/ppb_isolated_file_system_private_api.h"
namespace ppapi {
@@ -35,34 +35,35 @@ namespace proxy {
class ResourceMessageReplyParams;
-class PPAPI_PROXY_EXPORT ExtCrxFileSystemPrivateResource
+class PPAPI_PROXY_EXPORT IsolatedFileSystemPrivateResource
: public PluginResource,
- public thunk::PPB_Ext_CrxFileSystem_Private_API {
+ public thunk::PPB_IsolatedFileSystem_Private_API {
public:
- ExtCrxFileSystemPrivateResource(Connection connection, PP_Instance instance);
- virtual ~ExtCrxFileSystemPrivateResource();
+ IsolatedFileSystemPrivateResource(
+ Connection connection, PP_Instance instance);
+ virtual ~IsolatedFileSystemPrivateResource();
// Resource overrides.
- virtual thunk::PPB_Ext_CrxFileSystem_Private_API*
- AsPPB_Ext_CrxFileSystem_Private_API() OVERRIDE;
+ virtual thunk::PPB_IsolatedFileSystem_Private_API*
+ AsPPB_IsolatedFileSystem_Private_API() OVERRIDE;
- // PPB_Ext_CrxFileSystem_Private_API implementation.
+ // PPB_IsolatedFileSystem_Private_API implementation.
virtual int32_t Open(PP_Instance instance,
+ PP_IsolatedFileSystemType_Private type,
PP_Resource* file_system_resource,
scoped_refptr<TrackedCallback> callback) OVERRIDE;
private:
- void OnBrowserOpenComplete(PP_Resource* file_system_resource,
+ void OnBrowserOpenComplete(PP_IsolatedFileSystemType_Private type,
+ PP_Resource* file_system_resource,
scoped_refptr<TrackedCallback> callback,
const ResourceMessageReplyParams& params,
const std::string& fsid);
- bool called_open_;
-
- DISALLOW_COPY_AND_ASSIGN(ExtCrxFileSystemPrivateResource);
+ DISALLOW_COPY_AND_ASSIGN(IsolatedFileSystemPrivateResource);
};
} // namespace proxy
} // namespace ppapi
-#endif // PPAPI_PROXY_EXT_CRX_FILE_SYSTEM_PRIVATE_RESOURCE_H_
+#endif // PPAPI_PROXY_ISOLATED_FILE_SYSTEM_PRIVATE_RESOURCE_H_
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index 2313cf7..0a1ebd66 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -42,6 +42,7 @@
#include "ppapi/c/private/pp_private_font_charset.h"
#include "ppapi/c/private/ppb_flash.h"
#include "ppapi/c/private/ppb_host_resolver_private.h"
+#include "ppapi/c/private/ppb_isolated_file_system_private.h"
#include "ppapi/c/private/ppb_net_address_private.h"
#include "ppapi/c/private/ppb_pdf.h"
#include "ppapi/c/private/ppb_talk_private.h"
@@ -88,6 +89,8 @@ IPC_ENUM_TRAITS(PP_FlashSetting)
IPC_ENUM_TRAITS(PP_ImageDataFormat)
IPC_ENUM_TRAITS(PP_InputEvent_MouseButton)
IPC_ENUM_TRAITS(PP_InputEvent_Type)
+IPC_ENUM_TRAITS_MAX_VALUE(PP_IsolatedFileSystemType_Private,
+ PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX)
IPC_ENUM_TRAITS_MAX_VALUE(PP_NetAddressFamily_Private,
PP_NETADDRESSFAMILY_PRIVATE_IPV6)
IPC_ENUM_TRAITS_MAX_VALUE(PP_NetworkList_State, PP_NETWORKLIST_STATE_UP)
@@ -1188,12 +1191,6 @@ IPC_MESSAGE_CONTROL2(PpapiHostMsg_ExtensionsCommon_Call,
IPC_MESSAGE_CONTROL1(PpapiPluginMsg_ExtensionsCommon_CallReply,
base::ListValue /* output */)
-// Ext_CrxFileSystem
-IPC_MESSAGE_CONTROL0(PpapiHostMsg_Ext_CrxFileSystem_Create)
-IPC_MESSAGE_CONTROL0(PpapiHostMsg_Ext_CrxFileSystem_BrowserOpen)
-IPC_MESSAGE_CONTROL1(PpapiPluginMsg_Ext_CrxFileSystem_BrowserOpenReply,
- std::string /* fsid */)
-
// File chooser.
IPC_MESSAGE_CONTROL0(PpapiHostMsg_FileChooser_Create)
IPC_MESSAGE_CONTROL4(PpapiHostMsg_FileChooser_Show,
@@ -1288,8 +1285,9 @@ IPC_MESSAGE_CONTROL1(PpapiHostMsg_FileSystem_Create,
IPC_MESSAGE_CONTROL1(PpapiHostMsg_FileSystem_Open,
int64_t /* expected_size */)
IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileSystem_OpenReply)
-IPC_MESSAGE_CONTROL1(PpapiHostMsg_FileSystem_InitIsolatedFileSystem,
- std::string /* fsid */)
+IPC_MESSAGE_CONTROL2(PpapiHostMsg_FileSystem_InitIsolatedFileSystem,
+ std::string /* fsid */,
+ PP_IsolatedFileSystemType_Private /* type */)
IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileSystem_InitIsolatedFileSystemReply)
// Passed from renderer to browser. Creates an already-open file system with a
// given |root_url| and |file_system_type|.
@@ -1365,6 +1363,13 @@ IPC_MESSAGE_CONTROL2(PpapiHostMsg_Graphics2D_ReadImageData,
PP_Point /* top_left */)
IPC_MESSAGE_CONTROL0(PpapiPluginMsg_Graphics2D_ReadImageDataAck)
+// IsolatedFileSystem
+IPC_MESSAGE_CONTROL0(PpapiHostMsg_IsolatedFileSystem_Create)
+IPC_MESSAGE_CONTROL1(PpapiHostMsg_IsolatedFileSystem_BrowserOpen,
+ PP_IsolatedFileSystemType_Private /* type */)
+IPC_MESSAGE_CONTROL1(PpapiPluginMsg_IsolatedFileSystem_BrowserOpenReply,
+ std::string /* fsid */)
+
// NetworkMonitor.
IPC_MESSAGE_CONTROL0(PpapiHostMsg_NetworkMonitor_Create)
IPC_MESSAGE_CONTROL1(PpapiPluginMsg_NetworkMonitor_NetworkList,
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc
index 1997f890..1a8fe76 100644
--- a/ppapi/proxy/ppb_instance_proxy.cc
+++ b/ppapi/proxy/ppb_instance_proxy.cc
@@ -18,7 +18,6 @@
#include "ppapi/proxy/browser_font_singleton_resource.h"
#include "ppapi/proxy/content_decryptor_private_serializer.h"
#include "ppapi/proxy/enter_proxy.h"
-#include "ppapi/proxy/ext_crx_file_system_private_resource.h"
#include "ppapi/proxy/extensions_common_resource.h"
#include "ppapi/proxy/flash_clipboard_resource.h"
#include "ppapi/proxy/flash_file_resource.h"
@@ -26,6 +25,7 @@
#include "ppapi/proxy/flash_resource.h"
#include "ppapi/proxy/gamepad_resource.h"
#include "ppapi/proxy/host_dispatcher.h"
+#include "ppapi/proxy/isolated_file_system_private_resource.h"
#include "ppapi/proxy/network_proxy_resource.h"
#include "ppapi/proxy/pdf_resource.h"
#include "ppapi/proxy/plugin_dispatcher.h"
@@ -371,15 +371,16 @@ Resource* PPB_Instance_Proxy::GetSingletonResource(PP_Instance instance,
case BROKER_SINGLETON_ID:
new_singleton = new BrokerResource(connection, instance);
break;
- case CRX_FILESYSTEM_SINGLETON_ID:
- new_singleton = new ExtCrxFileSystemPrivateResource(connection, instance);
- break;
case EXTENSIONS_COMMON_SINGLETON_ID:
new_singleton = new ExtensionsCommonResource(connection, instance);
break;
case GAMEPAD_SINGLETON_ID:
new_singleton = new GamepadResource(connection, instance);
break;
+ case ISOLATED_FILESYSTEM_SINGLETON_ID:
+ new_singleton =
+ new IsolatedFileSystemPrivateResource(connection, instance);
+ break;
case NETWORK_PROXY_SINGLETON_ID:
new_singleton = new NetworkProxyResource(connection, instance);
break;
diff --git a/ppapi/proxy/resource_creation_proxy.cc b/ppapi/proxy/resource_creation_proxy.cc
index 7ee761b..231142a 100644
--- a/ppapi/proxy/resource_creation_proxy.cc
+++ b/ppapi/proxy/resource_creation_proxy.cc
@@ -8,7 +8,6 @@
#include "ppapi/c/pp_size.h"
#include "ppapi/proxy/audio_input_resource.h"
#include "ppapi/proxy/connection.h"
-#include "ppapi/proxy/ext_crx_file_system_private_resource.h"
#include "ppapi/proxy/file_chooser_resource.h"
#include "ppapi/proxy/file_io_resource.h"
#include "ppapi/proxy/file_ref_resource.h"
diff --git a/ppapi/shared_impl/resource.h b/ppapi/shared_impl/resource.h
index d364b44..ec4f517 100644
--- a/ppapi/shared_impl/resource.h
+++ b/ppapi/shared_impl/resource.h
@@ -51,6 +51,7 @@
F(PPB_HostResolver_Private_API) \
F(PPB_ImageData_API) \
F(PPB_InputEvent_API) \
+ F(PPB_IsolatedFileSystem_Private_API) \
F(PPB_LayerCompositor_API) \
F(PPB_MessageLoop_API) \
F(PPB_NetAddress_API) \
diff --git a/ppapi/shared_impl/singleton_resource_id.h b/ppapi/shared_impl/singleton_resource_id.h
index 2d89de6..90b0e6f 100644
--- a/ppapi/shared_impl/singleton_resource_id.h
+++ b/ppapi/shared_impl/singleton_resource_id.h
@@ -15,13 +15,13 @@ enum SingletonResourceID {
// resource model.
BROKER_SINGLETON_ID,
BROWSER_FONT_SINGLETON_ID,
- CRX_FILESYSTEM_SINGLETON_ID,
EXTENSIONS_COMMON_SINGLETON_ID,
FLASH_CLIPBOARD_SINGLETON_ID,
FLASH_FILE_SINGLETON_ID,
FLASH_FULLSCREEN_SINGLETON_ID,
FLASH_SINGLETON_ID,
GAMEPAD_SINGLETON_ID,
+ ISOLATED_FILESYSTEM_SINGLETON_ID,
NETWORK_PROXY_SINGLETON_ID,
PDF_SINGLETON_ID,
TRUETYPE_FONT_SINGLETON_ID,
diff --git a/ppapi/thunk/interfaces_ppb_private_no_permissions.h b/ppapi/thunk/interfaces_ppb_private_no_permissions.h
index 15e8043..8fe92f1 100644
--- a/ppapi/thunk/interfaces_ppb_private_no_permissions.h
+++ b/ppapi/thunk/interfaces_ppb_private_no_permissions.h
@@ -40,6 +40,8 @@ PROXIED_IFACE(NoAPIName, PPB_EXT_CRXFILESYSTEM_PRIVATE_INTERFACE_0_1,
PPB_Ext_CrxFileSystem_Private_0_1)
PROXIED_IFACE(NoAPIName, PPB_FILEIO_PRIVATE_INTERFACE_0_1,
PPB_FileIO_Private_0_1)
+PROXIED_IFACE(NoAPIName, PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE_0_1,
+ PPB_IsolatedFileSystem_Private_0_1)
PROXIED_IFACE(NoAPIName, PPB_VIDEODESTINATION_PRIVATE_INTERFACE_0_1,
PPB_VideoDestination_Private_0_1)
diff --git a/ppapi/thunk/ppb_ext_crx_file_system_private_thunk.cc b/ppapi/thunk/ppb_ext_crx_file_system_private_thunk.cc
index 7e18ba9..67f0ec8 100644
--- a/ppapi/thunk/ppb_ext_crx_file_system_private_thunk.cc
+++ b/ppapi/thunk/ppb_ext_crx_file_system_private_thunk.cc
@@ -2,16 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// From private/ppb_ext_crx_file_system_private.idl,
-// modified Fri May 3 09:24:58 2013.
-
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/private/ppb_ext_crx_file_system_private.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/enter.h"
-#include "ppapi/thunk/ppb_ext_crx_file_system_private_api.h"
#include "ppapi/thunk/ppb_instance_api.h"
+#include "ppapi/thunk/ppb_isolated_file_system_private_api.h"
#include "ppapi/thunk/resource_creation_api.h"
#include "ppapi/thunk/thunk.h"
@@ -24,12 +21,15 @@ int32_t Open(PP_Instance instance,
PP_Resource* file_system,
struct PP_CompletionCallback callback) {
VLOG(4) << "PPB_Ext_CrxFileSystem_Private::Open()";
- EnterInstanceAPI<PPB_Ext_CrxFileSystem_Private_API> enter(instance, callback);
+ EnterInstanceAPI<PPB_IsolatedFileSystem_Private_API> enter(instance,
+ callback);
if (enter.failed())
return enter.retval();
- return enter.SetResult(enter.functions()->Open(instance,
- file_system,
- enter.callback()));
+ return enter.SetResult(enter.functions()->Open(
+ instance,
+ PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX,
+ file_system,
+ enter.callback()));
}
const PPB_Ext_CrxFileSystem_Private_0_1
diff --git a/ppapi/thunk/ppb_ext_crx_file_system_private_api.h b/ppapi/thunk/ppb_isolated_file_system_private_api.h
index 9af926d..bca2332 100644
--- a/ppapi/thunk/ppb_ext_crx_file_system_private_api.h
+++ b/ppapi/thunk/ppb_isolated_file_system_private_api.h
@@ -1,11 +1,12 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef PPAPI_THUNK_PPB_EXT_CRX_FILE_SYSTEM_API_H_
-#define PPAPI_THUNK_PPB_EXT_CRX_FILE_SYSTEM_API_H_
+#ifndef PPAPI_THUNK_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_API_H_
+#define PPAPI_THUNK_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_API_H_
#include "base/memory/ref_counted.h"
+#include "ppapi/c/private/ppb_isolated_file_system_private.h"
#include "ppapi/shared_impl/singleton_resource_id.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/ppapi_thunk_export.h"
@@ -16,19 +17,20 @@ class TrackedCallback;
namespace thunk {
-class PPAPI_THUNK_EXPORT PPB_Ext_CrxFileSystem_Private_API {
+class PPAPI_THUNK_EXPORT PPB_IsolatedFileSystem_Private_API {
public:
- virtual ~PPB_Ext_CrxFileSystem_Private_API() {}
+ virtual ~PPB_IsolatedFileSystem_Private_API() {}
virtual int32_t Open(PP_Instance instance,
+ PP_IsolatedFileSystemType_Private type,
PP_Resource* file_system,
scoped_refptr<TrackedCallback> callback) = 0;
static const SingletonResourceID kSingletonResourceID =
- CRX_FILESYSTEM_SINGLETON_ID;
+ ISOLATED_FILESYSTEM_SINGLETON_ID;
};
} // namespace thunk
} // namespace ppapi
-#endif // PPAPI_THUNK_PPB_EXT_CRX_FILE_SYSTEM_API_H_
+#endif // PPAPI_THUNK_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_API_H_
diff --git a/ppapi/thunk/ppb_isolated_file_system_private_thunk.cc b/ppapi/thunk/ppb_isolated_file_system_private_thunk.cc
new file mode 100644
index 0000000..04b1bab
--- /dev/null
+++ b/ppapi/thunk/ppb_isolated_file_system_private_thunk.cc
@@ -0,0 +1,51 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// From private/ppb_isolated_file_system_private.idl,
+// modified Thu Oct 31 20:52:54 2013.
+
+#include "ppapi/c/pp_completion_callback.h"
+#include "ppapi/c/pp_errors.h"
+#include "ppapi/c/private/ppb_isolated_file_system_private.h"
+#include "ppapi/shared_impl/tracked_callback.h"
+#include "ppapi/thunk/enter.h"
+#include "ppapi/thunk/ppb_instance_api.h"
+#include "ppapi/thunk/ppb_isolated_file_system_private_api.h"
+#include "ppapi/thunk/resource_creation_api.h"
+#include "ppapi/thunk/thunk.h"
+
+namespace ppapi {
+namespace thunk {
+
+namespace {
+
+int32_t Open(PP_Instance instance,
+ PP_IsolatedFileSystemType_Private type,
+ PP_Resource* file_system,
+ struct PP_CompletionCallback callback) {
+ VLOG(4) << "PPB_IsolatedFileSystem_Private::Open()";
+ EnterInstanceAPI<PPB_IsolatedFileSystem_Private_API> enter(instance,
+ callback);
+ if (enter.failed())
+ return enter.retval();
+ return enter.SetResult(enter.functions()->Open(instance,
+ type,
+ file_system,
+ enter.callback()));
+}
+
+const PPB_IsolatedFileSystem_Private_0_1
+ g_ppb_isolatedfilesystem_private_thunk_0_1 = {
+ &Open
+};
+
+} // namespace
+
+const PPB_IsolatedFileSystem_Private_0_1*
+ GetPPB_IsolatedFileSystem_Private_0_1_Thunk() {
+ return &g_ppb_isolatedfilesystem_private_thunk_0_1;
+}
+
+} // namespace thunk
+} // namespace ppapi