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

Unified Diff: content/child/np_channel_base.h

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 | « no previous file | content/child/np_channel_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | content/child/np_channel_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698