summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
authoramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-03 17:33:29 +0000
committeramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-03 17:33:29 +0000
commit2c41ad7b7986fdec304ffa3d42ab4bc162bb89e0 (patch)
treeff3b26607ba232878732ac1e597b254cad7ccefb /chrome/plugin
parent71a329c66080f1c095afc642eef5fe10160dc125 (diff)
downloadchromium_src-2c41ad7b7986fdec304ffa3d42ab4bc162bb89e0.zip
chromium_src-2c41ad7b7986fdec304ffa3d42ab4bc162bb89e0.tar.gz
chromium_src-2c41ad7b7986fdec304ffa3d42ab4bc162bb89e0.tar.bz2
Fix browser hang due to plugin deadlock
This involves two plugin instances with second instance making sync calls to the renderer while the first one is still servicing an incoming sync request. Our logic to unblock the renderer during the sync call fails since the 'in_dispatch_' counter is maintained per plugin channel (each plugin instance uses its own separate channel). Making 'in_dispatch_' counter static member of PluginChannelBase fixes this deadlock. Added a new NPAPI UI test for this scenario. BUG=12624 TEST=MultipleInstancesSyncCalls Review URL: http://codereview.chromium.org/119052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17492 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r--chrome/plugin/plugin_channel_base.cc3
-rw-r--r--chrome/plugin/plugin_channel_base.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/chrome/plugin/plugin_channel_base.cc b/chrome/plugin/plugin_channel_base.cc
index 3a4a958..bdc04b7 100644
--- a/chrome/plugin/plugin_channel_base.cc
+++ b/chrome/plugin/plugin_channel_base.cc
@@ -47,13 +47,14 @@ PluginChannelBase::PluginChannelBase()
peer_pid_(0),
in_remove_route_(false),
channel_valid_(false),
- in_dispatch_(0),
send_unblocking_only_during_dispatch_(false) {
}
PluginChannelBase::~PluginChannelBase() {
}
+int PluginChannelBase::in_dispatch_ = 0;
+
void PluginChannelBase::CleanupChannels() {
// Make a copy of the references as we can't iterate the map since items will
// be removed from it as we clean them up.
diff --git a/chrome/plugin/plugin_channel_base.h b/chrome/plugin/plugin_channel_base.h
index 70a9c30..c0f357c 100644
--- a/chrome/plugin/plugin_channel_base.h
+++ b/chrome/plugin/plugin_channel_base.h
@@ -110,7 +110,7 @@ class PluginChannelBase : public IPC::Channel::Listener,
// Track whether we're within a dispatch; works like a refcount, 0 when we're
// not.
- int in_dispatch_;
+ static int in_dispatch_;
// If true, sync messages will only be marked as unblocking if the channel is
// in the middle of dispatching a message.