forked from brave-experiments/ad-block
-
Notifications
You must be signed in to change notification settings - Fork 0
/
no_fingerprint_domain.h
39 lines (31 loc) · 1.16 KB
/
no_fingerprint_domain.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
/* 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 NO_FINGERPRINT_DOMAIN_H_
#define NO_FINGERPRINT_DOMAIN_H_
#include "./base.h"
class NoFingerprintDomain {
public:
NoFingerprintDomain();
NoFingerprintDomain(const NoFingerprintDomain &other);
NoFingerprintDomain(const char * data, int dataLen);
~NoFingerprintDomain();
uint64_t hash() const;
uint64_t GetHash() const {
return hash();
}
uint32_t Serialize(char *buffer);
uint32_t Deserialize(char *buffer, uint32_t bufferSize);
// Nothing needs to be updated when being added multiple times
void Update(const NoFingerprintDomain&) {}
bool operator==(const NoFingerprintDomain &rhs) const;
private:
// Holds true if the data should not free memory because for example it
// was loaded from a large buffer somewhere else via the serialize and
// deserialize functions.
bool borrowed_data;
char *data;
int dataLen;
};
#endif // NO_FINGERPRINT_DOMAIN_H_