InteractionInformationAtPosition.cpp [plain text]
#include "config.h"
#include "InteractionInformationAtPosition.h"
#include "Arguments.h"
#include "WebCoreArgumentCoders.h"
namespace WebKit {
#if PLATFORM(IOS)
void InteractionInformationAtPosition::encode(IPC::ArgumentEncoder& encoder) const
{
encoder << point;
encoder << nodeAtPositionIsAssistedNode;
encoder << isSelectable;
encoder << isNearMarkedText;
encoder << clickableElementName;
encoder << url;
encoder << title;
encoder << bounds;
ShareableBitmap::Handle handle;
if (image)
image->createHandle(handle, SharedMemory::ReadOnly);
encoder << handle;
}
bool InteractionInformationAtPosition::decode(IPC::ArgumentDecoder& decoder, InteractionInformationAtPosition& result)
{
if (!decoder.decode(result.point))
return false;
if (!decoder.decode(result.nodeAtPositionIsAssistedNode))
return false;
if (!decoder.decode(result.isSelectable))
return false;
if (!decoder.decode(result.isNearMarkedText))
return false;
if (!decoder.decode(result.clickableElementName))
return false;
if (!decoder.decode(result.url))
return false;
if (!decoder.decode(result.title))
return false;
if (!decoder.decode(result.bounds))
return false;
ShareableBitmap::Handle handle;
if (!decoder.decode(handle))
return false;
if (!handle.isNull())
result.image = ShareableBitmap::create(handle, SharedMemory::ReadOnly);
return true;
}
#endif
}