From dd9ea853b5143e93c0088077962b4f3d69860edf Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Sat, 1 Oct 2011 00:19:24 +0000 Subject: Restore comments about reentrancy in the HostDispatcher::Send function BUG=none TEST=none Review URL: http://codereview.chromium.org/8095021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103598 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/proxy/host_dispatcher.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ppapi') diff --git a/ppapi/proxy/host_dispatcher.cc b/ppapi/proxy/host_dispatcher.cc index 26a1c15..91a3759 100644 --- a/ppapi/proxy/host_dispatcher.cc +++ b/ppapi/proxy/host_dispatcher.cc @@ -137,9 +137,15 @@ bool HostDispatcher::Send(IPC::Message* msg) { // Prevent the dispatcher from going away during the call. Scenarios // where this could happen include a Send for a sync message which while // waiting for the reply, dispatches an incoming ExecuteScript call which - // destroys the plugin module and in turn the dispatcher, + // destroys the plugin module and in turn the dispatcher. ScopedModuleReference ref(this); + // Normal sync messages are set to unblock, which would normally cause the + // plugin to be reentered to process them. We only want to do this when we + // know the plugin is in a state to accept reentrancy. Since the plugin side + // never clears this flag on messages it sends, we can't get deadlock, but we + // may still get reentrancy in the host as a result. + if (!allow_plugin_reentrancy_) msg->set_unblock(false); return Dispatcher::Send(msg); -- cgit v1.1