diff options
author | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-12 00:04:11 +0000 |
---|---|---|
committer | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-12 00:04:11 +0000 |
commit | 513d2813014bd25f2b356e76dc55d864aa6b2a4e (patch) | |
tree | 155e08141fb324119949b9c9b920f31076a98101 /content/plugin/webplugin_proxy.cc | |
parent | 222053a63ef6b3ae69ab9bc0d0871210cd41fa24 (diff) | |
download | chromium_src-513d2813014bd25f2b356e76dc55d864aa6b2a4e.zip chromium_src-513d2813014bd25f2b356e76dc55d864aa6b2a4e.tar.gz chromium_src-513d2813014bd25f2b356e76dc55d864aa6b2a4e.tar.bz2 |
Don't retain NPNVWindowNPObject and NPNVPluginElementNPObject twice
Both NPN_GetValue and WebPluginProxy take a reference on access, with
the latter conflating the caller's reference and its internal reference.
To be consistent with WebPluginImpl, let WebPluginProxy only manage its
internal reference and leave the plugin's reference to NPN_GetValue.
Document this in the WebPlugin interface.
Also release plugin-side proxies when WebPluginProxy is destroyed.
R=ananta
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6693052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88773 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/plugin/webplugin_proxy.cc')
-rw-r--r-- | content/plugin/webplugin_proxy.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/content/plugin/webplugin_proxy.cc b/content/plugin/webplugin_proxy.cc index 7c3025c..84d6d0d 100644 --- a/content/plugin/webplugin_proxy.cc +++ b/content/plugin/webplugin_proxy.cc @@ -94,6 +94,11 @@ WebPluginProxy::~WebPluginProxy() { if (accelerated_surface_.get()) accelerated_surface_.reset(); #endif + + if (plugin_element_) + WebBindings::releaseObject(plugin_element_); + if (window_npobject_) + WebBindings::releaseObject(window_npobject_); } bool WebPluginProxy::Send(IPC::Message* msg) { @@ -196,7 +201,7 @@ void WebPluginProxy::InvalidateRect(const gfx::Rect& rect) { NPObject* WebPluginProxy::GetWindowScriptNPObject() { if (window_npobject_) - return WebBindings::retainObject(window_npobject_); + return window_npobject_; int npobject_route_id = channel_->GenerateRouteID(); bool success = false; @@ -213,7 +218,7 @@ NPObject* WebPluginProxy::GetWindowScriptNPObject() { NPObject* WebPluginProxy::GetPluginElement() { if (plugin_element_) - return WebBindings::retainObject(plugin_element_); + return plugin_element_; int npobject_route_id = channel_->GenerateRouteID(); bool success = false; |