#include <message_handler.h>
MessageHandler
is an abstract base class that the plugin may implement if it wants to receive messages from JavaScript on a background thread when JavaScript invokes postMessage() or postMessageAndAwaitResponse(). See pp::Instance::RegisterMessageHandler() for usage.
Invoked as a result of JavaScript invoking postMessageAndAwaitResponse() on the plugin's DOM element.
NOTE: JavaScript execution is blocked during the duration of this call. Hence, the plugin should respond as quickly as possible. For this reason, blocking completion callbacks are disallowed while handling a blocking message.
- Parameters
-
[in] | instance | An InstanceHandle identifying one instance of a module. |
[in] | message_data | A copy of the parameter that JavaScript provided to postMessage(). |
- Returns
- Returns a pp::Var that is then copied to a JavaScript object which is returned as the result of JavaScript's call of postMessageAndAwaitResponse().
Invoked as a result of JavaScript invoking postMessage() on the plugin's DOM element.
- Parameters
-
[in] | instance | An InstanceHandle identifying one instance of a module. |
[in] | message_data | A copy of the parameter that JavaScript provided to postMessage(). |
Invoked when this MessageHandler is no longer needed. After this, no more calls will be made to this object.
- Parameters
-
The documentation for this class was generated from the following file: