summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorjond@google.com <jond@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-31 20:27:10 +0000
committerjond@google.com <jond@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-31 20:27:10 +0000
commite2c2efabff86f9c0da85b498cbeea3bf052628c4 (patch)
tree6d4462ebc7d14bad0b05d632febc641f3266fc54 /ppapi
parentf8233cce27cea79cfdcfa3fae485e22c68470435 (diff)
downloadchromium_src-e2c2efabff86f9c0da85b498cbeea3bf052628c4.zip
chromium_src-e2c2efabff86f9c0da85b498cbeea3bf052628c4.tar.gz
chromium_src-e2c2efabff86f9c0da85b498cbeea3bf052628c4.tar.bz2
Cleaned up PostMessage documentation
Review URL: http://codereview.chromium.org/7062028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87355 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/c/ppb_messaging.h52
-rw-r--r--ppapi/c/ppp_messaging.h37
2 files changed, 49 insertions, 40 deletions
diff --git a/ppapi/c/ppb_messaging.h b/ppapi/c/ppb_messaging.h
index e438346..e1bd85f 100644
--- a/ppapi/c/ppb_messaging.h
+++ b/ppapi/c/ppb_messaging.h
@@ -13,44 +13,44 @@
/**
* @file
- * This file defines the PPB_Messaging interface implemented by the browser.
- * The PPB_Messaging interface contains pointers to functions related to
- * sending messages to JavaScript message event listeners on the DOM element
- * associated with a specific module instance.
+ * This file defines the PPB_Messaging interface implemented by the browser
+ * related to sending messages to DOM elements associated with a specific
+ * module instance.
*
* @addtogroup Interfaces
* @{
*/
/**
- * The PPB_Messaging interface contains pointers to functions related to
+ * The PPB_Messaging interface contains a pointer to a function related to
* sending messages to JavaScript message event listeners on the DOM element
* associated with a specific module instance.
*/
struct PPB_Messaging {
/**
- * @a PostMessage is a pointer to a function which asynchronously invokes any
+ * PostMessage is a pointer to a function that asynchronously invokes any
* listeners for message events on the DOM element for the given module
- * instance. This means that a call to @a PostMessage will not block while the
- * message is processed.
+ * instance. A call to PostMessage() will not block while the message is
+ * processed.
*
- * @param message is a PP_Var containing the data to be sent to JavaScript.
- * Currently, it can have an int32_t, double, bool, or string value (objects
- * are not supported.)
+ * @param[in] instance A PP_Instance indentifying one instance of a module.
+ * @param[in] message A PP_Var containing the data to be sent to JavaScript.
+ * Message can have an int32_t, double, bool, or string value (objects
+ * are not supported).
*
* Listeners for message events in JavaScript code will receive an object
- * conforming to the MessageEvent interface. In particular, the value of @a
- * message will be contained as a property called @a data in the received
+ * conforming to the HTML 5 MessageEvent interface. Specifically, the value of
+ * message will be contained as a property called data in the received
* MessageEvent.
*
- * This is analogous to listening for messages from Web Workers.
+ * This messaging system is similar to the system used for listening for
+ * messages from Web Workers. Refer to
+ * http://www.whatwg.org/specs/web-workers/current-work/ for further
+ * information.
*
- * See:
- * http://www.whatwg.org/specs/web-workers/current-work/
+ * <strong>Example:</strong>
*
- * For example:
- *
- * @verbatim
+ * @code
*
* <body>
* <object id="plugin"
@@ -63,18 +63,22 @@ struct PPB_Messaging {
* </script>
* </body>
*
- * @endverbatim
+ * @endcode
+ *
+ * The module instance then invokes PostMessage() as follows:
+ *
+ * @code
+ *
*
- * If the module instance then invokes @a PostMessage() as follows:
- * <code>
* char hello_world[] = "Hello world!";
* PP_Var hello_var = ppb_var_if->VarFromUtf8(instance,
* hello_world,
* sizeof(hello_world));
* ppb_messaging_if->PostMessage(instance, hello_var);
- * </code>
*
- * The browser will pop-up an alert saying "Hello world!".
+ * @endcode
+ *
+ * The browser will pop-up an alert saying "Hello world!"
*/
void (*PostMessage)(PP_Instance instance, struct PP_Var message);
};
diff --git a/ppapi/c/ppp_messaging.h b/ppapi/c/ppp_messaging.h
index 29a1213..5441a50 100644
--- a/ppapi/c/ppp_messaging.h
+++ b/ppapi/c/ppp_messaging.h
@@ -13,9 +13,9 @@ struct PP_Var;
/**
* @file
- * This file defines the PPP_Messaging structure - a series of pointers to
- * methods that you must implement if you wish to handle messages posted to the
- * module instance via calls to postMessage on the associated DOM element.
+ * This file defines the PPP_Messaging interface containing pointers to
+ * functions that you must implement to handle postMessage messages
+ * on the associated DOM element.
*
*/
@@ -24,21 +24,29 @@ struct PP_Var;
*/
/**
- * The PPP_Messaging 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 associated DOM element.
+ * The PPP_Messaging interface contains pointers to functions that you must
+ * implement to handle postMessage events on the associated DOM element.
*/
struct PPP_Messaging {
/**
- * HandleMessage is a pointer to a function that the browser will call when
- * @a postMessage() is invoked on the DOM element for the module instance in
- * JavaScript. Note that @a postMessage() in the JavaScript interface is
+ * HandleMessage is a pointer to a function that the browser calls when
+ * PostMessage() is invoked on the DOM element for the module instance in
+ * JavaScript. Note that PostMessage() in the JavaScript interface is
* asynchronous, meaning JavaScript execution will not be blocked while
- * @a HandleMessage() is processing the given @a message.
+ * HandleMessage() is processing the message.
*
- * For example:
+ * @param[in] instance A PP_Instance indentifying one instance of a module.
+ * @param[in] message A PP_Var containing the data to be sent to JavaScript.
+ * Message can have an int32_t, double, bool, or string value (objects
+ * are not supported).
*
- * @verbatim
+ * <strong>Example:</strong>
+ *
+ * The following JavaScript code invokes HandleMessage, passing the module
+ * instance on which it was invoked, with <code>message</code> being a
+ * string PP_Var containing "Hello world!"
+ *
+ * @code
*
* <body>
* <object id="plugin"
@@ -48,11 +56,8 @@ struct PPP_Messaging {
* </script>
* </body>
*
- * @endverbatim
+ * @endcode
*
- * This will result in @a HandleMessage being invoked, passing the module
- * instance on which it was invoked, with @a message being a string PP_Var
- * containing "Hello world!".
*/
void (*HandleMessage)(PP_Instance instance, struct PP_Var message);
};