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

Unified Diff: content/plugin/webplugin_delegate_stub.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/plugin/webplugin_delegate_stub.cc
diff --git a/content/plugin/webplugin_delegate_stub.cc b/content/plugin/webplugin_delegate_stub.cc
index ba53302e7a017a3051b345c176e7563702d890dd..b0f138a6c8d4c5388e883f299db118bef532ccb3 100644
--- a/content/plugin/webplugin_delegate_stub.cc
+++ b/content/plugin/webplugin_delegate_stub.cc
@@ -21,24 +21,16 @@
#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
#include "third_party/WebKit/public/platform/WebCursorInfo.h"
-#include "third_party/WebKit/public/web/WebBindings.h"
#include "third_party/npapi/bindings/npapi.h"
#include "third_party/npapi/bindings/npruntime.h"
-using blink::WebBindings;
using blink::WebCursorInfo;
namespace content {
static void DestroyWebPluginAndDelegate(
- base::WeakPtr<NPObjectStub> scriptable_object,
WebPluginDelegateImpl* delegate,
WebPlugin* webplugin) {
- // The plugin may not expect us to try to release the scriptable object
- // after calling NPP_Destroy on the instance, so delete the stub now.
- if (scriptable_object.get())
- scriptable_object->DeleteSoon();
-
if (delegate)
delegate->PluginDestroyed();
@@ -66,18 +58,12 @@ WebPluginDelegateStub::~WebPluginDelegateStub() {
base::MessageLoop::current()->PostNonNestableTask(
FROM_HERE,
base::Bind(&DestroyWebPluginAndDelegate,
- plugin_scriptable_object_,
delegate_,
webplugin_));
} else {
// Safe to delete right away.
- DestroyWebPluginAndDelegate(
- plugin_scriptable_object_, delegate_, webplugin_);
+ DestroyWebPluginAndDelegate(delegate_, webplugin_);
}
-
- // Remove the NPObject owner mapping for this instance.
- if (delegate_)
- channel_->RemoveMappingForNPObjectOwner(instance_id_);
}
bool WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) {
@@ -102,8 +88,6 @@ bool WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(PluginMsg_HandleInputEvent, OnHandleInputEvent)
IPC_MESSAGE_HANDLER(PluginMsg_Paint, OnPaint)
IPC_MESSAGE_HANDLER(PluginMsg_DidPaint, OnDidPaint)
- IPC_MESSAGE_HANDLER(PluginMsg_GetPluginScriptableObject,
- OnGetPluginScriptableObject)
IPC_MESSAGE_HANDLER(PluginMsg_GetFormValue, OnGetFormValue)
IPC_MESSAGE_HANDLER(PluginMsg_UpdateGeometry, OnUpdateGeometry)
IPC_MESSAGE_HANDLER(PluginMsg_UpdateGeometrySync, OnUpdateGeometry)
@@ -169,11 +153,6 @@ void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params,
std::vector<std::string> arg_names = params.arg_names;
std::vector<std::string> arg_values = params.arg_values;
- // Add an NPObject owner mapping for this instance, to support ownership
- // tracking in the renderer.
- channel_->AddMappingForNPObjectOwner(instance_id_,
- delegate_->GetPluginNPP());
-
*result = delegate_->Initialize(params.url,
arg_names,
arg_values,
@@ -264,26 +243,6 @@ void WebPluginDelegateStub::OnUpdateGeometry(
param.windowless_buffer_index);
}
-void WebPluginDelegateStub::OnGetPluginScriptableObject(int* route_id) {
- NPObject* object = delegate_->GetPluginScriptableObject();
- if (!object) {
- *route_id = MSG_ROUTING_NONE;
- return;
- }
-
- *route_id = channel_->GenerateRouteID();
- // We will delete the stub immediately before calling PluginDestroyed on the
- // delegate. It will delete itself sooner if the proxy tells it that it has
- // been released, or if the channel to the proxy is closed.
- NPObjectStub* scriptable_stub = new NPObjectStub(
- object, channel_.get(), *route_id,
- webplugin_->host_render_view_routing_id(), page_url_);
- plugin_scriptable_object_ = scriptable_stub->AsWeakPtr();
-
- // Release ref added by GetPluginScriptableObject (our stub holds its own).
- WebBindings::releaseObject(object);
-}
-
void WebPluginDelegateStub::OnGetFormValue(base::string16* value,
bool* success) {
*success = false;

Powered by Google App Engine
This is Rietveld 408576698