Chromium Code Reviews| Index: ppapi/c/ppp_instance.h |
| =================================================================== |
| --- ppapi/c/ppp_instance.h (revision 74859) |
| +++ ppapi/c/ppp_instance.h (working copy) |
| @@ -5,6 +5,7 @@ |
| #ifndef PPAPI_C_PPP_INSTANCE_H_ |
| #define PPAPI_C_PPP_INSTANCE_H_ |
| +#include "ppapi/c/dev/pp_message_event_dev.h" |
| #include "ppapi/c/pp_bool.h" |
| #include "ppapi/c/pp_instance.h" |
| #include "ppapi/c/pp_rect.h" |
| @@ -13,7 +14,7 @@ |
| struct PP_InputEvent; |
| struct PP_Var; |
| -#define PPP_INSTANCE_INTERFACE "PPP_Instance;0.4" |
| +#define PPP_INSTANCE_INTERFACE "PPP_Instance;0.5" |
| /** |
| * @file |
| @@ -127,6 +128,25 @@ |
| * will be responsible for Release()ing that reference. |
| */ |
| struct PP_Var (*GetInstanceObject)(PP_Instance instance); |
| + |
| + /** |
| + * This method is invoked when postMessage is invoked on the DOM object for |
| + * this instance in JavaScript. |
| + * |
| + * For example: |
| + * |
| + * <body> |
| + * <object id="plugin" |
| + * type="application/x-ppapi-postMessage-example"/> |
| + * <script type="text/javascript"> |
| + * document.getElementById('plugin').postMessage("Hello world!"); |
| + * </script> |
| + * </body> |
| + * |
| + * This will result in OnMessage being invoked on the instance, with |
| + * message.data being a string PP_Var containing "Hello world!". |
| + */ |
| + void (*OnMessage)(PP_Instance instance, struct PP_MessageEvent_Dev message); |
|
darin (slow to review)
2011/02/17 19:20:52
nit: pass message by const pointer.
Stepping back
dmichael(do not use this one)
2011/02/17 20:07:04
I thought about doing MessagePort based on his sug
brettw
2011/02/17 20:40:01
In reality, 99% of people will use the simplest po
dmichael(do not use this one)
2011/02/17 22:18:22
Done.
|
| }; |
| /** |
| * @} |