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

Side by Side Diff: compiled/Filter.h

Issue 29333474: Issue 4125 - [emscripten] Convert filter classes to C++ (Closed)
Patch Set: Properly determine ref_counted offset instead of assuming that it is zero Created March 14, 2017, 10:18 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #pragma once
2
3 #include <vector>
4
5 #include "String.h"
6 #include "intrusive_ptr.h"
7 #include "debug.h"
8
9 class Filter : public ref_counted
10 {
11 protected:
12 OwnedString mText;
13
14 public:
15 enum Type
16 {
17 UNKNOWN = 0,
18 INVALID = 1,
19 COMMENT = 2,
20 BLOCKING = 3,
21 WHITELIST = 4,
22 ELEMHIDE = 5,
23 ELEMHIDEEXCEPTION = 6,
24 CSSPROPERTY = 7,
25 };
26
27 explicit Filter(Type type, const String& text);
28 ~Filter();
29
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);
44 };
45
46 typedef intrusive_ptr<Filter> FilterPtr;
OLDNEW

Powered by Google App Engine
This is Rietveld