diff options
author | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 23:40:08 +0000 |
---|---|---|
committer | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 23:40:08 +0000 |
commit | db99c1b50a8b39899e425a4860cfa03348a68795 (patch) | |
tree | 6b707ab8c46a31bc3a4e4b7683c2bccc9bc22aa7 /chrome/renderer | |
parent | e12ee230a5555a8833051ac5a55c8e4a5d2b48ed (diff) | |
download | chromium_src-db99c1b50a8b39899e425a4860cfa03348a68795.zip chromium_src-db99c1b50a8b39899e425a4860cfa03348a68795.tar.gz chromium_src-db99c1b50a8b39899e425a4860cfa03348a68795.tar.bz2 |
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
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/webplugin_delegate_proxy.cc | 7 |
1 files changed, 7 insertions, 0 deletions
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); |