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

Unified Diff: ppapi/c/ppp_instance.h

Issue 6538028: A proposal for an initial postMessage interface. This will allow JavaScript ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/c/ppb_instance.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/c/ppp_instance.h
===================================================================
--- ppapi/c/ppp_instance.h (revision 75765)
+++ ppapi/c/ppp_instance.h (working copy)
@@ -5,6 +5,7 @@
#ifndef PPAPI_C_PPP_INSTANCE_H_
#define PPAPI_C_PPP_INSTANCE_H_
+#include "ppapi/c/dev/pp_message_event_dev.h"
#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_rect.h"
@@ -13,7 +14,7 @@
struct PP_InputEvent;
struct PP_Var;
-#define PPP_INSTANCE_INTERFACE "PPP_Instance;0.4"
+#define PPP_INSTANCE_INTERFACE "PPP_Instance;0.5"
/**
* @file
@@ -172,6 +173,25 @@
* @return A PP_Var containing scriptable object.
*/
struct PP_Var (*GetInstanceObject)(PP_Instance instance);
darin (slow to review) 2011/02/23 22:36:46 I think now is the time to delete GetInstanceObjec
dmichael(do not use this one) 2011/02/23 22:45:00 I'm concerned that will make it really difficult t
+
+ /**
+ * This method gets called when postMessage is invoked on the DOM object for
+ * this instance in JavaScript.
+ *
+ * For example:
+ *
+ * <body>
+ * <object id="plugin"
+ * type="application/x-ppapi-postMessage-example"/>
+ * <script type="text/javascript">
+ * document.getElementById('plugin').postMessage("Hello world!");
+ * </script>
+ * </body>
+ *
+ * This will result in HandleMessage being invoked on the instance, with
+ * message being a string PP_Var containing "Hello world!".
+ */
+ void (*HandleMessage)(PP_Instance instance, PP_Var message);
darin (slow to review) 2011/02/23 22:36:46 I think you need to stay "struct PP_Var" here.
dmichael(do not use this one) 2011/02/23 22:45:00 Nice catch, thanks! If I'd actually *built* ppapi
};
/**
* @}
« no previous file with comments | « ppapi/c/ppb_instance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698