diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/plugin/plugin_channel.cc | 4 | ||||
-rw-r--r-- | chrome/plugin/plugin_channel_base.cc | 15 | ||||
-rw-r--r-- | chrome/plugin/plugin_channel_base.h | 2 | ||||
-rw-r--r-- | chrome/test/data/npapi/npn_plugin_delete_create_in_evaluate.html | 40 | ||||
-rw-r--r-- | chrome/test/ui/npapi_uitest.cc | 14 |
5 files changed, 7 insertions, 68 deletions
diff --git a/chrome/plugin/plugin_channel.cc b/chrome/plugin/plugin_channel.cc index 941db8c..2ea37be 100644 --- a/chrome/plugin/plugin_channel.cc +++ b/chrome/plugin/plugin_channel.cc @@ -136,12 +136,12 @@ class PluginChannel::MessageFilter : public IPC::ChannelProxy::MessageFilter { PluginChannel* PluginChannel::GetPluginChannel(int renderer_id, MessageLoop* ipc_message_loop) { // Map renderer ID to a (single) channel to that process. - std::string channel_key = StringPrintf( + std::string channel_name = StringPrintf( "%d.r%d", base::GetCurrentProcId(), renderer_id); PluginChannel* channel = static_cast<PluginChannel*>(PluginChannelBase::GetChannel( - channel_key, + channel_name, IPC::Channel::MODE_SERVER, ClassFactory, ipc_message_loop, diff --git a/chrome/plugin/plugin_channel_base.cc b/chrome/plugin/plugin_channel_base.cc index df7cccc..5d18654 100644 --- a/chrome/plugin/plugin_channel_base.cc +++ b/chrome/plugin/plugin_channel_base.cc @@ -9,7 +9,6 @@ #include "base/auto_reset.h" #include "base/hash_tables.h" #include "base/lazy_instance.h" -#include "base/string_number_conversions.h" #include "chrome/common/child_process.h" #include "ipc/ipc_sync_message.h" @@ -25,15 +24,13 @@ static PluginChannelMap g_plugin_channels_; static base::LazyInstance<std::stack<scoped_refptr<PluginChannelBase> > > lazy_plugin_channel_stack_(base::LINKER_INITIALIZED); -static int next_pipe_id = 0; - PluginChannelBase* PluginChannelBase::GetChannel( - const std::string& channel_key, IPC::Channel::Mode mode, + const std::string& channel_name, IPC::Channel::Mode mode, PluginChannelFactory factory, MessageLoop* ipc_message_loop, bool create_pipe_now) { scoped_refptr<PluginChannelBase> channel; - PluginChannelMap::const_iterator iter = g_plugin_channels_.find(channel_key); + PluginChannelMap::const_iterator iter = g_plugin_channels_.find(channel_name); if (iter == g_plugin_channels_.end()) { channel = factory(); } else { @@ -43,14 +40,10 @@ PluginChannelBase* PluginChannelBase::GetChannel( DCHECK(channel != NULL); if (!channel->channel_valid()) { - channel->channel_name_ = channel_key; - if (mode == IPC::Channel::MODE_SERVER) { - channel->channel_name_.append("."); - channel->channel_name_.append(base::IntToString(next_pipe_id++)); - } + channel->channel_name_ = channel_name; channel->mode_ = mode; if (channel->Init(ipc_message_loop, create_pipe_now)) { - g_plugin_channels_[channel_key] = channel; + g_plugin_channels_[channel_name] = channel; } else { channel = NULL; } diff --git a/chrome/plugin/plugin_channel_base.h b/chrome/plugin/plugin_channel_base.h index 3924c07..026c06f 100644 --- a/chrome/plugin/plugin_channel_base.h +++ b/chrome/plugin/plugin_channel_base.h @@ -74,7 +74,7 @@ class PluginChannelBase : public IPC::Channel::Listener, // must still ref count the returned value. When there are no more routes // on the channel and its ref count is 0, the object deletes itself. static PluginChannelBase* GetChannel( - const std::string& channel_key, IPC::Channel::Mode mode, + const std::string& channel_name, IPC::Channel::Mode mode, PluginChannelFactory factory, MessageLoop* ipc_message_loop, bool create_pipe_now); diff --git a/chrome/test/data/npapi/npn_plugin_delete_create_in_evaluate.html b/chrome/test/data/npapi/npn_plugin_delete_create_in_evaluate.html deleted file mode 100644 index 12f0e4d..0000000 --- a/chrome/test/data/npapi/npn_plugin_delete_create_in_evaluate.html +++ /dev/null @@ -1,40 +0,0 @@ -<html> -<head> -<script src="npapi.js"></script> -<script> -
- function DeletePluginWithinScript() { - var plugin_div = document.getElementById("PluginDiv");
- var html = plugin_div.innerHTML;
- html = html.replace("npobject_delete_create_plugin_in_evaluate",
- "invoke_js_function_on_create");
- plugin_div.innerHTML = "Object Deleted";
- plugin_div.innerHTML = html;
- } - - function PluginCreated() { - onSuccess("npobject_delete_create_plugin_in_evaluate", 1); - } - -</script> -</head> - -<body> -<div id="statusPanel" style="border: 1px solid red; width: 100%"> -Test running.... -</div> - -Tests the case where a plugin instance is deleted and created in the context -of the NPN_Evaluate call. - -<DIV ID=PluginDiv> -<embed type="application/vnd.npapi-test" - src="foo" - name="npobject_delete_create_plugin_in_evaluate" - id="1" - mode="np_embed" -> -</DIV> - -</body> -</html> diff --git a/chrome/test/ui/npapi_uitest.cc b/chrome/test/ui/npapi_uitest.cc index 8a2b50a..07970e8 100644 --- a/chrome/test/ui/npapi_uitest.cc +++ b/chrome/test/ui/npapi_uitest.cc @@ -219,20 +219,6 @@ TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInNPNEvaluate) { kTestCompleteCookie, kTestCompleteSuccess, action_max_timeout_ms()); } - -TEST_F(NPAPIVisiblePluginTester, SelfDeleteCreatePluginInNPNEvaluate) { - if (UITest::in_process_renderer()) - return; - - const FilePath test_case( - FILE_PATH_LITERAL("npn_plugin_delete_create_in_evaluate.html")); - GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); - ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); - WaitForFinish("npobject_delete_create_plugin_in_evaluate", "1", url, - kTestCompleteCookie, kTestCompleteSuccess, - action_max_timeout_ms()); -} - #endif // Flaky. See http://crbug.com/17645 |