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

Unified Diff: ppapi/proxy/ppb_instance_proxy.cc

Issue 6282007: First pass at making the proxy handle multiple renderers. This associates the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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/ppb_image_data_proxy.cc ('k') | ppapi/proxy/ppb_pdf_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « ppapi/proxy/ppb_image_data_proxy.cc ('k') | ppapi/proxy/ppb_pdf_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698