summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-02 18:15:21 +0000
committerpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-02 18:15:21 +0000
commit8a48d6cdfc0c996860576161bf25548d94ec2c5b (patch)
tree35a46f1fbacad429f42e782df8f1b43d4dd00946 /ppapi
parent9a795183f3ca8870d2f7b354eb77b2352e9cab0c (diff)
downloadchromium_src-8a48d6cdfc0c996860576161bf25548d94ec2c5b.zip
chromium_src-8a48d6cdfc0c996860576161bf25548d94ec2c5b.tar.gz
chromium_src-8a48d6cdfc0c996860576161bf25548d94ec2c5b.tar.bz2
Fix reentrancy in HandleEvent by posting a task
BUG=none TEST=pepper flash, run it and move the mouse everywhere. Review URL: http://codereview.chromium.org/6260057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73475 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/proxy/ppp_instance_proxy.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/ppapi/proxy/ppp_instance_proxy.cc b/ppapi/proxy/ppp_instance_proxy.cc
index 144e3a1..6dabe99 100644
--- a/ppapi/proxy/ppp_instance_proxy.cc
+++ b/ppapi/proxy/ppp_instance_proxy.cc
@@ -58,9 +58,15 @@ void DidChangeFocus(PP_Instance instance, PP_Bool has_focus) {
PP_Bool HandleInputEvent(PP_Instance instance,
const PP_InputEvent* event) {
PP_Bool result = PP_FALSE;
- HostDispatcher::GetForInstance(instance)->Send(
- new PpapiMsg_PPPInstance_HandleInputEvent(INTERFACE_ID_PPP_INSTANCE,
- instance, *event, &result));
+ IPC::Message* msg = new PpapiMsg_PPPInstance_HandleInputEvent(
+ INTERFACE_ID_PPP_INSTANCE, instance, *event, &result);
+ // Make this message not unblock, to avoid re-entrancy problems when the
+ // plugin does a synchronous call to the renderer. This will force any
+ // synchronous calls from the plugin to complete before processing this
+ // message. We avoid deadlock by never un-setting the unblock flag on messages
+ // from the plugin to the renderer.
+ msg->set_unblock(false);
+ HostDispatcher::GetForInstance(instance)->Send(msg);
return result;
}