From db99c1b50a8b39899e425a4860cfa03348a68795 Mon Sep 17 00:00:00 2001 From: "piman@google.com" Date: Thu, 9 Jul 2009 23:40:08 +0000 Subject: linux/mac: Fix return status of OpenChannelToPlugin message in case of failure Currently on linux if the plugin process dies, the PluginProcessHost is not destroyed. A side effect of that is that if a renderer tries to create a new plugin, the OpenChannelToPlugin message returns success with an empty handle, which is interpreted as the host channel, to which the renderer tries to connect to a second time, causing DCHECKs and havok in the browser process. This CL fixes that particular problem, returning failure if the browser can't connect to the plugin process. Review URL: http://codereview.chromium.org/155313 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20337 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/webplugin_delegate_proxy.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'chrome/renderer') diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc index 1274d08..e07368d 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -220,6 +220,13 @@ bool WebPluginDelegateProxy::Initialize(const GURL& url, char** argn, } #if defined(OS_POSIX) + if (channel_handle.name.empty()) { + // We got an invalid handle. Possibly the plugin process is stale? In any + // case, don't try to connect to it, the empty name represents the host + // channel, and connecting to it again does bad things. + return false; + } + // If we received a ChannelHandle, register it now. if (channel_handle.socket.fd >= 0) IPC::AddChannelSocket(channel_handle.name, channel_handle.socket.fd); -- cgit v1.1