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

Unified Diff: content/plugin/plugin_channel_base.cc

Issue 7037027: Fixes Issues #5751 & #22631: NPObject identity (Closed)
Patch Set: fixes bogus change 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
Index: content/plugin/plugin_channel_base.cc
diff --git a/content/plugin/plugin_channel_base.cc b/content/plugin/plugin_channel_base.cc
index 3b1aa4c4516ac6df81def98264b3ab62091eb6e2..c2570aaec93ddb7d85f928eaa92750abb8f4b82c 100644
--- a/content/plugin/plugin_channel_base.cc
+++ b/content/plugin/plugin_channel_base.cc
@@ -239,3 +239,31 @@ bool PluginChannelBase::OnControlMessageReceived(const IPC::Message& msg) {
void PluginChannelBase::OnChannelError() {
channel_valid_ = false;
}
+
+NPObject* PluginChannelBase::GetExistingProxy(int route_id) {
+ ProxyMap::iterator iter = proxy_map_.find(route_id);
+ return iter != proxy_map_.end() ? iter->second : NULL;
+}
+
+int PluginChannelBase::GetExistingRouteForStub(NPObject* npobject) {
+ StubMap::iterator iter = stub_map_.find(npobject);
+ return iter != stub_map_.end() ? iter->second : -1;
jam 2011/05/20 23:22:22 nit: better to return MSG_ROUTING_NONE than -1. a
Kelly Norton 2011/05/23 15:02:56 Done.
+}
+
+void PluginChannelBase::AddMappingForProxy(int route_id, NPObject* object) {
+ proxy_map_[route_id] = object;
+}
+
+void PluginChannelBase::AddMappingForStub(int route_id, NPObject* object) {
+ DCHECK(object != NULL);
+ stub_map_[object] = route_id;
+}
+
+void PluginChannelBase::RemoveMappingForStub(int route_id, NPObject* object) {
+ DCHECK(object != NULL);
+ stub_map_.erase(object);
+}
+
+void PluginChannelBase::RemoveMappingForProxy(int route_id) {
+ proxy_map_.erase(route_id);
+}

Powered by Google App Engine
This is Rietveld 408576698