PluginProcessConnection.h [plain text]
#ifndef PluginProcessConnection_h
#define PluginProcessConnection_h
#if ENABLE(PLUGIN_PROCESS)
#include "Connection.h"
#include "Plugin.h"
#include "PluginProcess.h"
#include "PluginProcessAttributes.h"
#include <wtf/RefCounted.h>
namespace WebKit {
class NPRemoteObjectMap;
class PluginProcessConnectionManager;
class PluginProxy;
class PluginProcessConnection : public RefCounted<PluginProcessConnection>, CoreIPC::Connection::Client {
public:
static PassRefPtr<PluginProcessConnection> create(PluginProcessConnectionManager* pluginProcessConnectionManager, uint64_t pluginProcessToken, CoreIPC::Connection::Identifier connectionIdentifier, bool supportsAsynchronousPluginInitialization)
{
return adoptRef(new PluginProcessConnection(pluginProcessConnectionManager, pluginProcessToken, connectionIdentifier, supportsAsynchronousPluginInitialization));
}
~PluginProcessConnection();
uint64_t pluginProcessToken() const { return m_pluginProcessToken; }
CoreIPC::Connection* connection() const { return m_connection.get(); }
void addPluginProxy(PluginProxy*);
void removePluginProxy(PluginProxy*);
NPRemoteObjectMap* npRemoteObjectMap() const { return m_npRemoteObjectMap.get(); }
bool supportsAsynchronousPluginInitialization() const { return m_supportsAsynchronousPluginInitialization; }
private:
PluginProcessConnection(PluginProcessConnectionManager*, uint64_t pluginProcessToken, CoreIPC::Connection::Identifier connectionIdentifier, bool supportsAsynchronousInitialization);
virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE;
virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&) OVERRIDE;
virtual void didClose(CoreIPC::Connection*);
virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::StringReference messageReceiverName, CoreIPC::StringReference messageName) OVERRIDE;
void didReceiveSyncPluginProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
void setException(const String&);
PluginProcessConnectionManager* m_pluginProcessConnectionManager;
uint64_t m_pluginProcessToken;
RefPtr<CoreIPC::Connection> m_connection;
HashMap<uint64_t, PluginProxy*> m_plugins;
RefPtr<NPRemoteObjectMap> m_npRemoteObjectMap;
bool m_supportsAsynchronousPluginInitialization;
};
}
#endif // ENABLE(PLUGIN_PROCESS)
#endif // PluginProcessConnection_h