Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: compiled/filter/Filter.h

Issue 29425555: Issue 5201 - [emscripten] Replace EM_ASM calls by a custom JavaScript library (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Left Patch Set: Created April 30, 2017, 6:54 a.m.
Right Patch Set: Abstracted away all Emscripten dependencies Created May 3, 2017, 11:54 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « compiled/filter/ElemHideBase.h ('k') | compiled/filter/InvalidFilter.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 #pragma once 18 #pragma once
19 19
20 #include <vector> 20 #include <vector>
21 21
22 #include "../String.h" 22 #include "../String.h"
23 #include "../intrusive_ptr.h" 23 #include "../intrusive_ptr.h"
24 #include "../debug.h" 24 #include "../debug.h"
25 #include "../bindings/runtime.h"
25 26
26 class Filter : public ref_counted 27 class Filter : public ref_counted
27 { 28 {
28 protected: 29 protected:
29 OwnedString mText; 30 OwnedString mText;
30 31
31 public: 32 public:
32 enum Type 33 enum Type
33 { 34 {
34 UNKNOWN = 0, 35 UNKNOWN = 0,
35 INVALID = 1, 36 INVALID = 1,
36 COMMENT = 2, 37 COMMENT = 2,
37 BLOCKING = 3, 38 BLOCKING = 3,
38 WHITELIST = 4, 39 WHITELIST = 4,
39 ELEMHIDE = 5, 40 ELEMHIDE = 5,
40 ELEMHIDEEXCEPTION = 6, 41 ELEMHIDEEXCEPTION = 6,
41 ELEMHIDEEMULATION = 7, 42 ELEMHIDEEMULATION = 7,
42 VALUE_COUNT = 8 43 VALUE_COUNT = 8
43 }; 44 };
44 45
45 explicit Filter(Type type, const String& text); 46 explicit Filter(Type type, const String& text);
46 ~Filter(); 47 ~Filter();
47 48
48 Type mType; 49 Type mType;
49 50
50 EMSCRIPTEN_KEEPALIVE const String& GetText() const 51 BINDINGS_EXPORTED const String& GetText() const
51 { 52 {
52 return mText; 53 return mText;
53 } 54 }
54 55
55 EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const; 56 BINDINGS_EXPORTED OwnedString Serialize() const;
56 57
57 static EMSCRIPTEN_KEEPALIVE Filter* FromText(DependentString& text); 58 static BINDINGS_EXPORTED Filter* FromText(DependentString& text);
58 }; 59 };
59 60
60 typedef intrusive_ptr<Filter> FilterPtr; 61 typedef intrusive_ptr<Filter> FilterPtr;
LEFTRIGHT

Powered by Google App Engine
This is Rietveld