forked from brave-experiments/ad-block
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ABPFilterParserWrap.h
49 lines (38 loc) · 1.75 KB
/
ABPFilterParserWrap.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* Copyright (c) 2015 Brian R. Bondy. Distributed under the MPL2 license.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef ABPFILTERPARSERWRAP_H_
#define ABPFILTERPARSERWRAP_H_
#include <node.h>
#include <node_object_wrap.h>
#include "ABPFilterParser.h"
namespace ABPFilterParserWrap {
/**
* Wraps Bloom Filter for use in Node
*/
class ABPFilterParserWrap : public ABPFilterParser, public node::ObjectWrap {
public:
static void Init(v8::Local<v8::Object> exports);
private:
ABPFilterParserWrap();
virtual ~ABPFilterParserWrap();
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Clear(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Parse(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Matches(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Serialize(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Deserialize(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Cleanup(const v8::FunctionCallbackInfo<v8::Value>& args);
static void GetParsingStats(const v8::FunctionCallbackInfo<v8::Value>& args);
static void GetMatchingStats(const v8::FunctionCallbackInfo<v8::Value>& args);
static void EnableBadFingerprintDetection(
const v8::FunctionCallbackInfo<v8::Value>& args);
static void GenerateBadFingerprintsHeader(
const v8::FunctionCallbackInfo<v8::Value>& args);
static void FindMatchingFilters(
const v8::FunctionCallbackInfo<v8::Value>& args);
static v8::Persistent<v8::Function> constructor;
};
} // namespace ABPFilterParserWrap
#endif // ABPFILTERPARSERWRAP_H_