summaryrefslogtreecommitdiffstats
path: root/webkit/glue/plugins
diff options
context:
space:
mode:
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();