diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-22 15:46:36 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-22 15:46:36 +0000 |
commit | 2bda8a12388301bec4798644691c61abb35a0a14 (patch) | |
tree | 0710a0567a3e98b5afec728230014c92393fc3e3 /ppapi | |
parent | 0a4404da4b70927abe71662a0d968d9643646546 (diff) | |
download | chromium_src-2bda8a12388301bec4798644691c61abb35a0a14.zip chromium_src-2bda8a12388301bec4798644691c61abb35a0a14.tar.gz chromium_src-2bda8a12388301bec4798644691c61abb35a0a14.tar.bz2 |
Clarify the requirements of the GetInterface function that the plugin must
implement to include warnings about reentrancy and using other functions.
Review URL: http://codereview.chromium.org/7486015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93638 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/api/ppp.idl | 10 | ||||
-rw-r--r-- | ppapi/c/ppp.h | 12 |
2 files changed, 21 insertions, 1 deletions
diff --git a/ppapi/api/ppp.idl b/ppapi/api/ppp.idl index 8be3ebf..05c1e83 100644 --- a/ppapi/api/ppp.idl +++ b/ppapi/api/ppp.idl @@ -90,6 +90,16 @@ PP_EXPORT void PPP_ShutdownModule(); * Your module must implement the <code>PPP_Instance</code> interface or it * will be unloaded. Other interfaces are optional. * + * This function is called from within browser code whenever an interface is + * needed. This means your plugin could be reentered via this function if you + * make a browser call and it needs an interface. Furthermore, you should not + * make any other browser calls from within your implementation to avoid + * reentering the browser. + * + * As a result, your implementation of this should merely provide a lookup + * from the requested name to an interface pointer, via something like a big + * if/else block or a map, and not do any other work. + * * @param[in] interface_name A pointer to a "PPP" (plugin) interface name. * Interface names are null-terminated ASCII strings. * diff --git a/ppapi/c/ppp.h b/ppapi/c/ppp.h index 5f42782..f02ba2c 100644 --- a/ppapi/c/ppp.h +++ b/ppapi/c/ppp.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From ppp.idl modified Sat Jul 16 16:50:26 2011. */ +/* From ppp.idl modified Thu Jul 21 16:38:20 2011. */ #ifndef PPAPI_C_PPP_H_ #define PPAPI_C_PPP_H_ @@ -98,6 +98,16 @@ PP_EXPORT void PPP_ShutdownModule(); * Your module must implement the <code>PPP_Instance</code> interface or it * will be unloaded. Other interfaces are optional. * + * This function is called from within browser code whenever an interface is + * needed. This means your plugin could be reentered via this function if you + * make a browser call and it needs an interface. Furthermore, you should not + * make any other browser calls from within your implementation to avoid + * reentering the browser. + * + * As a result, your implementation of this should merely provide a lookup + * from the requested name to an interface pointer, via something like a big + * if/else block or a map, and not do any other work. + * * @param[in] interface_name A pointer to a "PPP" (plugin) interface name. * Interface names are null-terminated ASCII strings. * |