From 2c41ad7b7986fdec304ffa3d42ab4bc162bb89e0 Mon Sep 17 00:00:00 2001 From: "amit@chromium.org" Date: Wed, 3 Jun 2009 17:33:29 +0000 Subject: 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 --- .../data/npapi/multiple_instances_sync_calls.html | 38 ++++++++++++++++++++++ chrome/test/ui/npapi_uitest.cc | 13 ++++++++ 2 files changed, 51 insertions(+) create mode 100644 chrome/test/data/npapi/multiple_instances_sync_calls.html (limited to 'chrome/test') diff --git a/chrome/test/data/npapi/multiple_instances_sync_calls.html b/chrome/test/data/npapi/multiple_instances_sync_calls.html new file mode 100644 index 0000000..5658a12 --- /dev/null +++ b/chrome/test/data/npapi/multiple_instances_sync_calls.html @@ -0,0 +1,38 @@ + + + + + + +
+ Test running.... +
+ + NPObject Proxy Test

+ + Tests the case that involves two plugin instances with second + instance making sync calls to the renderer while the first one + is still servicing an incoming sync request + +

+ + +
+ + diff --git a/chrome/test/ui/npapi_uitest.cc b/chrome/test/ui/npapi_uitest.cc index 76176a9..83ea533 100644 --- a/chrome/test/ui/npapi_uitest.cc +++ b/chrome/test/ui/npapi_uitest.cc @@ -284,3 +284,16 @@ TEST_F(NPAPIIncognitoTester, PrivateEnabled) { WaitForFinish("private", "1", url, kTestCompleteCookie, kTestCompleteSuccess, kShortWaitTimeout); } + +// Test a browser hang due to special case of multiple +// plugin instances indulged in sync calls across renderer. +TEST_F(NPAPIVisiblePluginTester, MultipleInstancesSyncCalls) { + if (UITest::in_process_renderer()) + return; + + GURL url = GetTestUrl(L"npapi", L"multiple_instances_sync_calls.html"); + NavigateToURL(url); + WaitForFinish("multiple_instances_sync_calls", "1", url, kTestCompleteCookie, + kTestCompleteSuccess, kShortWaitTimeout); +} + -- cgit v1.1