WebCompiledContentRuleList.cpp [plain text]
#include "config.h"
#include "WebCompiledContentRuleList.h"
#if ENABLE(CONTENT_EXTENSIONS)
namespace WebKit {
Ref<WebCompiledContentRuleList> WebCompiledContentRuleList::create(WebCompiledContentRuleListData&& data)
{
return adoptRef(*new WebCompiledContentRuleList(WTFMove(data)));
}
WebCompiledContentRuleList::WebCompiledContentRuleList(WebCompiledContentRuleListData&& data)
: m_data(WTFMove(data))
{
}
WebCompiledContentRuleList::~WebCompiledContentRuleList()
{
}
bool WebCompiledContentRuleList::conditionsApplyOnlyToDomain() const
{
return *reinterpret_cast<uint32_t*>(reinterpret_cast<uint8_t*>(m_data.data->data()) + m_data.conditionsApplyOnlyToDomainOffset);
}
const WebCore::ContentExtensions::DFABytecode* WebCompiledContentRuleList::filtersWithoutConditionsBytecode() const
{
return static_cast<const WebCore::ContentExtensions::DFABytecode*>(m_data.data->data()) + m_data.filtersWithoutConditionsBytecodeOffset;
}
unsigned WebCompiledContentRuleList::filtersWithoutConditionsBytecodeLength() const
{
return m_data.filtersWithoutConditionsBytecodeSize;
}
const WebCore::ContentExtensions::DFABytecode* WebCompiledContentRuleList::filtersWithConditionsBytecode() const
{
return static_cast<const WebCore::ContentExtensions::DFABytecode*>(m_data.data->data()) + m_data.filtersWithConditionsBytecodeOffset;
}
unsigned WebCompiledContentRuleList::filtersWithConditionsBytecodeLength() const
{
return m_data.filtersWithConditionsBytecodeSize;
}
const WebCore::ContentExtensions::DFABytecode* WebCompiledContentRuleList::topURLFiltersBytecode() const
{
return static_cast<const WebCore::ContentExtensions::DFABytecode*>(m_data.data->data()) + m_data.topURLFiltersBytecodeOffset;
}
unsigned WebCompiledContentRuleList::topURLFiltersBytecodeLength() const
{
return m_data.topURLFiltersBytecodeSize;
}
const WebCore::ContentExtensions::SerializedActionByte* WebCompiledContentRuleList::actions() const
{
return static_cast<const WebCore::ContentExtensions::SerializedActionByte*>(m_data.data->data()) + m_data.actionsOffset;
}
unsigned WebCompiledContentRuleList::actionsLength() const
{
return m_data.actionsSize;
}
}
#endif // ENABLE(CONTENT_EXTENSIONS)