PluginProcessConnection.h [plain text]
#ifndef PluginProcessConnection_h
#define PluginProcessConnection_h
#if ENABLE(NETSCAPE_PLUGIN_API)
#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>, IPC::Connection::Client {
public:
static Ref<PluginProcessConnection> create(PluginProcessConnectionManager* pluginProcessConnectionManager, uint64_t pluginProcessToken, IPC::Connection::Identifier connectionIdentifier, bool supportsAsynchronousPluginInitialization)
{
return adoptRef(*new PluginProcessConnection(pluginProcessConnectionManager, pluginProcessToken, connectionIdentifier, supportsAsynchronousPluginInitialization));
}
~PluginProcessConnection();
uint64_t pluginProcessToken() const { return m_pluginProcessToken; }
IPC::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, IPC::Connection::Identifier connectionIdentifier, bool supportsAsynchronousInitialization);
void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
void didClose(IPC::Connection&) override;
void didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
void didReceiveSyncPluginProcessConnectionMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&);
void setException(const String&);
PluginProcessConnectionManager* m_pluginProcessConnectionManager;
uint64_t m_pluginProcessToken;
RefPtr<IPC::Connection> m_connection;
HashMap<uint64_t, PluginProxy*> m_plugins;
RefPtr<NPRemoteObjectMap> m_npRemoteObjectMap;
bool m_supportsAsynchronousPluginInitialization;
};
}
#endif // ENABLE(NETSCAPE_PLUGIN_API)
#endif // PluginProcessConnection_h