Chromium Code Reviews| Index: ppapi/c/ppb_instance.h |
| =================================================================== |
| --- ppapi/c/ppb_instance.h (revision 75765) |
| +++ ppapi/c/ppb_instance.h (working copy) |
| @@ -10,7 +10,7 @@ |
| #include "ppapi/c/pp_resource.h" |
| #include "ppapi/c/pp_var.h" |
| -#define PPB_INSTANCE_INTERFACE "PPB_Instance;0.4" |
| +#define PPB_INSTANCE_INTERFACE "PPB_Instance;0.5" |
| /** |
| * @file |
| @@ -107,6 +107,36 @@ |
| struct PP_Var (*ExecuteScript)(PP_Instance instance, |
| struct PP_Var script, |
| struct PP_Var* exception); |
| + |
| + /** |
| + * PostMessage asynchronously invokes the onmessage handler of the 'embed' |
|
polina
2011/02/26 08:00:08
s/'embed' instance/module instance/
dmichael(do not use this one)
2011/02/28 15:59:28
That's not quite what I was trying (badly) to conv
|
| + * instance, if one exists. This is analogous to listening for messages from |
| + * Web Workers. |
| + * See: |
| + * http://www.whatwg.org/specs/web-workers/current-work/ |
| + * |
| + * For example: |
| + * |
| + * <body> |
| + * <object id="module" |
|
polina
2011/02/26 08:00:08
s/module/plugin/
(You are also misusing the word "
dmichael(do not use this one)
2011/02/28 15:59:28
Done.
|
| + * type="application/x-ppapi-postMessage-example"/> |
| + * <script type="text/javascript"> |
| + * document.getElementById('module').onmessage = function(message) { |
| + * alert(message.data); |
|
polina
2011/02/26 08:00:08
It would be a good idea to extend the header comme
dmichael(do not use this one)
2011/02/28 15:59:28
Done.
|
| + * } |
| + * </script> |
| + * </body> |
| + * |
| + * If the module then invokes PostMessage as follows: |
|
polina
2011/02/26 08:00:08
PostMessage()
dmichael(do not use this one)
2011/02/28 15:59:28
Done. I also threw in some @a doxygen annotations
polina
2011/03/03 00:22:16
You should be consistent with whatever annotations
|
| + * char hello_world[] = "Hello world!"; |
| + * PP_Var hello_var = ppb_var_if->VarFromUtf8(instance, |
| + * hello_world, |
| + * sizeof(hello_world)); |
| + * the_ppb_instance->PostMessage(instance, hello_var); |
| + * |
| + * The browser will pop-up an alert saying "Hello world!". |
| + */ |
| + void (*PostMessage)(PP_Instance instance, struct PP_Var message); |
|
polina
2011/02/26 08:00:08
Can this be any type of PP_Var?
dmichael(do not use this one)
2011/02/28 15:59:28
I added more information to the top-level comment.
|
| }; |
| /** |
| * @} |