WebConnectionToWebProcess.cpp [plain text]
#include "config.h"
#include "WebConnectionToWebProcess.h"
#include "WebConnectionMessages.h"
#include "WebContextUserMessageCoders.h"
#include "WebProcessProxy.h"
namespace WebKit {
PassRefPtr<WebConnectionToWebProcess> WebConnectionToWebProcess::create(WebProcessProxy* process)
{
return adoptRef(new WebConnectionToWebProcess(process));
}
WebConnectionToWebProcess::WebConnectionToWebProcess(WebProcessProxy* process)
: m_process(process)
{
m_process->addMessageReceiver(Messages::WebConnection::messageReceiverName(), *this);
}
void WebConnectionToWebProcess::invalidate()
{
m_process = 0;
}
void WebConnectionToWebProcess::encodeMessageBody(IPC::ArgumentEncoder& encoder, API::Object* messageBody)
{
encoder << WebContextUserMessageEncoder(messageBody, *m_process);
}
bool WebConnectionToWebProcess::decodeMessageBody(IPC::ArgumentDecoder& decoder, RefPtr<API::Object>& messageBody)
{
WebContextUserMessageDecoder messageBodyDecoder(messageBody, *m_process);
return decoder.decode(messageBodyDecoder);
}
bool WebConnectionToWebProcess::hasValidConnection() const
{
return m_process;
}
IPC::Connection* WebConnectionToWebProcess::messageSenderConnection()
{
return m_process->connection();
}
uint64_t WebConnectionToWebProcess::messageSenderDestinationID()
{
return 0;
}
}