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

Unified Diff: content/plugin/npobject_stub.cc

Issue 7037027: Fixes Issues #5751 & #22631: NPObject identity (Closed)
Patch Set: hopefully added base url 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
diff --git a/content/plugin/npobject_stub.cc b/content/plugin/npobject_stub.cc
index e7402a8c72bc4fd5b70c8859ce3861a25e9fcdf9..7ebd8e64ea2df37698d200e8f553803e079220fc 100644
--- a/content/plugin/npobject_stub.cc
+++ b/content/plugin/npobject_stub.cc
@@ -27,6 +27,7 @@ NPObjectStub::NPObjectStub(
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(
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 @@ bool NPObjectStub::Send(IPC::Message* msg) {
}
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