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

Delta Between Two Patch Sets: compiled/Filter.h

Issue 29333474: Issue 4125 - [emscripten] Convert filter classes to C++ (Closed)
Left Patch Set: Created Jan. 14, 2016, 4:40 p.m.
Right Patch Set: Addressed comments from Patch Set 28 Created March 21, 2017, 10:04 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « compiled/ElemHideFilter.cpp ('k') | compiled/Filter.cpp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #ifndef ADBLOCKPLUS_FILTER_H 1 #pragma once
2 #define ADBLOCKPLUS_FILTER_H
3 2
4 #include <string>
5 #include <vector> 3 #include <vector>
6 4
7 class Filter 5 #include "String.h"
6 #include "intrusive_ptr.h"
7 #include "debug.h"
8
9 class Filter : public ref_counted
8 { 10 {
11 protected:
12 OwnedString mText;
13
9 public: 14 public:
10 Filter(const std::u16string& text);
11
12 std::u16string text;
13
14 /* TODO
15 std::vector<Subscription> subscriptions;
16 */
17
18 enum Type 15 enum Type
19 { 16 {
20 UNKNOWN = 0, 17 UNKNOWN = 0,
21 INVALID = 1, 18 INVALID = 1,
22 COMMENT = 2, 19 COMMENT = 2,
23 BLOCKING = 3, 20 BLOCKING = 3,
24 WHITELIST = 4, 21 WHITELIST = 4,
25 ELEMHIDE = 5, 22 ELEMHIDE = 5,
26 ELEMHIDEEXCEPTION = 6, 23 ELEMHIDEEXCEPTION = 6,
27 CSSPROPERTY = 7, 24 CSSPROPERTY = 7,
28 }; 25 };
29 26
30 virtual Type GetType() = 0; 27 explicit Filter(Type type, const String& text);
28 ~Filter();
31 29
32 virtual const std::u16string Serialize(); 30 Type mType;
31
32 /* TODO
33 std::vector<Subscription> mSubscriptions;
34 */
35
36 EMSCRIPTEN_KEEPALIVE const String& GetText() const
37 {
38 return mText;
39 }
40
41 EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const;
42
43 static EMSCRIPTEN_KEEPALIVE Filter* FromText(DependentString& text);
33 }; 44 };
34 45
35 #endif 46 typedef intrusive_ptr<Filter> FilterPtr;
LEFTRIGHT

Powered by Google App Engine
This is Rietveld