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

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: improve comments Created 6 years, 7 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
(Empty)
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
3 * found in the LICENSE file.
4 */
5
6 /* From ppp_message_handler.idl modified Thu May 1 11:35:41 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>PPB_Messaging</code> interface implemented
20 * by the browser for sending messages to DOM elements associated with a
21 * specific module instance.
22 */
23
24
25 /**
26 * @addtogroup Interfaces
27 * @{
28 */
29 /**
30 * The <code>PPP_MessageHandler</code> interface is implemented by the plugin
31 * if the plugin wants to receive messages from a thread other than the main
32 * Pepper thread, or if the plugin wants to handle blocking messages which
33 * JavaScript may send via postMessageAndAwaitResponse().
34 *
35 * This interface struct should not be returned by PPP_GetInterface; instead it
36 * must be passed as a parameter to PPB_Messaging::RegisterMessageHandler.
37 */
38 struct PPP_MessageHandler_0_1 { /* dev */
39 /**
40 * Invoked as a result of JavaScript invoking postMessage() on the plugin's
41 * DOM element.
42 *
43 * @param[in] instance A <code>PP_Instance</code> identifying one instance
44 * of a module.
45 * @param[in] message A copy of the parameter that JavaScript provided to
46 * postMessage().
47 * @param[in] user_data is the same as was provided by a call to
48 * RegisterMessageHandler.
49 */
50 void (*HandleMessage)(PP_Instance instance,
51 const void* user_data,
52 struct PP_Var message);
53 /**
54 * Invoked as a result of JavaScript invoking postMessageAndAwaitResponse()
55 * on the plugin's DOM element.
56 *
57 * @param[in] instance A <code>PP_Instance</code> identifying one instance
58 * of a module.
59 * @param[in] message is a copy of the parameter that JavaScript provided
60 * to postMessageAndAwaitResponse.
61 * @param[in] user_data is the same as was provided by a call to
62 * RegisterMessageHandler.
63 * @return will be copied to a JavaScript object which is returned as
64 * the result of postMessageAndAwaitResponse to the invoking JavaScript.
65 */
66 struct PP_Var (*HandleBlockingMessage)(PP_Instance instance,
67 const void* user_data,
68 struct PP_Var message);
69 /**
70 * Invoked when the handler object is no longer needed. After this, no more
71 * calls will be made which pass this same value for <code>instance</code>
72 * and <code>user_data</code>.
73 *
74 * @param[in] instance A <code>PP_Instance</code> identifying one instance
75 * of a module.
76 */
77 void (*Destroy)(PP_Instance instance, const void* user_data);
78 };
79 /**
80 * @}
81 */
82
83 #endif /* PPAPI_C_PPP_MESSAGE_HANDLER_H_ */
84
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698