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

Unified Diff: content/renderer/npapi/webplugin_impl.cc

Issue 1483733002: Remove support for NPObjects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years 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
Index: content/renderer/npapi/webplugin_impl.cc
diff --git a/content/renderer/npapi/webplugin_impl.cc b/content/renderer/npapi/webplugin_impl.cc
index f5b0273fe9ae03a5c394a9d1b75a1f2f71dd158b..156a2e256429a6a9d29a811b931d5efa452e74a7 100644
--- a/content/renderer/npapi/webplugin_impl.cc
+++ b/content/renderer/npapi/webplugin_impl.cc
@@ -243,10 +243,6 @@ bool WebPluginImpl::initialize(WebPluginContainer* container) {
WebPluginDelegateProxy* plugin_delegate = new WebPluginDelegateProxy(
this, mime_type_, render_view_, render_frame_);
- // 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.
@@ -287,17 +283,6 @@ void WebPluginImpl::destroy() {
base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
}
-NPObject* WebPluginImpl::scriptableObject() {
- if (!delegate_)
- return NULL;
-
- return delegate_->GetPluginScriptableObject();
-}
-
-NPP WebPluginImpl::pluginNPP() {
- return npp_;
-}
-
bool WebPluginImpl::getFormValue(blink::WebString& value) {
if (!delegate_)
return false;
@@ -488,7 +473,6 @@ WebPluginImpl::WebPluginImpl(
webframe_(webframe),
delegate_(NULL),
container_(NULL),
- npp_(NULL),
plugin_url_(params.url),
load_manually_(params.loadManually),
first_geometry_update_(true),
@@ -698,18 +682,6 @@ WebPluginImpl::RoutingStatus WebPluginImpl::RouteToFrame(
return ROUTED;
}
-NPObject* WebPluginImpl::GetWindowScriptNPObject() {
- if (!webframe_) {
- NOTREACHED();
- return NULL;
- }
- return webframe_->windowObject();
-}
-
-NPObject* WebPluginImpl::GetPluginElement() {
- return container_->scriptableObjectForElement();
-}
-
bool WebPluginImpl::FindProxyForUrl(const GURL& url, std::string* proxy_list) {
// Proxy resolving doesn't work in single-process mode.
return false;
@@ -1020,8 +992,6 @@ void WebPluginImpl::SetContainer(WebPluginContainer* container) {
if (!container)
TearDownPluginInstance(NULL);
container_ = container;
- if (container_)
- container_->allowScriptObjects();
}
unsigned long WebPluginImpl::GetNextResourceId() {
@@ -1128,17 +1098,10 @@ bool WebPluginImpl::ReinitializePluginForResponse(
WebPluginDelegateProxy* plugin_delegate = new WebPluginDelegateProxy(
this, mime_type_, render_view_, render_frame_);
- // Store the plugin's unique identifier, used by the container to track its
- // script objects, and enable script objects (since Initialize may use them
- // even if it fails).
- npp_ = plugin_delegate->GetPluginNPP();
- container_->allowScriptObjects();
-
bool ok = plugin_delegate && plugin_delegate->Initialize(
plugin_url_, arg_names_, arg_values_, load_manually_);
if (!ok) {
- container_->clearScriptObjects();
container_ = NULL;
// TODO(iyengar) Should we delete the current plugin instance here?
return false;
@@ -1167,7 +1130,6 @@ void WebPluginImpl::TearDownPluginInstance(
// us invalidate them, releasing the references to them held by the JavaScript
// runtime.
if (container_) {
- container_->clearScriptObjects();
container_->setWebLayer(NULL);
}
@@ -1177,14 +1139,9 @@ void WebPluginImpl::TearDownPluginInstance(
// 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();
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

Powered by Google App Engine
This is Rietveld 408576698