summaryrefslogtreecommitdiffstats
path: root/ppapi/c
diff options
context:
space:
mode:
authorvictorhsieh@chromium.org <victorhsieh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-08 18:04:58 +0000
committervictorhsieh@chromium.org <victorhsieh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-08 18:04:58 +0000
commitd196ccaf213718d4b3d33f2c07021ef86ce86253 (patch)
tree7d993de1cf5675e7730e3e1038b3c560f29818e4 /ppapi/c
parent24e1ffbfc1e82294e909ce031e7aeaa8b8cca205 (diff)
downloadchromium_src-d196ccaf213718d4b3d33f2c07021ef86ce86253.zip
chromium_src-d196ccaf213718d4b3d33f2c07021ef86ce86253.tar.gz
chromium_src-d196ccaf213718d4b3d33f2c07021ef86ce86253.tar.bz2
CRX FileSystem Pepper private API
pp::ExtCrxFileSystemPrivate is introduced in this change to allow plugin to mount (readonly) CRX extension directory as a filesystem. Files can be access through pp::ExtCrxFileRefPrivate (which is a subclass of pp::FileRef) just like normal file, and the path would look like "/manifest.json". See ppapi/example/crxfs for example. Some keypoints in this change: * pepper resource/host architecture: - please refer to ppapi/proxy/ext_crx_file_system_private_resource.h. * webkit/fileapi related: - Changes run in browser - Isoloated filesystem is the underlying filesystem - Grant read permission to corresponding renderer of the plugin - See chrome/browser/renderer_host/pepper/pepper_ext_crx_file_system_browser_host.cc * extension related: - Changes run in browser - This is for getting extension installed directory to mount TEST=out/Debug/chrome --register-pepper-plugins="out/Debug/lib/libppapi_example_crxfs.so#PPAPI Tests##1.2.3;application/x-ppapi-example-crxfs" \ ppapi/examples/crxfs/crxfs.html BUG=223301 Review URL: https://chromiumcodereview.appspot.com/14188019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198938 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c')
-rw-r--r--ppapi/c/pp_file_info.h6
-rw-r--r--ppapi/c/ppb_file_system.h6
-rw-r--r--ppapi/c/private/ppb_ext_crx_file_system_private.h59
3 files changed, 66 insertions, 5 deletions
diff --git a/ppapi/c/pp_file_info.h b/ppapi/c/pp_file_info.h
index e53cae1..1f0c52a 100644
--- a/ppapi/c/pp_file_info.h
+++ b/ppapi/c/pp_file_info.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From pp_file_info.idl modified Thu Mar 28 11:11:01 2013. */
+/* From pp_file_info.idl modified Thu May 2 16:41:50 2013. */
#ifndef PPAPI_C_PP_FILE_INFO_H_
#define PPAPI_C_PP_FILE_INFO_H_
@@ -46,7 +46,9 @@ typedef enum {
/** For local persistent file system types */
PP_FILESYSTEMTYPE_LOCALPERSISTENT = 2,
/** For local temporary file system types */
- PP_FILESYSTEMTYPE_LOCALTEMPORARY = 3
+ PP_FILESYSTEMTYPE_LOCALTEMPORARY = 3,
+ /** For isolated file system types */
+ PP_FILESYSTEMTYPE_ISOLATED = 4
} PP_FileSystemType;
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FileSystemType, 4);
/**
diff --git a/ppapi/c/ppb_file_system.h b/ppapi/c/ppb_file_system.h
index 73910d6..28b8cca 100644
--- a/ppapi/c/ppb_file_system.h
+++ b/ppapi/c/ppb_file_system.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From ppb_file_system.idl modified Mon May 21 15:19:32 2012. */
+/* From ppb_file_system.idl modified Thu May 2 16:44:38 2013. */
#ifndef PPAPI_C_PPB_FILE_SYSTEM_H_
#define PPAPI_C_PPB_FILE_SYSTEM_H_
@@ -39,8 +39,8 @@ struct PPB_FileSystem_1_0 {
* @param[in] instance A <code>PP_Instance</code> identifying the instance
* with the file.
* @param[in] type A file system type as defined by
- * <code>PP_FileSystemType</code> enum.
- *
+ * <code>PP_FileSystemType</code> enum (except PP_FILESYSTEMTYPE_ISOLATED,
+ * which is currently not supported).
* @return A <code>PP_Resource</code> corresponding to a file system if
* successful.
*/
diff --git a/ppapi/c/private/ppb_ext_crx_file_system_private.h b/ppapi/c/private/ppb_ext_crx_file_system_private.h
new file mode 100644
index 0000000..114a016
--- /dev/null
+++ b/ppapi/c/private/ppb_ext_crx_file_system_private.h
@@ -0,0 +1,59 @@
+/* Copyright (c) 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_ext_crx_file_system_private.idl,
+ * modified Fri May 3 09:55:27 2013.
+ */
+
+#ifndef PPAPI_C_PRIVATE_PPB_EXT_CRX_FILE_SYSTEM_PRIVATE_H_
+#define PPAPI_C_PRIVATE_PPB_EXT_CRX_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_EXT_CRXFILESYSTEM_PRIVATE_INTERFACE_0_1 \
+ "PPB_Ext_CrxFileSystem_Private;0.1"
+#define PPB_EXT_CRXFILESYSTEM_PRIVATE_INTERFACE \
+ PPB_EXT_CRXFILESYSTEM_PRIVATE_INTERFACE_0_1
+
+/**
+ * @file
+ */
+
+
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
+/* <code>PPB_Ext_CrxFileSystem_Private</code> interface */
+struct PPB_Ext_CrxFileSystem_Private_0_1 {
+ /**
+ * Open() opens the CRX file system for the current extension. It will fail
+ * when called from non-extension context.
+ *
+ * @param[in] crxfs A <code>PP_Resource</code> corresponding to a
+ * CrxFileSystem.
+ * @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_Resource* file_system,
+ struct PP_CompletionCallback callback);
+};
+
+typedef struct PPB_Ext_CrxFileSystem_Private_0_1 PPB_Ext_CrxFileSystem_Private;
+/**
+ * @}
+ */
+
+#endif /* PPAPI_C_PRIVATE_PPB_EXT_CRX_FILE_SYSTEM_PRIVATE_H_ */
+