WebCompiledContentRuleListData.cpp [plain text]
#include "config.h"
#include "WebCompiledContentRuleListData.h"
#if ENABLE(CONTENT_EXTENSIONS)
#include "ArgumentCoders.h"
namespace WebKit {
void WebCompiledContentRuleListData::encode(IPC::Encoder& encoder) const
{
SharedMemory::Handle handle;
data->createHandle(handle, SharedMemory::Protection::ReadOnly);
encoder << handle;
encoder << conditionsApplyOnlyToDomainOffset;
encoder << actionsOffset;
encoder << actionsSize;
encoder << filtersWithoutConditionsBytecodeOffset;
encoder << filtersWithoutConditionsBytecodeSize;
encoder << filtersWithConditionsBytecodeOffset;
encoder << filtersWithConditionsBytecodeSize;
encoder << topURLFiltersBytecodeOffset;
encoder << topURLFiltersBytecodeSize;
}
bool WebCompiledContentRuleListData::decode(IPC::Decoder& decoder, WebCompiledContentRuleListData& compiledContentRuleListData)
{
SharedMemory::Handle handle;
if (!decoder.decode(handle))
return false;
compiledContentRuleListData.data = SharedMemory::map(handle, SharedMemory::Protection::ReadOnly);
if (!decoder.decode(compiledContentRuleListData.conditionsApplyOnlyToDomainOffset))
return false;
if (!decoder.decode(compiledContentRuleListData.actionsOffset))
return false;
if (!decoder.decode(compiledContentRuleListData.actionsSize))
return false;
if (!decoder.decode(compiledContentRuleListData.filtersWithoutConditionsBytecodeOffset))
return false;
if (!decoder.decode(compiledContentRuleListData.filtersWithoutConditionsBytecodeSize))
return false;
if (!decoder.decode(compiledContentRuleListData.filtersWithConditionsBytecodeOffset))
return false;
if (!decoder.decode(compiledContentRuleListData.filtersWithConditionsBytecodeSize))
return false;
if (!decoder.decode(compiledContentRuleListData.topURLFiltersBytecodeOffset))
return false;
if (!decoder.decode(compiledContentRuleListData.topURLFiltersBytecodeSize))
return false;
return true;
}
}
#endif // ENABLE(CONTENT_EXTENSIONS)