| Index: ppapi/proxy/ppb_instance_proxy.cc
|
| ===================================================================
|
| --- ppapi/proxy/ppb_instance_proxy.cc (revision 71973)
|
| +++ ppapi/proxy/ppb_instance_proxy.cc (working copy)
|
| @@ -16,7 +16,10 @@
|
| 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 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_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();
|
|
|