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

Unified Diff: content/child/plugin_param_traits.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/plugin_param_traits.h ('k') | content/content_plugin.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/plugin_param_traits.cc
diff --git a/content/child/plugin_param_traits.cc b/content/child/plugin_param_traits.cc
index da1b24130ad7c82b5c338f64833d7a482aeed8bc..f50aecf9a2ce0799a5b43ddfe9d5b3ff6077d752 100644
--- a/content/child/plugin_param_traits.cc
+++ b/content/child/plugin_param_traits.cc
@@ -24,7 +24,8 @@ NPVariant_Param::NPVariant_Param()
bool_value(false),
int_value(0),
double_value(0),
- npobject_routing_id(-1) {
+ npobject_routing_id(-1),
+ npobject_owner_id(-1) {
}
NPVariant_Param::~NPVariant_Param() {
@@ -53,6 +54,9 @@ void ParamTraits<NPVariant_Param>::Write(Message* m, const param_type& p) {
// process with NPObjectStub in this process or to identify the raw
// npobject pointer to be used in the callee process.
WriteParam(m, p.npobject_routing_id);
+ // This is a routing Id used to identify the plugin instance that owns
+ // the object, for ownership-tracking purposes.
+ WriteParam(m, p.npobject_owner_id);
} else {
DCHECK(p.type == content::NPVARIANT_PARAM_VOID ||
p.type == content::NPVARIANT_PARAM_NULL);
@@ -79,6 +83,7 @@ bool ParamTraits<NPVariant_Param>::Read(const Message* m,
} else if (r->type == content::NPVARIANT_PARAM_SENDER_OBJECT_ROUTING_ID ||
r->type == content::NPVARIANT_PARAM_RECEIVER_OBJECT_ROUTING_ID) {
result = ReadParam(m, iter, &r->npobject_routing_id);
+ result = ReadParam(m, iter, &r->npobject_owner_id);
} else if ((r->type == content::NPVARIANT_PARAM_VOID) ||
(r->type == content::NPVARIANT_PARAM_NULL)) {
result = true;
« no previous file with comments | « content/child/plugin_param_traits.h ('k') | content/content_plugin.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698