Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2246)

Unified Diff: content/renderer/webplugin_delegate_proxy.cc

Issue 7696016: Remove the window script object tear-down special-case. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/plugin/npobject_stub.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/webplugin_delegate_proxy.cc
diff --git a/content/renderer/webplugin_delegate_proxy.cc b/content/renderer/webplugin_delegate_proxy.cc
index 8ffd930143ae6fe77721eebda0fcc09d5ad12cd2..e26129b07a0aeaf7e5c184e2b8d2cc6ce34e9670 100644
--- a/content/renderer/webplugin_delegate_proxy.cc
+++ b/content/renderer/webplugin_delegate_proxy.cc
@@ -219,12 +219,13 @@ void WebPluginDelegateProxy::PluginDestroyed() {
}
if (window_script_object_) {
- // The ScriptController deallocates this object independent of its ref count
- // to avoid leaks if the plugin forgets to release it. So mark the object
- // invalid to avoid accessing it past this point. Note: only do this after
- // the DestroyInstance message in case the window object is scripted by the
- // plugin in NPP_Destroy.
- window_script_object_->DeleteSoon(false);
+ // Release the window script object, if the plugin didn't already.
+ // If we don't do this then it will linger until the last plugin instance is
+ // destroyed. In the meantime, though, the frame that it refers to may have
+ // been destroyed by WebKit, at which point WebKit will forcibly deallocate
+ // the window script object. The window script object stub is unique to the
+ // plugin instance, so this won't affect other instances.
+ window_script_object_->DeleteSoon();
}
plugin_ = NULL;
« no previous file with comments | « content/plugin/npobject_stub.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698