| 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 /* From ppp_messaging.idl modified Tue May 21 09:01:17 2013. */ | 6 /* From ppp_messaging.idl modified Mon Jun 3 12:25:00 2013. */ |
| 7 | 7 |
| 8 #ifndef PPAPI_C_PPP_MESSAGING_H_ | 8 #ifndef PPAPI_C_PPP_MESSAGING_H_ |
| 9 #define PPAPI_C_PPP_MESSAGING_H_ | 9 #define PPAPI_C_PPP_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_stdint.h" | 14 #include "ppapi/c/pp_stdint.h" |
| 15 #include "ppapi/c/pp_var.h" | 15 #include "ppapi/c/pp_var.h" |
| 16 | 16 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 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> which has been converted from a | 48 * @param[in] message A <code>PP_Var</code> which has been converted from a |
| 49 * JavaScript value. JavaScript array/object types are supported from Chrome | 49 * JavaScript value. JavaScript array/object types are supported from Chrome |
| 50 * M29 onward. All JavaScript values are copied when passing them to the | 50 * M29 onward. All JavaScript values are copied when passing them to the |
| 51 * plugin. | 51 * plugin. |
| 52 * | 52 * |
| 53 * When converting JavaScript arrays, any object properties whose name | 53 * When converting JavaScript arrays, any object properties whose name |
| 54 * is not an array index are ignored. When passing arrays and objects, the | 54 * is not an array index are ignored. When passing arrays and objects, the |
| 55 * entire reference graph will be converted and transferred, including | 55 * entire reference graph will be converted and transferred. If the reference |
| 56 * reference cycles if they exist. Since <code>PP_Var</code>s are ref-counted, | 56 * graph has cycles, an undefined var will be sent instead and an error will |
| 57 * the author of the plugin must take care if they expect to receive vars with | 57 * be logged to the console. |
| 58 * cycles. Cycles must be manually broken to correctly release the vars. | |
| 59 * | 58 * |
| 60 * The following JavaScript code invokes <code>HandleMessage</code>, passing | 59 * The following JavaScript code invokes <code>HandleMessage</code>, passing |
| 61 * the module instance on which it was invoked, with <code>message</code> | 60 * the module instance on which it was invoked, with <code>message</code> |
| 62 * being a string <code>PP_Var</code> containing "Hello world!" | 61 * being a string <code>PP_Var</code> containing "Hello world!" |
| 63 * | 62 * |
| 64 * <strong>Example:</strong> | 63 * <strong>Example:</strong> |
| 65 * | 64 * |
| 66 * @code | 65 * @code |
| 67 * | 66 * |
| 68 * <body> | 67 * <body> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 79 void (*HandleMessage)(PP_Instance instance, struct PP_Var message); | 78 void (*HandleMessage)(PP_Instance instance, struct PP_Var message); |
| 80 }; | 79 }; |
| 81 | 80 |
| 82 typedef struct PPP_Messaging_1_0 PPP_Messaging; | 81 typedef struct PPP_Messaging_1_0 PPP_Messaging; |
| 83 /** | 82 /** |
| 84 * @} | 83 * @} |
| 85 */ | 84 */ |
| 86 | 85 |
| 87 #endif /* PPAPI_C_PPP_MESSAGING_H_ */ | 86 #endif /* PPAPI_C_PPP_MESSAGING_H_ */ |
| 88 | 87 |
| OLD | NEW |