PPAPI: Generalize PPB_Ext_CrxFileSystem as PPB_IsolatedFileSystem
[chromium-blink-merge.git] / ppapi / c / private / ppb_isolated_file_system_private.h
blob4b9af4f257879d45f259b9e6e69afcbb8e739eb5
1 /* Copyright 2013 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
6 /* From private/ppb_isolated_file_system_private.idl,
7 * modified Sat Nov 2 00:10:18 2013.
8 */
10 #ifndef PPAPI_C_PRIVATE_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_H_
11 #define PPAPI_C_PRIVATE_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_H_
13 #include "ppapi/c/pp_completion_callback.h"
14 #include "ppapi/c/pp_instance.h"
15 #include "ppapi/c/pp_macros.h"
16 #include "ppapi/c/pp_resource.h"
17 #include "ppapi/c/pp_stdint.h"
19 #define PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE_0_1 \
20 "PPB_IsolatedFileSystem_Private;0.1"
21 #define PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE \
22 PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE_0_1
24 /**
25 * @file
29 /**
30 * @addtogroup Enums
31 * @{
33 /**
34 * The <code>PP_IsolatedFileSystemType_Private</code> values indicate the type
35 * of isolated file systems.
37 typedef enum {
38 /** Type for invalid file systems */
39 PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID = 0,
40 /** Type for CRX file systems */
41 PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX = 1
42 } PP_IsolatedFileSystemType_Private;
43 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_IsolatedFileSystemType_Private, 4);
44 /**
45 * @}
48 /**
49 * @addtogroup Interfaces
50 * @{
52 /* <code>PPB_IsolatedFileSystem_Private</code> interface */
53 struct PPB_IsolatedFileSystem_Private_0_1 {
54 /**
55 * Open() opens a file system corresponding the given file system type.
57 * When opening the CRX file system, this should be called from an extension
58 * context, otherwise it will fail.
60 * @param[in] instance A <code>PP_Instance</code> identifying the instance
61 * with the file system.
62 * @param[in] type A file system type as defined by
63 * <code>PP_IsolatedFileSystemType_Private</code> enum.
64 * @param[out] file_system An output <code>PP_Resource</code> corresponding
65 * to a PPB_FileSystem.
66 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
67 * completion of Open.
69 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
71 int32_t (*Open)(PP_Instance instance,
72 PP_IsolatedFileSystemType_Private type,
73 PP_Resource* file_system,
74 struct PP_CompletionCallback callback);
77 typedef struct PPB_IsolatedFileSystem_Private_0_1
78 PPB_IsolatedFileSystem_Private;
79 /**
80 * @}
83 #endif /* PPAPI_C_PRIVATE_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_H_ */