Native Client

PPP_Messaging Struct Reference

The PPP_Messaging interface contains pointers to functions that you must implement to handle postMessage events on the associated DOM element. More...


Detailed Description

The PPP_Messaging interface contains pointers to functions that you must implement to handle postMessage events on the associated DOM element.

Data Fields List

void(* HandleMessage )(PP_Instance instance, struct PP_Var message)

Data Fields Details

void(* PPP_Messaging::HandleMessage)(PP_Instance instance, struct PP_Var message)

HandleMessage() is a function that the browser calls when PostMessage() is invoked on the DOM element for the module instance in JavaScript.

Note that PostMessage() in the JavaScript interface is asynchronous, meaning JavaScript execution will not be blocked while HandleMessage() is processing the message.

Parameters:
[in]instanceA PP_Instance identifying one instance of a module.
[in]messageA PP_Var containing the data to be sent to JavaScript. Message can have an int32_t, double, bool, or string value (objects are not supported).

The following JavaScript code invokes HandleMessage, passing the module instance on which it was invoked, with message being a string PP_Var containing "Hello world!"

Example:

<body> <object id="plugin" type="application/x-ppapi-postMessage-example"> <script type="text/javascript"> document.getElementById('plugin').postMessage("Hello world!"); </script> </body>


The documentation for this struct was generated from the following file:

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.