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

Unified Diff: ppapi/proxy/message_handler.cc

Issue 564573002: PPAPI: Make PPP_MessageHandler work in PNaCl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/proxy/message_handler.h ('k') | ppapi/proxy/ppb_instance_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/message_handler.cc
diff --git a/ppapi/proxy/message_handler.cc b/ppapi/proxy/message_handler.cc
index fff878811fcb3a9d028cf379836676a150a3c101..2e0dd8b5ef7a7d7e5d0266dd69d3adc676774711 100644
--- a/ppapi/proxy/message_handler.cc
+++ b/ppapi/proxy/message_handler.cc
@@ -16,14 +16,16 @@ namespace ppapi {
namespace proxy {
namespace {
-typedef void (*HandleMessageFunc)(PP_Instance, void*, PP_Var);
-typedef PP_Var (*HandleBlockingMessageFunc)(PP_Instance, void*, PP_Var);
+typedef void (*HandleMessageFunc)(PP_Instance, void*, const PP_Var*);
+typedef void (*HandleBlockingMessageFunc)(
+ PP_Instance, void*, const PP_Var*, PP_Var*);
void HandleMessageWrapper(HandleMessageFunc function,
PP_Instance instance,
void* user_data,
ScopedPPVar message_data) {
- CallWhileUnlocked(function, instance, user_data, message_data.get());
+ CallWhileUnlocked(function, instance, user_data,
+ const_cast<const PP_Var*>(&message_data.get()));
teravest 2014/09/11 15:42:41 As discussed off-thread, the const_cast<> here loo
}
void HandleBlockingMessageWrapper(HandleBlockingMessageFunc function,
@@ -34,13 +36,12 @@ void HandleBlockingMessageWrapper(HandleBlockingMessageFunc function,
PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
if (!dispatcher)
return;
- PP_Var return_value = CallWhileUnlocked(function,
- instance,
- user_data,
- message_data.get());
+ PP_Var result = PP_MakeUndefined();
+ CallWhileUnlocked(function, instance, user_data,
+ const_cast<const PP_Var*>(&message_data.get()), &result);
PpapiMsg_PPPMessageHandler_HandleBlockingMessage::WriteReplyParams(
reply_msg.get(),
- SerializedVarReturnValue::Convert(dispatcher, return_value),
+ SerializedVarReturnValue::Convert(dispatcher, result),
true /* was_handled */);
dispatcher->Send(reply_msg.release());
}
@@ -50,7 +51,7 @@ void HandleBlockingMessageWrapper(HandleBlockingMessageFunc function,
// static
scoped_ptr<MessageHandler> MessageHandler::Create(
PP_Instance instance,
- const PPP_MessageHandler_0_1* handler_if,
+ const PPP_MessageHandler_0_2* handler_if,
void* user_data,
PP_Resource message_loop,
int32_t* error) {
@@ -121,7 +122,7 @@ void MessageHandler::HandleBlockingMessage(ScopedPPVar var,
MessageHandler::MessageHandler(
PP_Instance instance,
- const PPP_MessageHandler_0_1* handler_if,
+ const PPP_MessageHandler_0_2* handler_if,
void* user_data,
scoped_refptr<MessageLoopResource> message_loop)
: instance_(instance),
« no previous file with comments | « ppapi/proxy/message_handler.h ('k') | ppapi/proxy/ppb_instance_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698