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

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

Issue 6538028: A proposal for an initial postMessage interface. This will allow JavaScript ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
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/pp_bool.h" 8 #include "ppapi/c/pp_bool.h"
9 #include "ppapi/c/pp_instance.h" 9 #include "ppapi/c/pp_instance.h"
10 #include "ppapi/c/pp_rect.h" 10 #include "ppapi/c/pp_rect.h"
11 #include "ppapi/c/pp_resource.h" 11 #include "ppapi/c/pp_resource.h"
12 12
13 struct PP_InputEvent; 13 struct PP_InputEvent;
14 struct PP_Var; 14 struct PP_Var;
15 15
16 #define PPP_INSTANCE_INTERFACE "PPP_Instance;0.4" 16 #define PPP_INSTANCE_INTERFACE "PPP_Instance;0.5"
17 17
18 /** 18 /**
19 * @file 19 * @file
20 * This file defines the PPP_Instance structure - a series of points to methods 20 * This file defines the PPP_Instance structure - a series of pointers to
21 * that you must implement in your model. 21 * methods that you must implement in your module instance.
22 * 22 *
23 */ 23 */
24 24
25 /** @addtogroup Interfaces 25 /** @addtogroup Interfaces
26 * @{ 26 * @{
27 */ 27 */
28 28
29 /** 29 /**
30 * The PPP_Instance interface contains pointers to a series of functions that 30 * The PPP_Instance interface contains pointers to a series of functions that
31 * you must implement in your module. These functions can be trivial (simply 31 * you must implement in your module. These functions can be trivial (simply
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 * 165 *
166 * On Failure, the returned var should be a "void" var. 166 * On Failure, the returned var should be a "void" var.
167 * 167 *
168 * The returned PP_Var should have a reference added for the caller, which 168 * The returned PP_Var should have a reference added for the caller, which
169 * will be responsible for Release()ing that reference. 169 * will be responsible for Release()ing that reference.
170 * 170 *
171 * @param[in] instance A PP_Instance indentifying one instance of a module. 171 * @param[in] instance A PP_Instance indentifying one instance of a module.
172 * @return A PP_Var containing scriptable object. 172 * @return A PP_Var containing scriptable object.
173 */ 173 */
174 struct PP_Var (*GetInstanceObject)(PP_Instance instance); 174 struct PP_Var (*GetInstanceObject)(PP_Instance instance);
175
176 /**
177 * HandleMessage is a pointer to a function that the browser will call when
178 * @a postMessage() is invoked on the DOM object for this module instance in
179 * JavaScript. Note that @a postMessage() in the JavaScript interface is
180 * asynchronous, meaning JavaScript execution will not be blocked while
181 * @a HandleMessage() is processing the given @a message.
182 *
183 * For example:
184 *
185 * \verbatim
186 *
187 * <body>
188 * <object id="plugin"
189 * type="application/x-ppapi-postMessage-example"/>
190 * <script type="text/javascript">
191 * document.getElementById('plugin').postMessage("Hello world!");
192 * </script>
193 * </body>
194 *
195 * \endverbatim
196 *
197 * This will result in HandleMessage being invoked on the instance, with
198 * message being a string PP_Var containing "Hello world!".
199 */
200 void (*HandleMessage)(PP_Instance instance, struct PP_Var message);
175 }; 201 };
176 /** 202 /**
177 * @} 203 * @}
178 */ 204 */
179 205
180 #endif /* PPAPI_C_PPP_INSTANCE_H_ */ 206 #endif /* PPAPI_C_PPP_INSTANCE_H_ */
181 207
OLDNEW
« no previous file with comments | « ppapi/c/ppb_instance.h ('k') | ppapi/cpp/instance.h » ('j') | ppapi/cpp/instance.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698