PluginProcessConnection.h [plain text]
#ifndef PluginProcessConnection_h
#define PluginProcessConnection_h
#if ENABLE(PLUGIN_PROCESS)
#include "Connection.h"
#include "Plugin.h"
#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
namespace WebKit {
class NPRemoteObjectMap;
class PluginProcessConnectionManager;
class PluginProxy;
class PluginProcessConnection : public RefCounted<PluginProcessConnection>, CoreIPC::Connection::Client {
public:
static PassRefPtr<PluginProcessConnection> create(PluginProcessConnectionManager* pluginProcessConnectionManager, const String& pluginPath, CoreIPC::Connection::Identifier connectionIdentifier)
{
return adoptRef(new PluginProcessConnection(pluginProcessConnectionManager, pluginPath, connectionIdentifier));
}
~PluginProcessConnection();
const String& pluginPath() const { return m_pluginPath; }
CoreIPC::Connection* connection() const { return m_connection.get(); }
void addPluginProxy(PluginProxy*);
void removePluginProxy(PluginProxy*);
NPRemoteObjectMap* npRemoteObjectMap() const { return m_npRemoteObjectMap.get(); }
private:
PluginProcessConnection(PluginProcessConnectionManager* pluginProcessConnectionManager, const String& pluginPath, CoreIPC::Connection::Identifier connectionIdentifier);
virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
virtual void didClose(CoreIPC::Connection*);
virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
void didReceiveSyncPluginProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
void setException(const String&);
PluginProcessConnectionManager* m_pluginProcessConnectionManager;
String m_pluginPath;
RefPtr<CoreIPC::Connection> m_connection;
HashMap<uint64_t, PluginProxy*> m_plugins;
RefPtr<NPRemoteObjectMap> m_npRemoteObjectMap;
};
}
#endif // ENABLE(PLUGIN_PROCESS)
#endif // PluginProcessConnection_h