| OLD | NEW |
| 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
| 4 */ | 4 */ |
| 5 #ifndef PPAPI_C_PPP_H_ | 5 #ifndef PPAPI_C_PPP_H_ |
| 6 #define PPAPI_C_PPP_H_ | 6 #define PPAPI_C_PPP_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_module.h" | 8 #include "ppapi/c/pp_module.h" |
| 9 #include "ppapi/c/pp_stdint.h" | 9 #include "ppapi/c/pp_stdint.h" |
| 10 #include "ppapi/c/ppb.h" | 10 #include "ppapi/c/ppb.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 /** | 34 /** |
| 35 * @addtogroup Functions | 35 * @addtogroup Functions |
| 36 * @{ | 36 * @{ |
| 37 */ | 37 */ |
| 38 | 38 |
| 39 /** | 39 /** |
| 40 * PPP_InitializeModule() is the entry point for a module and is called by the | 40 * PPP_InitializeModule() is the entry point for a module and is called by the |
| 41 * browser when your module loads. Your code must implement this function. | 41 * browser when your module loads. Your code must implement this function. |
| 42 * | 42 * |
| 43 * Failure indicates to the browser that this plugin can not be used. In this | 43 * Failure indicates to the browser that this module can not be used. In this |
| 44 * case, the plugin will be unloaded and ShutdownModule will NOT be called. | 44 * case, the module will be unloaded and ShutdownModule will NOT be called. |
| 45 * | 45 * |
| 46 * @param[in] module A handle to your module. Generally you should store this | 46 * @param[in] module A handle to your module. Generally you should store this |
| 47 * value since it will be required for other API calls. | 47 * value since it will be required for other API calls. |
| 48 * | |
| 49 * @param[in] get_browser_interface A pointer to the function that you can | 48 * @param[in] get_browser_interface A pointer to the function that you can |
| 50 * use to query for browser interfaces. Generally you should store this value | 49 * use to query for browser interfaces. Generally you should store this value |
| 51 * for future use. | 50 * for future use. |
| 52 * | 51 * |
| 53 * @return PP_OK on success. Any other value on failure. | 52 * @return <code>PP_OK</code> on success. Any other value on failure. |
| 54 */ | 53 */ |
| 55 PP_EXPORT int32_t PPP_InitializeModule(PP_Module module, | 54 PP_EXPORT int32_t PPP_InitializeModule(PP_Module module, |
| 56 PPB_GetInterface get_browser_interface); | 55 PPB_GetInterface get_browser_interface); |
| 57 /** | 56 /** |
| 58 * @} | 57 * @} |
| 59 */ | 58 */ |
| 60 | 59 |
| 61 /** | 60 /** |
| 62 * @addtogroup Functions | 61 * @addtogroup Functions |
| 63 * @{ | 62 * @{ |
| 64 */ | 63 */ |
| 65 | 64 |
| 66 /** | 65 /** |
| 67 * PPP_ShutdownModule() is <strong>sometimes</strong> called before the module | 66 * PPP_ShutdownModule() is <strong>sometimes</strong> called before the module |
| 68 * is unloaded. It is not recommended that you implement this function. | 67 * is unloaded. It is not recommended that you implement this function. |
| 69 * | 68 * |
| 70 * There is no practical use of this function for third party plugins. Its | 69 * There is no practical use of this function for third party modules. Its |
| 71 * existence is because of some internal use cases inside Chrome. | 70 * existence is because of some internal use cases inside Chrome. |
| 72 * | 71 * |
| 73 * Since your plugin runs in a separate process, there's no need to free | 72 * Since your module runs in a separate process, there's no need to free |
| 74 * allocated memory. There is also no need to free any resources since all of | 73 * allocated memory. There is also no need to free any resources since all of |
| 75 * resources associated with an instance will be force-freed when that instance | 74 * resources associated with an instance will be force-freed when that instance |
| 76 * is deleted. Moreover, this function will not be called when Chrome does | 75 * is deleted. Moreover, this function will not be called when Chrome does |
| 77 * "fast shutdown" of a web page. | 76 * "fast shutdown" of a web page. |
| 78 */ | 77 */ |
| 79 PP_EXPORT void PPP_ShutdownModule(); | 78 PP_EXPORT void PPP_ShutdownModule(); |
| 80 /** | 79 /** |
| 81 * @} | 80 * @} |
| 82 */ | 81 */ |
| 83 | 82 |
| 84 /** | 83 /** |
| 85 * @addtogroup Functions | 84 * @addtogroup Functions |
| 86 * @{ | 85 * @{ |
| 87 */ | 86 */ |
| 88 | 87 |
| 89 /** | 88 /** |
| 90 * PPP_GetInterface() is called by the browser to query the module for | 89 * PPP_GetInterface() is called by the browser to query the module for |
| 91 * interfaces it supports. | 90 * interfaces it supports. |
| 92 * | 91 * |
| 93 * Your module must implement the PPP_Instance interface or it will be | 92 * Your module must implement the <code>PPP_Instance</code> interface or it |
| 94 * unloaded. Other interfaces are optional. | 93 * will be unloaded. Other interfaces are optional. |
| 95 * | 94 * |
| 96 * @param[in] interface_name A pointer to a "PPP" (plugin) interface name. | 95 * @param[in] interface_name A pointer to a "PPP" (plugin) interface name. |
| 97 * Interface names are null-terminated ASCII strings. | 96 * Interface names are null-terminated ASCII strings. |
| 98 * | 97 * |
| 99 * @return A pointer for the interface or NULL if the interface is not | 98 * @return A pointer for the interface or <code>NULL</code> if the interface is |
| 100 * supported. | 99 * not supported. |
| 101 */ | 100 */ |
| 102 PP_EXPORT const void* PPP_GetInterface(const char* interface_name); | 101 PP_EXPORT const void* PPP_GetInterface(const char* interface_name); |
| 103 /** | 102 /** |
| 104 * @} | 103 * @} |
| 105 */ | 104 */ |
| 106 | 105 |
| 107 #ifdef __cplusplus | 106 #ifdef __cplusplus |
| 108 } /* extern "C" */ | 107 } /* extern "C" */ |
| 109 #endif | 108 #endif |
| 110 | 109 |
| 111 #endif /* PPAPI_C_PPP_H_ */ | 110 #endif /* PPAPI_C_PPP_H_ */ |
| OLD | NEW |