Index: content/child/np_channel_base.h |
diff --git a/content/child/np_channel_base.h b/content/child/np_channel_base.h |
index 06e99918037c33e34541b0ce0c3b1b5aeff9c9c9..a89e5bf31698fe9dee7e1b113eeec46d12f471e9 100644 |
--- a/content/child/np_channel_base.h |
+++ b/content/child/np_channel_base.h |
@@ -31,6 +31,13 @@ struct hash<NPObject*> { |
} |
}; |
+template<> |
+struct hash<struct _NPP*> { |
+ std::size_t operator()(struct _NPP* const& ptr) const { |
+ return hash<size_t>()(reinterpret_cast<size_t>(ptr)); |
+ } |
+}; |
+ |
} // namespace __gnu_cxx |
#elif defined(COMPILER_MSVC) |
namespace stdext { |
@@ -61,16 +68,20 @@ class NPChannelBase : public IPC::Listener, |
void AddRoute(int route_id, IPC::Listener* listener, NPObjectBase* npobject); |
void RemoveRoute(int route_id); |
- |
void AddMappingForNPObjectProxy(int route_id, NPObject* object); |
void RemoveMappingForNPObjectProxy(int route_id); |
void AddMappingForNPObjectStub(int route_id, NPObject* object); |
void RemoveMappingForNPObjectStub(int route_id, NPObject* object); |
+ void AddMappingForNPObjectOwner(int route_id, struct _NPP* owner); |
+ void SetDefaultNPObjectOwner(struct _NPP* owner); |
+ void RemoveMappingForNPObjectOwner(int route_id); |
+ |
NPObject* GetExistingNPObjectProxy(int route_id); |
int GetExistingRouteForNPObjectStub(NPObject* npobject); |
- |
+ struct _NPP* GetExistingNPObjectOwner(int route_id); |
+ int GetExistingRouteForNPObjectOwner(struct _NPP* owner); |
// IPC::Sender implementation: |
virtual bool Send(IPC::Message* msg) OVERRIDE; |
@@ -171,6 +182,16 @@ class NPChannelBase : public IPC::Listener, |
typedef base::hash_map<NPObject*, int> StubMap; |
StubMap stub_map_; |
+ typedef base::hash_map<struct _NPP*, int> OwnerToRouteMap; |
+ OwnerToRouteMap owner_to_route_; |
+ |
+ typedef base::hash_map<int, struct _NPP*> RouteToOwnerMap; |
+ RouteToOwnerMap route_to_owner_; |
+ |
+ // Used on the plugin side to represent any object received that does |
+ // not belong to a plugin instance. |
+ struct _NPP* default_owner_; |
+ |
// Used to implement message routing functionality to WebPlugin[Delegate] |
// objects |
MessageRouter router_; |