summaryrefslogtreecommitdiffstats
path: root/webkit/glue/plugins
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 01:01:01 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 01:01:01 +0000
commit5fd5d03c6cfad79ea403b4921dd84da5e01f4939 (patch)
tree045a6c917c81cd5be898d4e69fa2eeed88356667 /webkit/glue/plugins
parent2ef25de7b8d13f84bbc42d71a5dc231c5edf448a (diff)
downloadchromium_src-5fd5d03c6cfad79ea403b4921dd84da5e01f4939.zip
chromium_src-5fd5d03c6cfad79ea403b4921dd84da5e01f4939.tar.gz
chromium_src-5fd5d03c6cfad79ea403b4921dd84da5e01f4939.tar.bz2
Don't call NPP_SetWindow on plugins that return an error from NPP_New
BUG=64234 TEST=None Review URL: http://codereview.chromium.org/5258005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67635 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins')
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl.cc7
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl.h3
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl_gtk.cc3
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl_mac.mm3
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl_win.cc3
5 files changed, 13 insertions, 6 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl.cc b/webkit/glue/plugins/webplugin_delegate_impl.cc
index 6907c6f..e3e4f9d 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl.cc
+++ b/webkit/glue/plugins/webplugin_delegate_impl.cc
@@ -86,9 +86,9 @@ bool WebPluginDelegateImpl::Initialize(
argc++;
}
- bool start_result = instance_->Start(
+ creation_succeeded_ = instance_->Start(
url, argn.get(), argv.get(), argc, load_manually);
- if (!start_result)
+ if (!creation_succeeded_)
return false;
windowless_ = instance_->windowless();
@@ -120,7 +120,8 @@ void WebPluginDelegateImpl::DestroyInstance() {
instance_->CloseStreams();
window_.window = NULL;
- if (!(quirks_ & PLUGIN_QUIRK_DONT_SET_NULL_WINDOW_HANDLE_ON_DESTROY)) {
+ if (creation_succeeded_ &&
+ !(quirks_ & PLUGIN_QUIRK_DONT_SET_NULL_WINDOW_HANDLE_ON_DESTROY)) {
instance_->NPP_SetWindow(&window_);
}
diff --git a/webkit/glue/plugins/webplugin_delegate_impl.h b/webkit/glue/plugins/webplugin_delegate_impl.h
index 30a4a58..4046c95 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl.h
+++ b/webkit/glue/plugins/webplugin_delegate_impl.h
@@ -502,6 +502,9 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate {
// https://bugs.webkit.org/show_bug.cgi?id=46013 for details.
bool containing_view_has_focus_;
+ // True if NPP_New did not return an error.
+ bool creation_succeeded_;
+
DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl);
};
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc
index bceda0e..609b41e 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc
+++ b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc
@@ -55,7 +55,8 @@ WebPluginDelegateImpl::WebPluginDelegateImpl(
first_set_window_call_(true),
plugin_has_focus_(false),
has_webkit_focus_(false),
- containing_view_has_focus_(true) {
+ containing_view_has_focus_(true),
+ creation_succeeded_(false) {
memset(&window_, 0, sizeof(window_));
if (instance_->mime_type() == "application/x-shockwave-flash") {
// Flash is tied to Firefox's whacky behavior with windowless plugins. See
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
index 7b0cb7a..552484a 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
+++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
@@ -270,7 +270,8 @@ WebPluginDelegateImpl::WebPluginDelegateImpl(
first_set_window_call_(true),
plugin_has_focus_(false),
has_webkit_focus_(false),
- containing_view_has_focus_(true) {
+ containing_view_has_focus_(true),
+ creation_succeeded_(false) {
memset(&window_, 0, sizeof(window_));
#ifndef NP_NO_CARBON
memset(&np_cg_context_, 0, sizeof(np_cg_context_));
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_win.cc b/webkit/glue/plugins/webplugin_delegate_impl_win.cc
index da7a68f..e1acba1 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl_win.cc
+++ b/webkit/glue/plugins/webplugin_delegate_impl_win.cc
@@ -270,7 +270,8 @@ WebPluginDelegateImpl::WebPluginDelegateImpl(
first_set_window_call_(true),
plugin_has_focus_(false),
has_webkit_focus_(false),
- containing_view_has_focus_(true) {
+ containing_view_has_focus_(true),
+ creation_succeeded_(false) {
memset(&window_, 0, sizeof(window_));
const WebPluginInfo& plugin_info = instance_->plugin_lib()->plugin_info();