Refactor android test results logging.
[chromium-blink-merge.git] / ppapi / api / ppp_messaging.idl
blob19bd71fc2f967872a7786438805def6a5b3261b9
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 */
6 /**
7 * This file defines the PPP_Messaging interface containing pointers to
8 * functions that you must implement to handle postMessage messages
9 * on the associated DOM element.
13 label Chrome {
14 M14 = 1.0
17 /**
18 * The <code>PPP_Messaging</code> interface contains pointers to functions
19 * that you must implement to handle postMessage events on the associated
20 * DOM element.
22 interface PPP_Messaging {
23 /**
24 * HandleMessage() is a function that the browser calls when PostMessage()
25 * is invoked on the DOM element for the module instance in JavaScript. Note
26 * that PostMessage() in the JavaScript interface is asynchronous, meaning
27 * JavaScript execution will not be blocked while HandleMessage() is
28 * processing the message.
30 * @param[in] instance A <code>PP_Instance</code> identifying one instance
31 * of a module.
32 * @param[in] message A <code>PP_Var</code> containing the data to be sent
33 * to JavaScript. Message can have an int32_t, double, bool, or string value
34 * (objects are not supported).
36 * The following JavaScript code invokes <code>HandleMessage</code>, passing
37 * the module instance on which it was invoked, with <code>message</code>
38 * being a string <code>PP_Var</code> containing "Hello world!"
40 * <strong>Example:</strong>
42 * @code
44 * <body>
45 * <object id="plugin"
46 * type="application/x-ppapi-postMessage-example"/>
47 * <script type="text/javascript">
48 * document.getElementById('plugin').postMessage("Hello world!");
49 * </script>
50 * </body>
52 * @endcode
55 void HandleMessage([in] PP_Instance instance, [in] PP_Var message);