diff options
Diffstat (limited to 'ppapi/proxy/ppb_instance_proxy.cc')
-rw-r--r-- | ppapi/proxy/ppb_instance_proxy.cc | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc index b26a028..8962292 100644 --- a/ppapi/proxy/ppb_instance_proxy.cc +++ b/ppapi/proxy/ppb_instance_proxy.cc @@ -16,7 +16,10 @@ namespace proxy { namespace { PP_Var GetWindowObject(PP_Instance instance) { - Dispatcher* dispatcher = PluginDispatcher::Get(); + PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); + if (!dispatcher) + return PP_MakeUndefined(); + ReceiveSerializedVarReturnValue result; dispatcher->Send(new PpapiHostMsg_PPBInstance_GetWindowObject( INTERFACE_ID_PPB_INSTANCE, instance, &result)); @@ -24,7 +27,10 @@ PP_Var GetWindowObject(PP_Instance instance) { } PP_Var GetOwnerElementObject(PP_Instance instance) { - Dispatcher* dispatcher = PluginDispatcher::Get(); + PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); + if (!dispatcher) + return PP_MakeUndefined(); + ReceiveSerializedVarReturnValue result; dispatcher->Send(new PpapiHostMsg_PPBInstance_GetOwnerElementObject( INTERFACE_ID_PPB_INSTANCE, instance, &result)); @@ -32,21 +38,32 @@ PP_Var GetOwnerElementObject(PP_Instance instance) { } PP_Bool BindGraphics(PP_Instance instance, PP_Resource device) { - PP_Bool result; - PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( + PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); + if (!dispatcher) + return PP_FALSE; + + PP_Bool result = PP_FALSE; + dispatcher->Send(new PpapiHostMsg_PPBInstance_BindGraphics( INTERFACE_ID_PPB_INSTANCE, instance, device, &result)); return result; } PP_Bool IsFullFrame(PP_Instance instance) { - PP_Bool result; - PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBInstance_IsFullFrame( + PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); + if (!dispatcher) + return PP_FALSE; + + PP_Bool result = PP_FALSE; + dispatcher->Send(new PpapiHostMsg_PPBInstance_IsFullFrame( INTERFACE_ID_PPB_INSTANCE, instance, &result)); return result; } PP_Var ExecuteScript(PP_Instance instance, PP_Var script, PP_Var* exception) { - Dispatcher* dispatcher = PluginDispatcher::Get(); + PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); + if (!dispatcher) + return PP_MakeUndefined(); + ReceiveSerializedException se(dispatcher, exception); if (se.IsThrown()) return PP_MakeUndefined(); |