diff options
Diffstat (limited to 'ppapi/proxy')
-rw-r--r-- | ppapi/proxy/host_dispatcher.cc | 12 | ||||
-rw-r--r-- | ppapi/proxy/host_dispatcher.h | 5 |
2 files changed, 15 insertions, 2 deletions
diff --git a/ppapi/proxy/host_dispatcher.cc b/ppapi/proxy/host_dispatcher.cc index fd9801c..6e7a1f4 100644 --- a/ppapi/proxy/host_dispatcher.cc +++ b/ppapi/proxy/host_dispatcher.cc @@ -7,6 +7,7 @@ #include <map> #include "base/logging.h" +#include "ppapi/c/dev/ppb_var_deprecated.h" #include "ppapi/proxy/host_var_serialization_rules.h" #include "ppapi/proxy/ppapi_messages.h" @@ -21,10 +22,13 @@ InstanceToDispatcherMap* g_instance_to_dispatcher = NULL; } // namespace HostDispatcher::HostDispatcher(base::ProcessHandle remote_process_handle, - const PPB_Var_Deprecated* var_interface, PP_Module module, GetInterfaceFunc local_get_interface) : Dispatcher(remote_process_handle, local_get_interface) { + set_pp_module(module); + const PPB_Var_Deprecated* var_interface = + static_cast<const PPB_Var_Deprecated*>( + local_get_interface(PPB_VAR_DEPRECATED_INTERFACE)); SetSerializationRules(new HostVarSerializationRules(var_interface, module)); } @@ -33,6 +37,12 @@ HostDispatcher::~HostDispatcher() { Send(new PpapiMsg_Shutdown()); } +bool HostDispatcher::InitializeModule() { + bool init_result = false; + Send(new PpapiMsg_InitializeModule(pp_module(), &init_result)); + return init_result; +} + // static HostDispatcher* HostDispatcher::GetForInstance(PP_Instance instance) { if (!g_instance_to_dispatcher) diff --git a/ppapi/proxy/host_dispatcher.h b/ppapi/proxy/host_dispatcher.h index f968652..f5b91b4 100644 --- a/ppapi/proxy/host_dispatcher.h +++ b/ppapi/proxy/host_dispatcher.h @@ -38,11 +38,14 @@ class HostDispatcher : public Dispatcher { // // You must call Dispatcher::InitWithChannel after the constructor. HostDispatcher(base::ProcessHandle host_process_handle, - const PPB_Var_Deprecated* var_interface, PP_Module module, GetInterfaceFunc local_get_interface); ~HostDispatcher(); + // Calls the plugin's PPP_InitializeModule function and returns true if + // the call succeeded. + bool InitializeModule(); + // The host side maintains a mapping from PP_Instance to Dispatcher so // that we can send the messages to the right channel. static HostDispatcher* GetForInstance(PP_Instance instance); |