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

Unified Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 264303002: PPAPI: Implement synchronous postMessage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 6 years, 6 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 | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | content/renderer/pepper/v8_var_converter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_plugin_instance_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index 7db4c547f56e735fe96e414d3463288cf7ad641c..2b23e29e56915cd5ab77f3e55ca85340296bd833 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -1168,8 +1168,8 @@ void PepperPluginInstanceImpl::HandleMessage(ScopedPPVar message) {
ppapi::proxy::HostDispatcher* dispatcher =
ppapi::proxy::HostDispatcher::GetForInstance(pp_instance());
if (!dispatcher || (message.get().type == PP_VARTYPE_OBJECT)) {
- // The dispatcher should always be valid, and the browser should never send
- // an 'object' var over PPP_Messaging.
+ // The dispatcher should always be valid, and MessageChannel should never
+ // send an 'object' var over PPP_Messaging.
NOTREACHED();
return;
}
@@ -1180,6 +1180,32 @@ void PepperPluginInstanceImpl::HandleMessage(ScopedPPVar message) {
pp_instance())));
}
+bool PepperPluginInstanceImpl::HandleBlockingMessage(ScopedPPVar message,
+ ScopedPPVar* result) {
+ TRACE_EVENT0("ppapi", "PepperPluginInstanceImpl::HandleBlockingMessage");
+ ppapi::proxy::HostDispatcher* dispatcher =
+ ppapi::proxy::HostDispatcher::GetForInstance(pp_instance());
+ if (!dispatcher || (message.get().type == PP_VARTYPE_OBJECT)) {
+ // The dispatcher should always be valid, and MessageChannel should never
+ // send an 'object' var over PPP_Messaging.
+ NOTREACHED();
+ return false;
+ }
+ ppapi::proxy::ReceiveSerializedVarReturnValue msg_reply;
+ bool was_handled = false;
+ dispatcher->Send(new PpapiMsg_PPPMessageHandler_HandleBlockingMessage(
+ ppapi::API_ID_PPP_MESSAGING,
+ pp_instance(),
+ ppapi::proxy::SerializedVarSendInputShmem(dispatcher, message.get(),
+ pp_instance()),
+ &msg_reply,
+ &was_handled));
+ *result = ScopedPPVar(ScopedPPVar::PassRef(), msg_reply.Return(dispatcher));
+ TRACE_EVENT0("ppapi",
+ "PepperPluginInstanceImpl::HandleBlockingMessage return.");
+ return was_handled;
+}
+
PP_Var PepperPluginInstanceImpl::GetInstanceObject() {
// Keep a reference on the stack. See NOTE above.
scoped_refptr<PepperPluginInstanceImpl> ref(this);
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | content/renderer/pepper/v8_var_converter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698