Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: ppapi/c/ppb_messaging.h

Issue 564573002: PPAPI: Make PPP_MessageHandler work in PNaCl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/c/dev/ppb_messaging_deprecated.h ('k') | ppapi/c/ppp_message_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 /* From ppb_messaging.idl modified Fri Jun 13 15:28:26 2014. */ 6 /* From ppb_messaging.idl modified Wed Sep 10 15:41:14 2014. */
7 7
8 #ifndef PPAPI_C_PPB_MESSAGING_H_ 8 #ifndef PPAPI_C_PPB_MESSAGING_H_
9 #define PPAPI_C_PPB_MESSAGING_H_ 9 #define PPAPI_C_PPB_MESSAGING_H_
10 10
11 #include "ppapi/c/pp_bool.h" 11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_instance.h" 12 #include "ppapi/c/pp_instance.h"
13 #include "ppapi/c/pp_macros.h" 13 #include "ppapi/c/pp_macros.h"
14 #include "ppapi/c/pp_resource.h" 14 #include "ppapi/c/pp_resource.h"
15 #include "ppapi/c/pp_stdint.h" 15 #include "ppapi/c/pp_stdint.h"
16 #include "ppapi/c/pp_var.h" 16 #include "ppapi/c/pp_var.h"
17 #include "ppapi/c/ppp_message_handler.h" 17 #include "ppapi/c/ppp_message_handler.h"
18 18
19 #define PPB_MESSAGING_INTERFACE_1_0 "PPB_Messaging;1.0" 19 #define PPB_MESSAGING_INTERFACE_1_0 "PPB_Messaging;1.0"
20 #define PPB_MESSAGING_INTERFACE_1_1 "PPB_Messaging;1.1" /* dev */ 20 #define PPB_MESSAGING_INTERFACE_1_2 "PPB_Messaging;1.2" /* dev */
21 #define PPB_MESSAGING_INTERFACE PPB_MESSAGING_INTERFACE_1_0 21 #define PPB_MESSAGING_INTERFACE PPB_MESSAGING_INTERFACE_1_0
22 22
23 /** 23 /**
24 * @file 24 * @file
25 * This file defines the <code>PPB_Messaging</code> interface implemented 25 * This file defines the <code>PPB_Messaging</code> interface implemented
26 * by the browser for sending messages to DOM elements associated with a 26 * by the browser for sending messages to DOM elements associated with a
27 * specific module instance. 27 * specific module instance.
28 */ 28 */
29 29
30 30
31 /** 31 /**
32 * @addtogroup Interfaces 32 * @addtogroup Interfaces
33 * @{ 33 * @{
34 */ 34 */
35 /** 35 /**
36 * The <code>PPB_Messaging</code> interface is implemented by the browser 36 * The <code>PPB_Messaging</code> interface is implemented by the browser
37 * and is related to sending messages to JavaScript message event listeners on 37 * and is related to sending messages to JavaScript message event listeners on
38 * the DOM element associated with specific module instance. 38 * the DOM element associated with specific module instance.
39 */ 39 */
40 struct PPB_Messaging_1_1 { /* dev */ 40 struct PPB_Messaging_1_2 { /* dev */
41 /** 41 /**
42 * PostMessage() asynchronously invokes any listeners for message events on 42 * PostMessage() asynchronously invokes any listeners for message events on
43 * the DOM element for the given module instance. A call to PostMessage() 43 * the DOM element for the given module instance. A call to PostMessage()
44 * will not block while the message is processed. 44 * will not block while the message is processed.
45 * 45 *
46 * @param[in] instance A <code>PP_Instance</code> identifying one instance 46 * @param[in] instance A <code>PP_Instance</code> identifying one instance
47 * of a module. 47 * of a module.
48 * @param[in] message A <code>PP_Var</code> containing the data to be sent to 48 * @param[in] message A <code>PP_Var</code> containing the data to be sent to
49 * JavaScript. 49 * JavaScript.
50 * <code>message</code> can be any <code>PP_Var</code> type except 50 * <code>message</code> can be any <code>PP_Var</code> type except
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 * same pointer when invoking functions within PPP_MessageHandler. 130 * same pointer when invoking functions within PPP_MessageHandler.
131 * @param[in] handler The plugin-provided set of functions for handling 131 * @param[in] handler The plugin-provided set of functions for handling
132 * messages. 132 * messages.
133 * @param[in] message_loop Represents the message loop on which 133 * @param[in] message_loop Represents the message loop on which
134 * PPP_MessageHandler functions should be invoked. 134 * PPP_MessageHandler functions should be invoked.
135 * @return PP_OK on success, or an error from pp_errors.h. 135 * @return PP_OK on success, or an error from pp_errors.h.
136 */ 136 */
137 int32_t (*RegisterMessageHandler)( 137 int32_t (*RegisterMessageHandler)(
138 PP_Instance instance, 138 PP_Instance instance,
139 void* user_data, 139 void* user_data,
140 const struct PPP_MessageHandler_0_1* handler, 140 const struct PPP_MessageHandler_0_2* handler,
141 PP_Resource message_loop); 141 PP_Resource message_loop);
142 /** 142 /**
143 * Unregisters the current message handler for <code>instance</code> if one 143 * Unregisters the current message handler for <code>instance</code> if one
144 * is registered. After this call, the message handler (if one was 144 * is registered. After this call, the message handler (if one was
145 * registered) will have "Destroy" called on it and will receive no further 145 * registered) will have "Destroy" called on it and will receive no further
146 * messages after that point. After that point, all messages sent from 146 * messages after that point. After that point, all messages sent from
147 * JavaScript using postMessage() will be dispatched to PPP_Messaging (if 147 * JavaScript using postMessage() will be dispatched to PPP_Messaging (if
148 * the plugin supports PPP_MESSAGING_INTERFACE). Attempts to call 148 * the plugin supports PPP_MESSAGING_INTERFACE). Attempts to call
149 * postMessageAndAwaitResponse() from JavaScript will fail. 149 * postMessageAndAwaitResponse() from JavaScript will fail.
150 * 150 *
(...skipping 10 matching lines...) Expand all
161 void (*PostMessage)(PP_Instance instance, struct PP_Var message); 161 void (*PostMessage)(PP_Instance instance, struct PP_Var message);
162 }; 162 };
163 163
164 typedef struct PPB_Messaging_1_0 PPB_Messaging; 164 typedef struct PPB_Messaging_1_0 PPB_Messaging;
165 /** 165 /**
166 * @} 166 * @}
167 */ 167 */
168 168
169 #endif /* PPAPI_C_PPB_MESSAGING_H_ */ 169 #endif /* PPAPI_C_PPB_MESSAGING_H_ */
170 170
OLDNEW
« no previous file with comments | « ppapi/c/dev/ppb_messaging_deprecated.h ('k') | ppapi/c/ppp_message_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698