OLD | NEW |
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 /** | 6 /** |
7 * This file defines the <code>PPB_Messaging</code> interface implemented | 7 * This file defines the <code>PPB_Messaging</code> interface implemented |
8 * by the browser for sending messages to DOM elements associated with a | 8 * by the browser for sending messages to DOM elements associated with a |
9 * specific module instance. | 9 * specific module instance. |
10 */ | 10 */ |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 * ppb_var_interface->Release(hello_var); | 79 * ppb_var_interface->Release(hello_var); |
80 * | 80 * |
81 * @endcode | 81 * @endcode |
82 * | 82 * |
83 * The browser will pop-up an alert saying "Hello world!" | 83 * The browser will pop-up an alert saying "Hello world!" |
84 */ | 84 */ |
85 [version=1.0] | 85 [version=1.0] |
86 void PostMessage([in] PP_Instance instance, [in] PP_Var message); | 86 void PostMessage([in] PP_Instance instance, [in] PP_Var message); |
87 | 87 |
88 /** | 88 /** |
89 * <strong>Note:</strong> This function is not yet implemented. Please use | |
90 * PPB_Messaging_1_0. | |
91 * | |
92 * Registers a handler for receiving messages from JavaScript. If a handler | 89 * Registers a handler for receiving messages from JavaScript. If a handler |
93 * is registered this way, it will replace PPP_Messaging, and all messages | 90 * is registered this way, it will replace PPP_Messaging, and all messages |
94 * sent from JavaScript via postMessage and postMessageAndAwaitResponse will | 91 * sent from JavaScript via postMessage and postMessageAndAwaitResponse will |
95 * be dispatched to <code>handler</code>. | 92 * be dispatched to <code>handler</code>. |
96 * | 93 * |
97 * The function calls will be dispatched via <code>message_loop</code>. This | 94 * The function calls will be dispatched via <code>message_loop</code>. This |
98 * means that the functions will be invoked on the thread to which | 95 * means that the functions will be invoked on the thread to which |
99 * <code>message_loop</code> is attached, when <code>message_loop</code> is | 96 * <code>message_loop</code> is attached, when <code>message_loop</code> is |
100 * run. It is illegal to pass the main thread message loop; | 97 * run. It is illegal to pass the main thread message loop; |
101 * RegisterMessageHandler will return PP_ERROR_WRONG_THREAD in that case. | 98 * RegisterMessageHandler will return PP_ERROR_WRONG_THREAD in that case. |
(...skipping 14 matching lines...) Expand all Loading... |
116 * @param[in] message_loop Represents the message loop on which | 113 * @param[in] message_loop Represents the message loop on which |
117 * PPP_MessageHandler functions should be invoked. | 114 * PPP_MessageHandler functions should be invoked. |
118 * @return PP_OK on success, or an error from pp_errors.h. | 115 * @return PP_OK on success, or an error from pp_errors.h. |
119 */ | 116 */ |
120 [version=1.1] | 117 [version=1.1] |
121 int32_t RegisterMessageHandler([in] PP_Instance instance, | 118 int32_t RegisterMessageHandler([in] PP_Instance instance, |
122 [inout] mem_t user_data, | 119 [inout] mem_t user_data, |
123 [in] PPP_MessageHandler handler, | 120 [in] PPP_MessageHandler handler, |
124 [in] PP_Resource message_loop); | 121 [in] PP_Resource message_loop); |
125 /** | 122 /** |
126 * <strong>Note:</strong> This function is not yet implemented. Please use | |
127 * PPB_Messaging_1_0. | |
128 * | |
129 * Unregisters the current message handler for <code>instance</code> if one | 123 * Unregisters the current message handler for <code>instance</code> if one |
130 * is registered. After this call, the message handler (if one was | 124 * is registered. After this call, the message handler (if one was |
131 * registered) will have "Destroy" called on it and will receive no further | 125 * registered) will have "Destroy" called on it and will receive no further |
132 * messages after that point. After that point, all messages sent from | 126 * messages after that point. After that point, all messages sent from |
133 * JavaScript using postMessage() will be dispatched to PPP_Messaging (if | 127 * JavaScript using postMessage() will be dispatched to PPP_Messaging (if |
134 * the plugin supports PPP_MESSAGING_INTERFACE). Attempts to call | 128 * the plugin supports PPP_MESSAGING_INTERFACE). Attempts to call |
135 * postMessageAndAwaitResponse() from JavaScript will fail. | 129 * postMessageAndAwaitResponse() from JavaScript will fail. |
136 * | 130 * |
137 * Attempting to unregister a message handler when none is registered has no | 131 * Attempting to unregister a message handler when none is registered has no |
138 * effect. | 132 * effect. |
139 * | 133 * |
140 * @param[in] instance A <code>PP_Instance</code> identifying one instance | 134 * @param[in] instance A <code>PP_Instance</code> identifying one instance |
141 * of a module. | 135 * of a module. |
142 */ | 136 */ |
143 [version=1.1] | 137 [version=1.1] |
144 void UnregisterMessageHandler([in] PP_Instance instance); | 138 void UnregisterMessageHandler([in] PP_Instance instance); |
145 }; | 139 }; |
146 | 140 |
OLD | NEW |