Chromium Code Reviews| 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 18 matching lines...) Expand all Loading... | |
| 29 * @param[in] instance A <code>PP_Instance</code> identifying one instance | 29 * @param[in] instance A <code>PP_Instance</code> identifying one instance |
| 30 * of a module. | 30 * of a module. |
| 31 * @param[in] message A <code>PP_Var</code> containing the data to be sent to | 31 * @param[in] message A <code>PP_Var</code> containing the data to be sent to |
| 32 * JavaScript. | 32 * JavaScript. |
| 33 * <code>message</code> can be any <code>PP_Var</code> type except | 33 * <code>message</code> can be any <code>PP_Var</code> type except |
| 34 * <code>PP_VARTYPE_OBJECT</code>. Array/Dictionary types are supported from | 34 * <code>PP_VARTYPE_OBJECT</code>. Array/Dictionary types are supported from |
| 35 * Chrome M29 onward. All var types are copied when passing them to | 35 * Chrome M29 onward. All var types are copied when passing them to |
| 36 * JavaScript. | 36 * JavaScript. |
| 37 * | 37 * |
| 38 * When passing array or dictionary <code>PP_Var</code>s, the entire reference | 38 * When passing array or dictionary <code>PP_Var</code>s, the entire reference |
| 39 * graph will be converted and transferred, including reference cycles if they | 39 * graph will be converted and transferred. If the reference graph has cycles, |
| 40 * exist. | 40 * an undefined var will be sent instead and an error will be logged to the |
|
dmichael (off chromium)
2013/06/04 16:59:10
Is this the behavior that was discussed in the mee
raymes
2013/06/04 19:36:06
We discussed both and there wasn't a clear decisio
dmichael (off chromium)
2013/06/05 17:05:47
Yeah, I could see both sides. Dropping it seems le
| |
| 41 * console. | |
| 41 * | 42 * |
| 42 * Listeners for message events in JavaScript code will receive an object | 43 * Listeners for message events in JavaScript code will receive an object |
| 43 * conforming to the HTML 5 <code>MessageEvent</code> interface. | 44 * conforming to the HTML 5 <code>MessageEvent</code> interface. |
| 44 * Specifically, the value of message will be contained as a property called | 45 * Specifically, the value of message will be contained as a property called |
| 45 * data in the received <code>MessageEvent</code>. | 46 * data in the received <code>MessageEvent</code>. |
| 46 * | 47 * |
| 47 * This messaging system is similar to the system used for listening for | 48 * This messaging system is similar to the system used for listening for |
| 48 * messages from Web Workers. Refer to | 49 * messages from Web Workers. Refer to |
| 49 * <code>http://www.whatwg.org/specs/web-workers/current-work/</code> for | 50 * <code>http://www.whatwg.org/specs/web-workers/current-work/</code> for |
| 50 * further information. | 51 * further information. |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 77 * ppb_messaging_interface->PostMessage(instance, hello_var); // Copies var. | 78 * ppb_messaging_interface->PostMessage(instance, hello_var); // Copies var. |
| 78 * ppb_var_interface->Release(hello_var); | 79 * ppb_var_interface->Release(hello_var); |
| 79 * | 80 * |
| 80 * @endcode | 81 * @endcode |
| 81 * | 82 * |
| 82 * The browser will pop-up an alert saying "Hello world!" | 83 * The browser will pop-up an alert saying "Hello world!" |
| 83 */ | 84 */ |
| 84 void PostMessage([in] PP_Instance instance, [in] PP_Var message); | 85 void PostMessage([in] PP_Instance instance, [in] PP_Var message); |
| 85 }; | 86 }; |
| 86 | 87 |
| OLD | NEW |