summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/npapi
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-27 05:46:22 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-27 05:46:22 +0000
commit4bc2d022d22a0bbd20e48cb7d91cbabc7972a11c (patch)
tree91a6fe68714a29291f933babb489e6a732ae68ca /webkit/plugins/npapi
parent97cc1774d5cf2590588187f886e306ebacf2870f (diff)
downloadchromium_src-4bc2d022d22a0bbd20e48cb7d91cbabc7972a11c.zip
chromium_src-4bc2d022d22a0bbd20e48cb7d91cbabc7972a11c.tar.gz
chromium_src-4bc2d022d22a0bbd20e48cb7d91cbabc7972a11c.tar.bz2
Revert 202364 "Track NPObject ownership by the originating plugi..."
Suspected to have broken ClickToPlayPluginTest.NoCallbackAtLoad > Track NPObject ownership by the originating plugins' NPP identifier. [2/3] (Chrome) > > This CL updates Chrome to return plugin NPP identifiers for NPAPI, PPAPI and browser plugins, and to make the necessary calls into Blink to support object ownership tracking. > > This CL requires Blink CL crrev.com/14989014, and is itself required by Blink CL crrev.com/14019005. > > BUG=152006 > > Review URL: https://chromiumcodereview.appspot.com/15007012 TBR=wez@chromium.org Review URL: https://codereview.chromium.org/15757007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202369 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/npapi')
-rw-r--r--webkit/plugins/npapi/webplugin_delegate.h3
-rw-r--r--webkit/plugins/npapi/webplugin_delegate_impl.cc4
-rw-r--r--webkit/plugins/npapi/webplugin_delegate_impl.h1
-rw-r--r--webkit/plugins/npapi/webplugin_impl.cc39
-rw-r--r--webkit/plugins/npapi/webplugin_impl.h4
5 files changed, 7 insertions, 44 deletions
diff --git a/webkit/plugins/npapi/webplugin_delegate.h b/webkit/plugins/npapi/webplugin_delegate.h
index 9f7fe0e..43a3955 100644
--- a/webkit/plugins/npapi/webplugin_delegate.h
+++ b/webkit/plugins/npapi/webplugin_delegate.h
@@ -83,9 +83,6 @@ class WEBKIT_PLUGINS_EXPORT WebPluginDelegate {
// Gets the NPObject associated with the plugin for scripting.
virtual NPObject* GetPluginScriptableObject() = 0;
- // Gets the NPP instance uniquely identifying the plugin for its lifetime.
- virtual struct _NPP* GetPluginNPP() = 0;
-
// Gets the form value associated with the plugin instance.
// Returns false if the value is not available.
virtual bool GetFormValue(base::string16* value) = 0;
diff --git a/webkit/plugins/npapi/webplugin_delegate_impl.cc b/webkit/plugins/npapi/webplugin_delegate_impl.cc
index 831de3d..3c2587e9 100644
--- a/webkit/plugins/npapi/webplugin_delegate_impl.cc
+++ b/webkit/plugins/npapi/webplugin_delegate_impl.cc
@@ -186,10 +186,6 @@ NPObject* WebPluginDelegateImpl::GetPluginScriptableObject() {
return instance_->GetPluginScriptableObject();
}
-NPP WebPluginDelegateImpl::GetPluginNPP() {
- return instance_->npp();
-}
-
bool WebPluginDelegateImpl::GetFormValue(base::string16* value) {
return instance_->GetFormValue(value);
}
diff --git a/webkit/plugins/npapi/webplugin_delegate_impl.h b/webkit/plugins/npapi/webplugin_delegate_impl.h
index 0101de7..6755891 100644
--- a/webkit/plugins/npapi/webplugin_delegate_impl.h
+++ b/webkit/plugins/npapi/webplugin_delegate_impl.h
@@ -112,7 +112,6 @@ class WEBKIT_PLUGINS_EXPORT WebPluginDelegateImpl : public WebPluginDelegate {
virtual bool HandleInputEvent(const WebKit::WebInputEvent& event,
WebCursor::CursorInfo* cursor_info) OVERRIDE;
virtual NPObject* GetPluginScriptableObject() OVERRIDE;
- virtual NPP GetPluginNPP() OVERRIDE;
virtual bool GetFormValue(base::string16* value) OVERRIDE;
virtual void DidFinishLoadWithReason(const GURL& url,
NPReason reason,
diff --git a/webkit/plugins/npapi/webplugin_impl.cc b/webkit/plugins/npapi/webplugin_impl.cc
index e86f3d1..801ca91 100644
--- a/webkit/plugins/npapi/webplugin_impl.cc
+++ b/webkit/plugins/npapi/webplugin_impl.cc
@@ -243,15 +243,10 @@ bool WebPluginImpl::initialize(WebPluginContainer* container) {
if (!plugin_delegate)
return false;
- // Store the plugin's unique identifier, used by the container to track its
- // script objects.
- npp_ = plugin_delegate->GetPluginNPP();
-
// Set the container before Initialize because the plugin may
- // synchronously call NPN_GetValue to get its container, or make calls
- // passing script objects that need to be tracked, during initialization.
+ // synchronously call NPN_GetValue to get its container during its
+ // initialization.
SetContainer(container);
-
bool ok = plugin_delegate->Initialize(
plugin_url_, arg_names_, arg_values_, this, load_manually_);
if (!ok) {
@@ -285,10 +280,6 @@ NPObject* WebPluginImpl::scriptableObject() {
return delegate_->GetPluginScriptableObject();
}
-NPP WebPluginImpl::pluginNPP() {
- return npp_;
-}
-
bool WebPluginImpl::getFormValue(WebKit::WebString& value) {
if (!delegate_)
return false;
@@ -493,7 +484,6 @@ WebPluginImpl::WebPluginImpl(
webframe_(webframe),
delegate_(NULL),
container_(NULL),
- npp_(NULL),
plugin_url_(params.url),
load_manually_(params.loadManually),
first_geometry_update_(true),
@@ -1065,8 +1055,6 @@ void WebPluginImpl::SetContainer(WebPluginContainer* container) {
if (!container)
TearDownPluginInstance(NULL);
container_ = container;
- if (container_)
- container_->allowScriptObjects();
}
void WebPluginImpl::HandleURLRequest(const char* url,
@@ -1345,32 +1333,19 @@ bool WebPluginImpl::ReinitializePluginForResponse(
void WebPluginImpl::TearDownPluginInstance(
WebURLLoader* loader_to_ignore) {
- // JavaScript garbage collection may cause plugin script object references to
- // be retained long after the plugin is destroyed. Some plugins won't cope
- // with their objects being released after they've been destroyed, and once
- // we've actually unloaded the plugin the object's releaseobject() code may
- // no longer be in memory. The container tracks the plugin's objects and lets
- // us invalidate them, releasing the references to them held by the JavaScript
- // runtime.
+ // The container maintains a list of JSObjects which are related to this
+ // plugin. Tell the frame we're gone so that it can invalidate all of
+ // those sub JSObjects.
if (container_) {
container_->clearScriptObjects();
container_->setWebLayer(NULL);
}
- // Call PluginDestroyed() first to prevent the plugin from calling us back
- // in the middle of tearing down the render tree.
if (delegate_) {
- // The plugin may call into the browser and pass script objects even during
- // teardown, so temporarily re-enable plugin script objects.
- DCHECK(container_);
- container_->allowScriptObjects();
-
+ // Call PluginDestroyed() first to prevent the plugin from calling us back
+ // in the middle of tearing down the render tree.
delegate_->PluginDestroyed();
delegate_ = NULL;
-
- // Invalidate any script objects created during teardown here, before the
- // plugin might actually be unloaded.
- container_->clearScriptObjects();
}
// Cancel any pending requests because otherwise this deleted object will
diff --git a/webkit/plugins/npapi/webplugin_impl.h b/webkit/plugins/npapi/webplugin_impl.h
index 7b6594b..20917d0 100644
--- a/webkit/plugins/npapi/webplugin_impl.h
+++ b/webkit/plugins/npapi/webplugin_impl.h
@@ -75,7 +75,6 @@ class WEBKIT_PLUGINS_EXPORT WebPluginImpl :
WebKit::WebPluginContainer* container);
virtual void destroy();
virtual NPObject* scriptableObject();
- virtual struct _NPP* pluginNPP();
virtual bool getFormValue(WebKit::WebString& value);
virtual void paint(
WebKit::WebCanvas* canvas, const WebKit::WebRect& paint_rect);
@@ -293,9 +292,6 @@ class WEBKIT_PLUGINS_EXPORT WebPluginImpl :
// This is just a weak reference.
WebKit::WebPluginContainer* container_;
- // Unique identifier for this plugin, used to track script objects.
- struct _NPP* npp_;
-
typedef std::map<WebPluginResourceClient*,
webkit_glue::MultipartResponseDelegate*>
MultiPartResponseHandlerMap;