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

Unified Diff: content/plugin/npobject_stub.cc

Issue 7068022: Preserves NPObject identity for objects created in a plugin and passed to JavaScript. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 7 months 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
« no previous file with comments | « content/plugin/npobject_proxy.cc ('k') | content/plugin/npobject_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/plugin/npobject_stub.cc
===================================================================
--- content/plugin/npobject_stub.cc (revision 86681)
+++ content/plugin/npobject_stub.cc (working copy)
@@ -27,6 +27,7 @@
route_id_(route_id),
containing_window_(containing_window),
page_url_(page_url) {
+ channel_->AddMappingForNPObjectStub(route_id, npobject);
channel_->AddRoute(route_id, this, this);
// We retain the object just as PluginHost does if everything was in-process.
@@ -35,8 +36,10 @@
NPObjectStub::~NPObjectStub() {
channel_->RemoveRoute(route_id_);
- if (npobject_)
+ if (npobject_) {
+ channel_->RemoveMappingForNPObjectStub(route_id_, npobject_);
WebBindings::releaseObject(npobject_);
+ }
}
bool NPObjectStub::Send(IPC::Message* msg) {
@@ -44,6 +47,7 @@
}
void NPObjectStub::OnPluginDestroyed() {
+ channel_->RemoveMappingForNPObjectStub(route_id_, npobject_);
// We null out the underlying NPObject pointer since it's not valid anymore (
// ScriptController manually deleted the object). As a result,
// OnMessageReceived won't dispatch any more messages. Since this includes
« no previous file with comments | « content/plugin/npobject_proxy.cc ('k') | content/plugin/npobject_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698