blob: c07a1da0f78c3f0b00c8df29fc01bbf21d83d4e5 [file] [log] [blame]
benjamin@webkit.org74bde2b2015-01-09 01:56:00 +00001/*
weinig@apple.com91defc82015-01-18 21:54:12 +00002 * Copyright (C) 2015 Apple Inc. All rights reserved.
benjamin@webkit.org74bde2b2015-01-09 01:56:00 +00003 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
weinig@apple.com963c96a2015-03-07 02:41:44 +000026#ifndef WebCompiledContentExtensionData_h
27#define WebCompiledContentExtensionData_h
benjamin@webkit.org74bde2b2015-01-09 01:56:00 +000028
weinig@apple.com963c96a2015-03-07 02:41:44 +000029#if ENABLE(CONTENT_EXTENSIONS)
benjamin@webkit.org74bde2b2015-01-09 01:56:00 +000030
achristensen@apple.com7b68e7c2015-04-13 17:54:22 +000031#include "NetworkCacheData.h"
weinig@apple.com14840e32015-03-08 21:32:50 +000032#include "SharedMemory.h"
33#include <wtf/RefPtr.h>
weinig@apple.com963c96a2015-03-07 02:41:44 +000034
35namespace IPC {
36class ArgumentDecoder;
37class ArgumentEncoder;
benjamin@webkit.org74bde2b2015-01-09 01:56:00 +000038}
39
weinig@apple.com963c96a2015-03-07 02:41:44 +000040namespace WebKit {
41
42class WebCompiledContentExtensionData {
43public:
weinig@apple.com14840e32015-03-08 21:32:50 +000044 WebCompiledContentExtensionData()
45 {
46 }
47
commit-queue@webkit.org61249862015-05-11 19:54:15 +000048 WebCompiledContentExtensionData(RefPtr<SharedMemory>&& data, NetworkCache::Data fileData, unsigned actionsOffset, unsigned actionsSize, unsigned filtersWithoutDomainsBytecodeOffset, unsigned filtersWithoutDomainsBytecodeSize, unsigned filtersWithDomainsBytecodeOffset, unsigned filtersWithDomainsBytecodeSize, unsigned domainFiltersBytecodeOffset, unsigned domainFiltersBytecodeSize)
aestes@apple.com13aae082016-01-02 08:03:08 +000049 : data(WTFMove(data))
achristensen@apple.com7b68e7c2015-04-13 17:54:22 +000050 , fileData(fileData)
weinig@apple.com14840e32015-03-08 21:32:50 +000051 , actionsOffset(actionsOffset)
52 , actionsSize(actionsSize)
commit-queue@webkit.org61249862015-05-11 19:54:15 +000053 , filtersWithoutDomainsBytecodeOffset(filtersWithoutDomainsBytecodeOffset)
54 , filtersWithoutDomainsBytecodeSize(filtersWithoutDomainsBytecodeSize)
55 , filtersWithDomainsBytecodeOffset(filtersWithDomainsBytecodeOffset)
56 , filtersWithDomainsBytecodeSize(filtersWithDomainsBytecodeSize)
57 , domainFiltersBytecodeOffset(domainFiltersBytecodeOffset)
58 , domainFiltersBytecodeSize(domainFiltersBytecodeSize)
weinig@apple.com14840e32015-03-08 21:32:50 +000059 {
60 }
61
weinig@apple.com963c96a2015-03-07 02:41:44 +000062 void encode(IPC::ArgumentEncoder&) const;
63 static bool decode(IPC::ArgumentDecoder&, WebCompiledContentExtensionData&);
64
weinig@apple.com14840e32015-03-08 21:32:50 +000065 RefPtr<SharedMemory> data;
achristensen@apple.com7b68e7c2015-04-13 17:54:22 +000066 NetworkCache::Data fileData;
weinig@apple.com14840e32015-03-08 21:32:50 +000067 unsigned actionsOffset { 0 };
68 unsigned actionsSize { 0 };
commit-queue@webkit.org61249862015-05-11 19:54:15 +000069 unsigned filtersWithoutDomainsBytecodeOffset { 0 };
70 unsigned filtersWithoutDomainsBytecodeSize { 0 };
71 unsigned filtersWithDomainsBytecodeOffset { 0 };
72 unsigned filtersWithDomainsBytecodeSize { 0 };
73 unsigned domainFiltersBytecodeOffset { 0 };
74 unsigned domainFiltersBytecodeSize { 0 };
weinig@apple.com963c96a2015-03-07 02:41:44 +000075};
76
weinig@apple.com91defc82015-01-18 21:54:12 +000077}
benjamin@webkit.org74bde2b2015-01-09 01:56:00 +000078
weinig@apple.com963c96a2015-03-07 02:41:44 +000079#endif // ENABLE(CONTENT_EXTENSIONS)
80#endif // WebCompiledContentExtensionData_h