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

Unified Diff: content/renderer/npapi/webplugin_delegate_proxy.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_delegate_proxy.cc
diff --git a/content/renderer/npapi/webplugin_delegate_proxy.cc b/content/renderer/npapi/webplugin_delegate_proxy.cc
index 8f43e6bea66c373cb4d443b90e9a6043a7ebd98e..9e2ac408a0a1c3c495614f71676430e855397dfb 100644
--- a/content/renderer/npapi/webplugin_delegate_proxy.cc
+++ b/content/renderer/npapi/webplugin_delegate_proxy.cc
@@ -24,9 +24,6 @@
#include "cc/resources/shared_bitmap.h"
#include "content/child/child_process.h"
#include "content/child/child_shared_bitmap_manager.h"
-#include "content/child/npapi/npobject_proxy.h"
-#include "content/child/npapi/npobject_stub.h"
-#include "content/child/npapi/npobject_util.h"
#include "content/child/npapi/webplugin_resource_client.h"
#include "content/child/plugin_messages.h"
#include "content/common/content_constants_internal.h"
@@ -44,7 +41,6 @@
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/public/platform/WebDragData.h"
#include "third_party/WebKit/public/platform/WebString.h"
-#include "third_party/WebKit/public/web/WebBindings.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "third_party/WebKit/public/web/WebView.h"
@@ -63,7 +59,6 @@
#include "content/public/common/sandbox_init.h"
#endif
-using blink::WebBindings;
using blink::WebCursorInfo;
using blink::WebDragData;
using blink::WebInputEvent;
@@ -188,8 +183,6 @@ WebPluginDelegateProxy::WebPluginDelegateProxy(
window_(gfx::kNullPluginWindow),
mime_type_(mime_type),
instance_id_(MSG_ROUTING_NONE),
- npobject_(NULL),
- npp_(new NPP_t),
sad_plugin_(NULL),
invalidate_pending_(false),
transparent_(false),
@@ -198,8 +191,6 @@ WebPluginDelegateProxy::WebPluginDelegateProxy(
}
WebPluginDelegateProxy::~WebPluginDelegateProxy() {
- if (npobject_)
- WebBindings::releaseObject(npobject_);
}
WebPluginDelegateProxy::SharedBitmap::SharedBitmap() {}
@@ -235,10 +226,6 @@ void WebPluginDelegateProxy::PluginDestroyed() {
// being told the channel went away if this was the last instance.
channel_host_->RemoveRoute(instance_id_);
- // Remove the mapping between our instance-Id and NPP identifiers, used by
- // the channel to track object ownership, before releasing it.
- channel_host_->RemoveMappingForNPObjectOwner(instance_id_);
-
// Release the channel host now. If we are is the last reference to the
// channel, this avoids a race where this renderer asks a new connection to
// the same plugin between now and the time 'this' is actually deleted.
@@ -331,11 +318,7 @@ bool WebPluginDelegateProxy::Initialize(
channel_host_ = channel_host;
instance_id_ = instance_id;
- channel_host_->AddRoute(instance_id_, this, NULL);
-
- // Inform the channel of the mapping between our instance-Id and dummy NPP
- // identifier, for use in object ownership tracking.
- channel_host_->AddMappingForNPObjectOwner(instance_id_, GetPluginNPP());
+ channel_host_->AddRoute(instance_id_, this);
// Now tell the PluginInstance in the plugin process to initialize.
PluginMsg_Init_Params params;
@@ -375,9 +358,6 @@ bool WebPluginDelegateProxy::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindow, OnSetWindow)
IPC_MESSAGE_HANDLER(PluginHostMsg_CancelResource, OnCancelResource)
IPC_MESSAGE_HANDLER(PluginHostMsg_InvalidateRect, OnInvalidateRect)
- IPC_MESSAGE_HANDLER(PluginHostMsg_GetWindowScriptNPObject,
- OnGetWindowScriptNPObject)
- IPC_MESSAGE_HANDLER(PluginHostMsg_GetPluginElement, OnGetPluginElement)
IPC_MESSAGE_HANDLER(PluginHostMsg_ResolveProxy, OnResolveProxy)
IPC_MESSAGE_HANDLER(PluginHostMsg_SetCookie, OnSetCookie)
IPC_MESSAGE_HANDLER(PluginHostMsg_GetCookies, OnGetCookies)
@@ -651,32 +631,6 @@ void WebPluginDelegateProxy::Paint(SkCanvas* canvas,
}
}
-NPObject* WebPluginDelegateProxy::GetPluginScriptableObject() {
- if (npobject_)
- return WebBindings::retainObject(npobject_);
-
- if (!channel_host_.get())
- return NULL;
-
- int route_id = MSG_ROUTING_NONE;
- Send(new PluginMsg_GetPluginScriptableObject(instance_id_, &route_id));
- if (route_id == MSG_ROUTING_NONE)
- return NULL;
-
- if (!channel_host_.get())
- return nullptr;
-
- npobject_ = NPObjectProxy::Create(
- channel_host_.get(), route_id, 0, page_url_, GetPluginNPP());
-
- return WebBindings::retainObject(npobject_);
-}
-
-NPP WebPluginDelegateProxy::GetPluginNPP() {
- // Return a dummy NPP for WebKit to use to identify this plugin.
- return npp_.get();
-}
-
bool WebPluginDelegateProxy::GetFormValue(base::string16* value) {
bool success = false;
Send(new PluginMsg_GetFormValue(instance_id_, value, &success));
@@ -884,43 +838,12 @@ void WebPluginDelegateProxy::OnInvalidateRect(const gfx::Rect& rect) {
plugin_->InvalidateRect(clipped_rect);
}
-void WebPluginDelegateProxy::OnGetWindowScriptNPObject(
- int route_id, bool* success) {
- *success = false;
- NPObject* npobject = NULL;
- if (plugin_)
- npobject = plugin_->GetWindowScriptNPObject();
-
- if (!npobject)
- return;
-
- // The stub will delete itself when the proxy tells it that it's released, or
- // otherwise when the channel is closed.
- new NPObjectStub(npobject, channel_host_.get(), route_id, 0, page_url_);
- *success = true;
-}
-
void WebPluginDelegateProxy::OnResolveProxy(const GURL& url,
bool* result,
std::string* proxy_list) {
*result = RenderThreadImpl::current()->ResolveProxy(url, proxy_list);
}
-void WebPluginDelegateProxy::OnGetPluginElement(int route_id, bool* success) {
- *success = false;
- NPObject* npobject = NULL;
- if (plugin_)
- npobject = plugin_->GetPluginElement();
- if (!npobject)
- return;
-
- // The stub will delete itself when the proxy tells it that it's released, or
- // otherwise when the channel is closed.
- new NPObjectStub(
- npobject, channel_host_.get(), route_id, 0, page_url_);
- *success = true;
-}
-
void WebPluginDelegateProxy::OnSetCookie(const GURL& url,
const GURL& first_party_for_cookies,
const std::string& cookie) {

Powered by Google App Engine
This is Rietveld 408576698