{{+bindTo:partials.standard_nacl_api}}
<h1>PPP_MessageHandler Struct Reference</h1>
<div id="doxygen-ref">
{{- dummy div to appease doxygen -}}
<div>
<!-- Generated by Doxygen 1.7.6.1 -->
</div>
<!--header-->
<div class="contents">
<!-- doxytag: class="PPP_MessageHandler" --><h2>
Data Fields</h2><table class="memberdecls">
<tr><td class="memItemLeft" align="right" valign="top">void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_p___message_handler__0__2.html#ab8b6b045541790d1d0ca862d0a225f27">HandleMessage</a> )(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance, void *user_data, const struct <a class="el" href="struct_p_p___var.html">PP_Var</a> *message)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_p___message_handler__0__2.html#aca37a8a59cb6a0b9be2846a2ab3e2828">HandleBlockingMessage</a> )(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance, void *user_data, const struct <a class="el" href="struct_p_p___var.html">PP_Var</a> *message, struct <a class="el" href="struct_p_p___var.html">PP_Var</a> *response)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_p___message_handler__0__2.html#a0804b4fbaab3b6abedd888e96107fd4d">Destroy</a> )(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance, void *user_data)</td></tr>
</table>
<hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>The <code>PPP_MessageHandler</code> interface is implemented by the plugin if the plugin wants to receive messages from a thread other than the main Pepper thread, or if the plugin wants to handle blocking messages which JavaScript may send via postMessageAndAwaitResponse(). </p>
<p>This interface struct should not be returned by PPP_GetInterface; instead it must be passed as a parameter to <a class="el" href="struct_p_p_b___messaging__1__2.html#ae5abee73dc21a290514f7f3554a7e895" title="Registers a handler for receiving messages from JavaScript.">PPB_Messaging::RegisterMessageHandler</a>. </p>
</div><hr /><h2>Field Documentation</h2>
<a class="anchor" id="a0804b4fbaab3b6abedd888e96107fd4d"></a><!-- doxytag: member="PPP_MessageHandler::Destroy" ref="a0804b4fbaab3b6abedd888e96107fd4d" args=")(PP_Instance instance, void *user_data)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void(* <a class="el" href="struct_p_p_p___message_handler__0__2.html#a0804b4fbaab3b6abedd888e96107fd4d">PPP_MessageHandler::Destroy</a>)(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance, void *user_data)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Invoked when the handler object is no longer needed. </p>
<p>After this, no more calls will be made which pass this same value for <code>instance</code> and <code>user_data</code>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>A <code>PP_Instance</code> identifying one instance of a module. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">user_data</td><td>is the same pointer which was provided by a call to RegisterMessageHandler. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="aca37a8a59cb6a0b9be2846a2ab3e2828"></a><!-- doxytag: member="PPP_MessageHandler::HandleBlockingMessage" ref="aca37a8a59cb6a0b9be2846a2ab3e2828" args=")(PP_Instance instance, void *user_data, const struct PP_Var *message, struct PP_Var *response)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void(* <a class="el" href="struct_p_p_p___message_handler__0__2.html#aca37a8a59cb6a0b9be2846a2ab3e2828">PPP_MessageHandler::HandleBlockingMessage</a>)(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance, void *user_data, const struct <a class="el" href="struct_p_p___var.html">PP_Var</a> *message, struct <a class="el" href="struct_p_p___var.html">PP_Var</a> *response)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Invoked as a result of JavaScript invoking postMessageAndAwaitResponse() on the plugin's DOM element. </p>
<p>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.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>A <code>PP_Instance</code> identifying one instance of a module. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">user_data</td><td>is the same pointer which was provided by a call to RegisterMessageHandler(). </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">message</td><td>is a copy of the parameter that JavaScript provided to postMessageAndAwaitResponse(). </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">response</td><td>will be copied to a JavaScript object which is returned as the result of postMessageAndAwaitResponse() to the invoking </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ab8b6b045541790d1d0ca862d0a225f27"></a><!-- doxytag: member="PPP_MessageHandler::HandleMessage" ref="ab8b6b045541790d1d0ca862d0a225f27" args=")(PP_Instance instance, void *user_data, const struct PP_Var *message)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void(* <a class="el" href="struct_p_p_p___message_handler__0__2.html#ab8b6b045541790d1d0ca862d0a225f27">PPP_MessageHandler::HandleMessage</a>)(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance, void *user_data, const struct <a class="el" href="struct_p_p___var.html">PP_Var</a> *message)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Invoked as a result of JavaScript invoking postMessage() on the plugin's DOM element. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>A <code>PP_Instance</code> identifying one instance of a module. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">user_data</td><td>is the same pointer which was provided by a call to RegisterMessageHandler(). </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">message</td><td>A copy of the parameter that JavaScript provided to postMessage(). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr />The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="ppp__message__handler_8h.html">ppp_message_handler.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}