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

Unified Diff: content/plugin/plugin_channel_base.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/plugin_channel_base.h ('k') | webkit/plugins/npapi/test/plugin_npobject_identity_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..778cac06e48d8b02bf314c133b48f238655f2a00 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::GetExistingNPObjectProxy(int route_id) {
+ ProxyMap::iterator iter = proxy_map_.find(route_id);
+ return iter != proxy_map_.end() ? iter->second : NULL;
+}
+
+int PluginChannelBase::GetExistingRouteForNPObjectStub(NPObject* npobject) {
+ StubMap::iterator iter = stub_map_.find(npobject);
+ return iter != stub_map_.end() ? iter->second : MSG_ROUTING_NONE;
+}
+
+void PluginChannelBase::AddMappingForNPObjectProxy(int route_id, NPObject* object) {
+ proxy_map_[route_id] = object;
+}
+
+void PluginChannelBase::AddMappingForNPObjectStub(int route_id, NPObject* object) {
+ DCHECK(object != NULL);
+ stub_map_[object] = route_id;
+}
+
+void PluginChannelBase::RemoveMappingForNPObjectStub(int route_id, NPObject* object) {
+ DCHECK(object != NULL);
+ stub_map_.erase(object);
+}
+
+void PluginChannelBase::RemoveMappingForNPObjectProxy(int route_id) {
+ proxy_map_.erase(route_id);
+}
« no previous file with comments | « content/plugin/plugin_channel_base.h ('k') | webkit/plugins/npapi/test/plugin_npobject_identity_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698