diff options
-rw-r--r-- | content/plugin/webplugin_proxy.cc | 9 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin.h | 8 |
2 files changed, 12 insertions, 5 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; diff --git a/webkit/plugins/npapi/webplugin.h b/webkit/plugins/npapi/webplugin.h index 8b43eb4..986d828 100644 --- a/webkit/plugins/npapi/webplugin.h +++ b/webkit/plugins/npapi/webplugin.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -93,10 +93,12 @@ class WebPlugin { virtual void Invalidate() = 0; virtual void InvalidateRect(const gfx::Rect& rect) = 0; - // Returns the NPObject for the browser's window object. + // Returns the NPObject for the browser's window object. Does not + // take a reference. virtual NPObject* GetWindowScriptNPObject() = 0; - // Returns the DOM element that loaded the plugin. + // Returns the DOM element that loaded the plugin. Does not take a + // reference. virtual NPObject* GetPluginElement() = 0; // Cookies |