diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-25 20:05:45 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-25 20:05:45 +0000 |
commit | eab113f82537b904c52912663d625cb6afefa3b0 (patch) | |
tree | 28a488f33fb0f162aa1c1e6b99f20cfc54424bce /chrome | |
parent | 5fe90ea611c57e45d82b1982e600f9d6ca142a98 (diff) | |
download | chromium_src-eab113f82537b904c52912663d625cb6afefa3b0.zip chromium_src-eab113f82537b904c52912663d625cb6afefa3b0.tar.gz chromium_src-eab113f82537b904c52912663d625cb6afefa3b0.tar.bz2 |
Revert 24266 - This CL ensures that plugins always peek in the context of outgoing sync calls.
I will be watching the reliability test runs closely for any crashes which creep in due to reentrancies into plugins caused by this CL.
This fixes bug http://code.google.com/p/chromium/issues/detail?id=15985
It is a touch tricky to implement a test case for this. Will add one hopefully in a subsequent CL
Bug=15985
Test=Covered by UI test
Review URL: http://codereview.chromium.org/173211
TBR=ananta@chromium.org
Review URL: http://codereview.chromium.org/173384
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24296 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/plugin/plugin_channel.cc | 19 | ||||
-rw-r--r-- | chrome/test/data/npapi/ensure_plugins_pump_messages_in_sync_calls.html | 39 | ||||
-rw-r--r-- | chrome/test/ui/npapi_uitest.cc | 10 |
3 files changed, 0 insertions, 68 deletions
diff --git a/chrome/plugin/plugin_channel.cc b/chrome/plugin/plugin_channel.cc index 6aa10d4..04d9afc 100644 --- a/chrome/plugin/plugin_channel.cc +++ b/chrome/plugin/plugin_channel.cc @@ -73,25 +73,6 @@ bool PluginChannel::Send(IPC::Message* msg) { LOG(INFO) << "sending message @" << msg << " on channel @" << this << " with type " << msg->type(); } - - if (msg->is_sync()) { - IPC::SyncMessage* sync_msg = static_cast<IPC::SyncMessage*>(msg); - // Clear the existing pump messages event if any in the message. This - // is because we won't be relying on this event being set to decide whether - // to pump messages or not. - sync_msg->set_pump_messages_event(NULL); - - // Signal that the channel should continue to pump messages while it waits - // for the sync call to complete. This is to ensure that the following - // scenario does not result in a deadlock. - // 1. Plugin1 issues a sync request to the renderer - // 2. The renderer then issues a sync request to plugin2. - // 3. Plugin2 then dispatches a native message to plugin1 - // If we don't pump messages from Plugin1, then it would cause a deadlock - // as the three processes above are waiting for each other. - sync_msg->EnableMessagePumping(); - } - bool result = PluginChannelBase::Send(msg); in_send_--; return result; diff --git a/chrome/test/data/npapi/ensure_plugins_pump_messages_in_sync_calls.html b/chrome/test/data/npapi/ensure_plugins_pump_messages_in_sync_calls.html deleted file mode 100644 index f840278..0000000 --- a/chrome/test/data/npapi/ensure_plugins_pump_messages_in_sync_calls.html +++ /dev/null @@ -1,39 +0,0 @@ -<html> -<head> -<title>Test for verifying if plugins pump messages in sync calls.</title> -<script src="npapi.js"></script> -<script> -function SetFocusToPlugin2() { - var plugin = window.document["plugin2"]; - plugin.resetFocus = 1; -} -</script> -</head> - -<body> -<div id="statusPanel" style="border: 1px solid red; width: 100%"> -Test running.... -</div> - -<h2>Test to verify whether plugins pump messages in sync calls.</h2> - -<p> -This test verifies whether a plugin continues to pump messages in outgoing -sync calls. This ensures that it remains responsive and does not cause -other plugins and the browser to hang -</p> - -<DIV ID=PluginDiv> -<embed type="application/vnd.npapi-test" - src="foo" - name="src_plugin_for_outgoing_sync_call" - id="1" - mode="np_embed"> -</embed> -</DIV> - -<embed name="plugin2" type="application/x-webkit-test-netscape" resetFocusWindow="1"></embed> - -</body> -</html> - diff --git a/chrome/test/ui/npapi_uitest.cc b/chrome/test/ui/npapi_uitest.cc index a4fa299..eb19042 100644 --- a/chrome/test/ui/npapi_uitest.cc +++ b/chrome/test/ui/npapi_uitest.cc @@ -298,13 +298,3 @@ TEST_F(NPAPIVisiblePluginTester, MultipleInstancesSyncCalls) { kTestCompleteSuccess, kShortWaitTimeout); } -TEST_F(NPAPIVisiblePluginTester, EnsurePluginsPumpInSyncCalls) { - if (UITest::in_process_renderer()) - return; - - GURL url = GetTestUrl(L"npapi", - L"ensure_plugins_pump_messages_in_sync_calls.html"); - NavigateToURL(url); - WaitForFinish("src_plugin_for_outgoing_sync_call", "1", url, - kTestCompleteCookie, kTestCompleteSuccess, kShortWaitTimeout); -} |