| Index: content/plugin/plugin_channel_base.h
|
| ===================================================================
|
| --- content/plugin/plugin_channel_base.h (revision 86681)
|
| +++ content/plugin/plugin_channel_base.h (working copy)
|
| @@ -22,6 +22,28 @@
|
| class MessageLoopProxy;
|
| }
|
|
|
| +#if defined(COMPILER_GCC)
|
| +namespace __gnu_cxx {
|
| +
|
| +template<>
|
| +struct hash<NPObject*> {
|
| + std::size_t operator()(NPObject* const& ptr) const {
|
| + return hash<size_t>()(reinterpret_cast<size_t>(ptr));
|
| + }
|
| +};
|
| +
|
| +} // namespace __gnu_cxx
|
| +#elif defined(COMPILER_MSVC)
|
| +namespace stdext {
|
| +
|
| +template<>
|
| +inline size_t hash_value(NPObject* const& ptr) {
|
| + return hash_value(reinterpret_cast<size_t>(ptr));
|
| +}
|
| +
|
| +} // namespace stdext
|
| +#endif // COMPILER
|
| +
|
| // Encapsulates an IPC channel between a renderer and a plugin process.
|
| class PluginChannelBase : public IPC::Channel::Listener,
|
| public IPC::Message::Sender,
|
| @@ -38,6 +60,17 @@
|
| 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);
|
| +
|
| + NPObject* GetExistingNPObjectProxy(int route_id);
|
| + int GetExistingRouteForNPObjectStub(NPObject* npobject);
|
| +
|
| +
|
| // IPC::Message::Sender implementation:
|
| virtual bool Send(IPC::Message* msg);
|
|
|
| @@ -122,6 +155,12 @@
|
| typedef base::hash_map<int, NPObjectBase*> ListenerMap;
|
| ListenerMap npobject_listeners_;
|
|
|
| + typedef base::hash_map<int, NPObject*> ProxyMap;
|
| + ProxyMap proxy_map_;
|
| +
|
| + typedef base::hash_map<NPObject*, int> StubMap;
|
| + StubMap stub_map_;
|
| +
|
| // Used to implement message routing functionality to WebPlugin[Delegate]
|
| // objects
|
| MessageRouter router_;
|
|
|