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_cursor_control_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_core_proxy.cc ('k') | ppapi/proxy/ppb_flash_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_cursor_control_proxy.cc
===================================================================
--- ppapi/proxy/ppb_cursor_control_proxy.cc (revision 71973)
+++ ppapi/proxy/ppb_cursor_control_proxy.cc (working copy)
@@ -14,12 +14,16 @@
namespace {
PP_Bool SetCursor(PP_Instance instance_id,
- PP_CursorType_Dev type,
- PP_Resource custom_image_id,
- const PP_Point* hot_spot) {
+ PP_CursorType_Dev type,
+ PP_Resource custom_image_id,
+ const PP_Point* hot_spot) {
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id);
+ if (!dispatcher)
+ return PP_FALSE;
+
PP_Bool result = PP_FALSE;
PP_Point empty_point = { 0, 0 };
- PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBCursorControl_SetCursor(
+ dispatcher->Send(new PpapiHostMsg_PPBCursorControl_SetCursor(
INTERFACE_ID_PPB_CURSORCONTROL,
instance_id, static_cast<int32_t>(type), custom_image_id,
hot_spot ? *hot_spot : empty_point, &result));
@@ -27,29 +31,45 @@
}
PP_Bool LockCursor(PP_Instance instance_id) {
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id);
+ if (!dispatcher)
+ return PP_FALSE;
+
PP_Bool result = PP_FALSE;
- PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBCursorControl_LockCursor(
+ dispatcher->Send(new PpapiHostMsg_PPBCursorControl_LockCursor(
INTERFACE_ID_PPB_CURSORCONTROL, instance_id, &result));
return result;
}
PP_Bool UnlockCursor(PP_Instance instance_id) {
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id);
+ if (!dispatcher)
+ return PP_FALSE;
+
PP_Bool result = PP_FALSE;
- PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBCursorControl_UnlockCursor(
+ dispatcher->Send(new PpapiHostMsg_PPBCursorControl_UnlockCursor(
INTERFACE_ID_PPB_CURSORCONTROL, instance_id, &result));
return result;
}
PP_Bool HasCursorLock(PP_Instance instance_id) {
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id);
+ if (!dispatcher)
+ return PP_FALSE;
+
PP_Bool result = PP_FALSE;
- PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBCursorControl_HasCursorLock(
+ dispatcher->Send(new PpapiHostMsg_PPBCursorControl_HasCursorLock(
INTERFACE_ID_PPB_CURSORCONTROL, instance_id, &result));
return result;
}
PP_Bool CanLockCursor(PP_Instance instance_id) {
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id);
+ if (!dispatcher)
+ return PP_FALSE;
+
PP_Bool result = PP_FALSE;
- PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBCursorControl_CanLockCursor(
+ dispatcher->Send(new PpapiHostMsg_PPBCursorControl_CanLockCursor(
INTERFACE_ID_PPB_CURSORCONTROL, instance_id, &result));
return result;
}
« no previous file with comments | « ppapi/proxy/ppb_core_proxy.cc ('k') | ppapi/proxy/ppb_flash_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698