Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2010 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 #ifndef PPAPI_C_PPP_INSTANCE_H_ | 5 #ifndef PPAPI_C_PPP_INSTANCE_H_ |
| 6 #define PPAPI_C_PPP_INSTANCE_H_ | 6 #define PPAPI_C_PPP_INSTANCE_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/dev/pp_message_event_dev.h" | |
| 8 #include "ppapi/c/pp_bool.h" | 9 #include "ppapi/c/pp_bool.h" |
| 9 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
| 10 #include "ppapi/c/pp_rect.h" | 11 #include "ppapi/c/pp_rect.h" |
| 11 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
| 12 | 13 |
| 13 struct PP_InputEvent; | 14 struct PP_InputEvent; |
| 14 struct PP_Var; | 15 struct PP_Var; |
| 15 | 16 |
| 16 #define PPP_INSTANCE_INTERFACE "PPP_Instance;0.4" | 17 #define PPP_INSTANCE_INTERFACE "PPP_Instance;0.5" |
| 17 | 18 |
| 18 /** | 19 /** |
| 19 * @file | 20 * @file |
| 20 * Defines the API ... | 21 * Defines the API ... |
| 21 * | 22 * |
| 22 */ | 23 */ |
| 23 | 24 |
| 24 /** @addtogroup Interfaces | 25 /** @addtogroup Interfaces |
| 25 * @{ | 26 * @{ |
| 26 */ | 27 */ |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 * Returns a Var representing the instance object to the web page. Normally | 121 * Returns a Var representing the instance object to the web page. Normally |
| 121 * this will be a PPP_Class object that exposes certain methods the page | 122 * this will be a PPP_Class object that exposes certain methods the page |
| 122 * may want to call. | 123 * may want to call. |
| 123 * | 124 * |
| 124 * On Failure, the returned var should be a "void" var. | 125 * On Failure, the returned var should be a "void" var. |
| 125 * | 126 * |
| 126 * The returned PP_Var should have a reference added for the caller, which | 127 * The returned PP_Var should have a reference added for the caller, which |
| 127 * will be responsible for Release()ing that reference. | 128 * will be responsible for Release()ing that reference. |
| 128 */ | 129 */ |
| 129 struct PP_Var (*GetInstanceObject)(PP_Instance instance); | 130 struct PP_Var (*GetInstanceObject)(PP_Instance instance); |
| 131 | |
| 132 /** | |
| 133 * This method is invoked when postMessage is invoked on the DOM object for | |
| 134 * this instance in JavaScript. | |
| 135 * | |
| 136 * For example: | |
| 137 * | |
| 138 * <body> | |
| 139 * <object id="plugin" | |
| 140 * type="application/x-ppapi-postMessage-example"/> | |
| 141 * <script type="text/javascript"> | |
| 142 * document.getElementById('plugin').postMessage("Hello world!"); | |
| 143 * </script> | |
| 144 * </body> | |
| 145 * | |
| 146 * This will result in OnMessage being invoked on the instance, with | |
| 147 * message.data being a string PP_Var containing "Hello world!". | |
| 148 */ | |
| 149 void (*OnMessage)(PP_Instance instance, struct PP_MessageEvent_Dev message); | |
|
darin (slow to review)
2011/02/17 19:20:52
nit: pass message by const pointer.
Stepping back
dmichael(do not use this one)
2011/02/17 20:07:04
I thought about doing MessagePort based on his sug
brettw
2011/02/17 20:40:01
In reality, 99% of people will use the simplest po
dmichael(do not use this one)
2011/02/17 22:18:22
Done.
| |
| 130 }; | 150 }; |
| 131 /** | 151 /** |
| 132 * @} | 152 * @} |
| 133 */ | 153 */ |
| 134 | 154 |
| 135 #endif /* PPAPI_C_PPP_INSTANCE_H_ */ | 155 #endif /* PPAPI_C_PPP_INSTANCE_H_ */ |
| 136 | 156 |
| OLD | NEW |