Chromium Code Reviews| Index: ppapi/c/dev/ppp_messaging_dev.h |
| =================================================================== |
| --- ppapi/c/dev/ppp_messaging_dev.h (revision 0) |
| +++ ppapi/c/dev/ppp_messaging_dev.h (revision 0) |
| @@ -0,0 +1,67 @@ |
| +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| +#ifndef PPAPI_C_DEV_PPP_MESSAGING_DEV_H_ |
| +#define PPAPI_C_DEV_PPP_MESSAGING_DEV_H_ |
| + |
| +#include "ppapi/c/pp_instance.h" |
| + |
| +struct PP_Var; |
| + |
| +#define PPP_MESSAGING_DEV_INTERFACE_0_1 "PPP_Messaging_Dev;0.1" |
| + |
| +#define PPP_MESSAGING_DEV_INTERFACE PPP_MESSAGING_DEV_INTERFACE_0_1 |
| + |
| +/** |
| + * @file |
| + * This file defines the PPP_Messaging_Dev structure - a series of pointers to |
| + * methods that you must implement in your module instance if you wish to |
| + * handle messages posted to the module instance via calls to postMessage on |
| + * the DOM element associated with the module instance. |
|
polina
2011/03/22 22:00:59
You have "module instance" 3 times in the same sen
dmichael(do not use this one)
2011/03/23 17:03:18
Done.
|
| + * |
| + */ |
| + |
| +/** @addtogroup Interfaces |
| + * @{ |
| + */ |
| + |
| +/** |
| + * The PPP_Messaging_Dev interface contains pointers to a series of functions |
| + * that you must implement if you wish to handle messages posted to the module |
| + * instance via calls to postMessage on the DOM element associated with the |
| + * module instance. |
| + */ |
| +struct PPP_Messaging_Dev { |
| + /** |
| + * HandleMessage is a pointer to a function that the browser will call when |
| + * @a postMessage() is invoked on the DOM object for the module instance in |
|
polina
2011/03/22 22:00:59
DOM element
|
| + * JavaScript. Note that @a postMessage() in the JavaScript interface is |
| + * asynchronous, meaning JavaScript execution will not be blocked while |
|
polina
2011/03/22 22:00:59
I think it's more important to note that HandleMes
brettw
2011/03/23 01:59:17
I think the current description is fine for the sa
dmichael(do not use this one)
2011/03/23 17:03:18
I agree with Brett here.
polina
2011/03/24 05:42:33
Won't JavaScript thread be blocked once the proxy
|
| + * @a HandleMessage() is processing the given @a message. |
| + * |
| + * For example: |
| + * |
| + * \verbatim |
| + * |
| + * <body> |
| + * <object id="plugin" |
| + * type="application/x-ppapi-postMessage-example"/> |
| + * <script type="text/javascript"> |
| + * document.getElementById('plugin').postMessage("Hello world!"); |
| + * </script> |
| + * </body> |
| + * |
| + * \endverbatim |
| + * |
| + * This will result in HandleMessage being invoked, passing the module |
|
polina
2011/03/22 22:00:59
@a HandleMessage?
dmichael(do not use this one)
2011/03/23 17:03:18
Done.
|
| + * instance on which it was invoked, with message being a string PP_Var |
|
polina
2011/03/22 22:00:59
@a message?
dmichael(do not use this one)
2011/03/23 17:03:18
Done.
|
| + * containing "Hello world!". |
| + */ |
| + void (*HandleMessage)(PP_Instance instance, struct PP_Var message); |
|
polina
2011/03/22 22:00:59
I still think that it is unfortunate that we have
dmichael(do not use this one)
2011/03/23 17:03:18
The way I have things organized currently, though,
|
| +}; |
| +/** |
| + * @} |
| + */ |
| +#endif /* PPAPI_C_DEV_PPP_MESSAGING_DEV_H_ */ |
| + |
| Property changes on: ppapi/c/dev/ppp_messaging_dev.h |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |