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

Unified Diff: content/child/npobject_util.cc

Issue 17208003: Track NPObject ownership by the originating plugins' NPP identifier. [4/6] (Chrome) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove DCHECKs on proxy and stub maps. Created 7 years, 6 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/child/npobject_stub.h ('k') | content/child/plugin_param_traits.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/npobject_util.cc
diff --git a/content/child/npobject_util.cc b/content/child/npobject_util.cc
index 80fed0e53dc0c3734b27c1a20e0891ecff746d38..7b4953c3e1ccbccbb722d76ae6e0f7fc635a6eac 100644
--- a/content/child/npobject_util.cc
+++ b/content/child/npobject_util.cc
@@ -204,6 +204,11 @@ void CreateNPVariantParam(const NPVariant& variant,
page_url);
param->npobject_routing_id = route_id;
}
+
+ // Include the object's owner.
+ NPP owner = WebBindings::getObjectOwner(variant.value.objectValue);
+ param->npobject_owner_id =
+ channel->GetExistingRouteForNPObjectOwner(owner);
} else {
param->type = NPVARIANT_PARAM_VOID;
}
@@ -259,11 +264,16 @@ bool CreateNPVariant(const NPVariant_Param& param,
WebBindings::retainObject(object);
result->value.objectValue = object;
} else {
+ NPP owner =
+ channel->GetExistingNPObjectOwner(param.npobject_owner_id);
+ // TODO(wez): Once NPObject tracking lands in Blink, check |owner| and
+ // return NPVariantType_Void if it is NULL.
result->value.objectValue =
NPObjectProxy::Create(channel,
param.npobject_routing_id,
render_view_id,
- page_url);
+ page_url,
+ owner);
}
break;
}
« no previous file with comments | « content/child/npobject_stub.h ('k') | content/child/plugin_param_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698