summaryrefslogtreecommitdiffstats
path: root/content/plugin
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-29 20:25:02 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-29 20:25:02 +0000
commitcf550eb097cf9200c1d8b2198a0356e227452104 (patch)
tree99351eecae2fb68db7e31516e6217a6a59ba43ac /content/plugin
parentacc6c3c34eec27debcc91d076d6b43f636895b53 (diff)
downloadchromium_src-cf550eb097cf9200c1d8b2198a0356e227452104.zip
chromium_src-cf550eb097cf9200c1d8b2198a0356e227452104.tar.gz
chromium_src-cf550eb097cf9200c1d8b2198a0356e227452104.tar.bz2
Delay owner unregistration until after plugin teardown.
This is required to support crrev.com/14019005 landing. It depends upon crrev.com/17913003. BUG=152006 Review URL: https://chromiumcodereview.appspot.com/17906003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209326 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/plugin')
-rw-r--r--content/plugin/webplugin_delegate_stub.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/content/plugin/webplugin_delegate_stub.cc b/content/plugin/webplugin_delegate_stub.cc
index f36300d..4e5a4cf 100644
--- a/content/plugin/webplugin_delegate_stub.cc
+++ b/content/plugin/webplugin_delegate_stub.cc
@@ -42,11 +42,16 @@ static void DestroyWebPluginAndDelegate(
scriptable_object->DeleteSoon();
if (delegate) {
- // Un-register the plugin instance as an object owner.
- WebBindings::unregisterObjectOwner(delegate->GetPluginNPP());
+ // Save the object owner Id so we can unregister it as a valid owner
+ // after the instance has been destroyed.
+ NPP owner = delegate->GetPluginNPP();
// WebPlugin must outlive WebPluginDelegate.
delegate->PluginDestroyed();
+
+ // PluginDestroyed can call into script, so only unregister as an object
+ // owner after that has completed.
+ WebBindings::unregisterObjectOwner(owner);
}
delete webplugin;