Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 * Use of this source code is governed by a BSD-style license that can be | |
| 3 * found in the LICENSE file. | |
| 4 */ | |
| 5 | |
| 6 /* From ppp_message_handler.idl modified Thu May 1 13:44:17 2014. */ | |
| 7 | |
| 8 #ifndef PPAPI_C_PPP_MESSAGE_HANDLER_H_ | |
| 9 #define PPAPI_C_PPP_MESSAGE_HANDLER_H_ | |
| 10 | |
| 11 #include "ppapi/c/pp_bool.h" | |
| 12 #include "ppapi/c/pp_instance.h" | |
| 13 #include "ppapi/c/pp_macros.h" | |
| 14 #include "ppapi/c/pp_stdint.h" | |
| 15 #include "ppapi/c/pp_var.h" | |
| 16 | |
| 17 /** | |
| 18 * @file | |
| 19 * This file defines the <code>PPB_Messaging</code> interface implemented | |
| 20 * by the browser for sending messages to DOM elements associated with a | |
| 21 * specific module instance. | |
| 22 */ | |
| 23 | |
| 24 | |
| 25 /** | |
| 26 * @addtogroup Interfaces | |
| 27 * @{ | |
| 28 */ | |
| 29 /** | |
| 30 * The <code>PPP_MessageHandler</code> interface is implemented by the plugin | |
| 31 * if the plugin wants to receive messages from a thread other than the main | |
| 32 * Pepper thread, or if the plugin wants to handle blocking messages which | |
| 33 * JavaScript may send via postMessageAndAwaitResponse(). | |
| 34 * | |
| 35 * This interface struct should not be returned by PPP_GetInterface; instead it | |
|
jvoung (off chromium)
2014/05/01 21:29:06
Just checking: Will there be any direct nexe <-> I
dmichael (off chromium)
2014/05/02 18:03:42
Yes, thanks for bringing it up...
| |
| 36 * must be passed as a parameter to PPB_Messaging::RegisterMessageHandler. | |
| 37 */ | |
| 38 struct PPP_MessageHandler_0_1 { /* dev */ | |
| 39 /** | |
| 40 * Invoked as a result of JavaScript invoking postMessage() on the plugin's | |
| 41 * DOM element. | |
| 42 * | |
| 43 * @param[in] instance A <code>PP_Instance</code> identifying one instance | |
| 44 * of a module. | |
| 45 * @param[in] user_data is the same pointer which was provided by a call to | |
| 46 * RegisterMessageHandler. | |
| 47 * @param[in] message A copy of the parameter that JavaScript provided to | |
| 48 * postMessage(). | |
| 49 */ | |
| 50 void (*HandleMessage)(PP_Instance instance, | |
| 51 const void* user_data, | |
| 52 struct PP_Var message); | |
| 53 /** | |
| 54 * Invoked as a result of JavaScript invoking postMessageAndAwaitResponse() | |
| 55 * on the plugin's DOM element. | |
| 56 * | |
| 57 * @param[in] instance A <code>PP_Instance</code> identifying one instance | |
| 58 * of a module. | |
| 59 * @param[in] user_data is the same pointer which was provided by a call to | |
| 60 * RegisterMessageHandler. | |
| 61 * @param[in] message is a copy of the parameter that JavaScript provided | |
| 62 * to postMessageAndAwaitResponse. | |
| 63 * @return will be copied to a JavaScript object which is returned as | |
| 64 * the result of postMessageAndAwaitResponse to the invoking JavaScript. | |
| 65 */ | |
| 66 struct PP_Var (*HandleBlockingMessage)(PP_Instance instance, | |
| 67 const void* user_data, | |
| 68 struct PP_Var message); | |
| 69 /** | |
| 70 * Invoked when the handler object is no longer needed. After this, no more | |
| 71 * calls will be made which pass this same value for <code>instance</code> | |
| 72 * and <code>user_data</code>. | |
| 73 * | |
| 74 * @param[in] instance A <code>PP_Instance</code> identifying one instance | |
| 75 * of a module. | |
| 76 * @param[in] user_data is the same pointer which was provided by a call to | |
| 77 * RegisterMessageHandler. | |
| 78 */ | |
| 79 void (*Destroy)(PP_Instance instance, const void* user_data); | |
| 80 }; | |
| 81 /** | |
| 82 * @} | |
| 83 */ | |
| 84 | |
| 85 #endif /* PPAPI_C_PPP_MESSAGE_HANDLER_H_ */ | |
| 86 | |
| OLD | NEW |