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

Side by Side Diff: content/child/npobject_proxy.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/child/npobject_proxy.h ('k') | content/child/npobject_stub.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/npobject_proxy.h" 5 #include "content/child/npobject_proxy.h"
6 6
7 #include "content/child/np_channel_base.h" 7 #include "content/child/np_channel_base.h"
8 #include "content/child/npobject_util.h" 8 #include "content/child/npobject_util.h"
9 #include "content/child/plugin_messages.h" 9 #include "content/child/plugin_messages.h"
10 #include "third_party/WebKit/public/web/WebBindings.h" 10 #include "third_party/WebKit/public/web/WebBindings.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // NPObjects. 78 // NPObjects.
79 channel_->RemoveMappingForNPObjectProxy(route_id_); 79 channel_->RemoveMappingForNPObjectProxy(route_id_);
80 channel_->RemoveRoute(route_id_); 80 channel_->RemoveRoute(route_id_);
81 Send(new NPObjectMsg_Release(route_id_)); 81 Send(new NPObjectMsg_Release(route_id_));
82 } 82 }
83 } 83 }
84 84
85 NPObject* NPObjectProxy::Create(NPChannelBase* channel, 85 NPObject* NPObjectProxy::Create(NPChannelBase* channel,
86 int route_id, 86 int route_id,
87 int render_view_id, 87 int render_view_id,
88 const GURL& page_url) { 88 const GURL& page_url,
89 NPP owner) {
89 NPObjectWrapper* obj = reinterpret_cast<NPObjectWrapper*>( 90 NPObjectWrapper* obj = reinterpret_cast<NPObjectWrapper*>(
90 WebBindings::createObject(0, &npclass_proxy_)); 91 WebBindings::createObject(owner, &npclass_proxy_));
91 obj->proxy = new NPObjectProxy(channel, route_id, render_view_id, page_url); 92 obj->proxy = new NPObjectProxy(channel, route_id, render_view_id, page_url);
92 channel->AddMappingForNPObjectProxy(route_id, &obj->object); 93 channel->AddMappingForNPObjectProxy(route_id, &obj->object);
93 return reinterpret_cast<NPObject*>(obj); 94 return reinterpret_cast<NPObject*>(obj);
94 } 95 }
95 96
96 bool NPObjectProxy::Send(IPC::Message* msg) { 97 bool NPObjectProxy::Send(IPC::Message* msg) {
97 if (channel_.get()) 98 if (channel_.get())
98 return channel_->Send(msg); 99 return channel_->Send(msg);
99 100
100 delete msg; 101 delete msg;
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 proxy = NULL; 499 proxy = NULL;
499 if (!result) 500 if (!result)
500 return false; 501 return false;
501 502
502 CreateNPVariant( 503 CreateNPVariant(
503 result_param, channel.get(), result_var, render_view_id, page_url); 504 result_param, channel.get(), result_var, render_view_id, page_url);
504 return true; 505 return true;
505 } 506 }
506 507
507 } // namespace content 508 } // namespace content
OLDNEW
« no previous file with comments | « content/child/npobject_proxy.h ('k') | content/child/npobject_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698