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

Unified Diff: webkit/plugins/ppapi/message_channel.h

Issue 6745015: Make PPAPI PostMessage behave asynchronously. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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
Index: webkit/plugins/ppapi/message_channel.h
===================================================================
--- webkit/plugins/ppapi/message_channel.h (revision 79289)
+++ webkit/plugins/ppapi/message_channel.h (working copy)
@@ -5,6 +5,7 @@
#ifndef WEBKIT_PLUGINS_PPAPI_MESSAGE_CHANNEL_H_
#define WEBKIT_PLUGINS_PPAPI_MESSAGE_CHANNEL_H_
+#include "base/task.h"
#include "third_party/npapi/bindings/npruntime.h"
#include "webkit/plugins/ppapi/resource.h"
@@ -44,7 +45,11 @@
explicit MessageChannel(PluginInstance* instance);
~MessageChannel();
+ // Post a message to the onmessage handler for this channel's instance
+ // asynchronously.
void PostMessageToJavaScript(PP_Var message_data);
+ // Post a message to the PPP_Instance HandleMessage function for this
+ // channel's instance.
void PostMessageToNative(PP_Var message_data);
// Return the NPObject* to which we should forward any calls which aren't
@@ -81,8 +86,22 @@
// to a JavaScript target.
NPVariant onmessage_invoker_;
+ // A function which evaluates the JavaScript code for onmessage_invoker_ and
brettw 2011/03/26 17:34:16 Delete "A function which"
dmichael(do not use this one) 2011/03/26 20:57:08 Done.
+ // makes onmessage_invoker_ a callable NPVariant for that function. Returns
+ // true on success, false otherwise.
bool EvaluateOnMessageInvoker();
+ // Post a message to the onmessage handler for this channel's instance
+ // synchronously. This is used by PostMessageToJavaScript.
+ void PostMessageToJavaScriptImpl(PP_Var message_data);
+ // Post a message to the PPP_Instance HandleMessage function for this
+ // channel's instance. This is used by PostMessageToNative.
+ void PostMessageToNativeImpl(PP_Var message_data);
+
+ // Hold a ScopedRunnableMethodFactory so that when this MessageChannel is
brettw 2011/03/26 17:34:16 I think something shorter like "Ensures pending ta
dmichael(do not use this one) 2011/03/26 20:57:08 Done.
+ // destroyed, any pending tasks (a.k.a. messages in the queue) will not fire.
+ ScopedRunnableMethodFactory<MessageChannel> method_factory_;
+
DISALLOW_COPY_AND_ASSIGN(MessageChannel);
};

Powered by Google App Engine
This is Rietveld 408576698