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

Unified Diff: compiled/Filter.h

Issue 29333474: Issue 4125 - [emscripten] Convert filter classes to C++ (Closed)
Patch Set: Addressed comments from Patch Set 28 Created March 21, 2017, 10:04 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « compiled/ElemHideFilter.cpp ('k') | compiled/Filter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiled/Filter.h
===================================================================
new file mode 100644
--- /dev/null
+++ b/compiled/Filter.h
@@ -0,0 +1,46 @@
+#pragma once
+
+#include <vector>
+
+#include "String.h"
+#include "intrusive_ptr.h"
+#include "debug.h"
+
+class Filter : public ref_counted
+{
+protected:
+ OwnedString mText;
+
+public:
+ enum Type
+ {
+ UNKNOWN = 0,
+ INVALID = 1,
+ COMMENT = 2,
+ BLOCKING = 3,
+ WHITELIST = 4,
+ ELEMHIDE = 5,
+ ELEMHIDEEXCEPTION = 6,
+ CSSPROPERTY = 7,
+ };
+
+ explicit Filter(Type type, const String& text);
+ ~Filter();
+
+ Type mType;
+
+ /* TODO
+ std::vector<Subscription> mSubscriptions;
+ */
+
+ EMSCRIPTEN_KEEPALIVE const String& GetText() const
+ {
+ return mText;
+ }
+
+ EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const;
+
+ static EMSCRIPTEN_KEEPALIVE Filter* FromText(DependentString& text);
+};
+
+typedef intrusive_ptr<Filter> FilterPtr;
« no previous file with comments | « compiled/ElemHideFilter.cpp ('k') | compiled/Filter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld