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

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

Issue 252023009: PPAPI: Add dev synchronous JS->Plugin messaging API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use channel=dev instead of none Created 6 years, 6 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
« no previous file with comments | « ppapi/c/ppb_messaging.h ('k') | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* Copyright 2014 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5
6 /* From ppp_message_handler.idl modified Fri May 30 15:49:17 2014. */
7
8 #ifndef PPAPI_C_PPP_MESSAGE_HANDLER_H_
9 #define PPAPI_C_PPP_MESSAGE_HANDLER_H_
10
11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_instance.h"
13 #include "ppapi/c/pp_macros.h"
14 #include "ppapi/c/pp_stdint.h"
15 #include "ppapi/c/pp_var.h"
16
17 /**
18 * @file
19 * This file defines the <code>PPP_MessageHandler</code> interface that plugins
20 * can implement and register using PPB_Messaging::RegisterMessageHandler in
21 * order to handle messages sent from JavaScript via postMessage() or
22 * postMessageAndAwaitResponse().
23 */
24
25
26 /**
27 * @addtogroup Interfaces
28 * @{
29 */
30 /**
31 * The <code>PPP_MessageHandler</code> interface is implemented by the plugin
32 * if the plugin wants to receive messages from a thread other than the main
33 * Pepper thread, or if the plugin wants to handle blocking messages which
34 * JavaScript may send via postMessageAndAwaitResponse().
35 *
36 * This interface struct should not be returned by PPP_GetInterface; instead it
37 * must be passed as a parameter to PPB_Messaging::RegisterMessageHandler.
38 */
39 struct PPP_MessageHandler_0_1 {
40 /**
41 * Invoked as a result of JavaScript invoking postMessage() on the plugin's
42 * DOM element.
43 *
44 * @param[in] instance A <code>PP_Instance</code> identifying one instance
45 * of a module.
46 * @param[in] user_data is the same pointer which was provided by a call to
47 * RegisterMessageHandler.
48 * @param[in] message A copy of the parameter that JavaScript provided to
49 * postMessage().
50 */
51 void (*HandleMessage)(PP_Instance instance,
52 const void* user_data,
53 struct PP_Var message);
54 /**
55 * Invoked as a result of JavaScript invoking postMessageAndAwaitResponse()
56 * on the plugin's DOM element.
57 *
58 * @param[in] instance A <code>PP_Instance</code> identifying one instance
59 * of a module.
60 * @param[in] user_data is the same pointer which was provided by a call to
61 * RegisterMessageHandler.
62 * @param[in] message is a copy of the parameter that JavaScript provided
63 * to postMessageAndAwaitResponse.
64 * @return will be copied to a JavaScript object which is returned as
65 * the result of postMessageAndAwaitResponse to the invoking JavaScript.
66 */
67 struct PP_Var (*HandleBlockingMessage)(PP_Instance instance,
68 void* user_data,
69 struct PP_Var message);
70 /**
71 * Invoked when the handler object is no longer needed. After this, no more
72 * calls will be made which pass this same value for <code>instance</code>
73 * and <code>user_data</code>.
74 *
75 * @param[in] instance A <code>PP_Instance</code> identifying one instance
76 * of a module.
77 * @param[in] user_data is the same pointer which was provided by a call to
78 * RegisterMessageHandler.
79 */
80 void (*Destroy)(PP_Instance instance, void* user_data);
81 };
82 /**
83 * @}
84 */
85
86 #endif /* PPAPI_C_PPP_MESSAGE_HANDLER_H_ */
87
OLDNEW
« no previous file with comments | « ppapi/c/ppb_messaging.h ('k') | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698