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

Side by Side Diff: compiled/ElemHideBase.h

Issue 29383799: Issue 4988 - [emscripten] Adjust API for Element Hiding Emulation filters (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Created March 14, 2017, 2:42 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | compiled/ElemHideBase.cpp » ('j') | compiled/ElemHideBase.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #pragma once 1 #pragma once
2 2
3 #include <cstddef> 3 #include <cstddef>
4 4
5 #include "ActiveFilter.h" 5 #include "ActiveFilter.h"
6 6
7 struct ElemHideBaseData 7 struct ElemHideData
8 { 8 {
9 String::size_type mDomainsEnd; 9 String::size_type mDomainsEnd;
10 String::size_type mSelectorStart; 10 String::size_type mSelectorStart;
11 11
12 bool HasDomains() const 12 bool HasDomains() const
13 { 13 {
14 return mDomainsEnd != 0; 14 return mDomainsEnd != 0;
15 } 15 }
16 16
17 DependentString GetDomainsSource(String& text) const 17 DependentString GetDomainsSource(String& text) const
(...skipping 10 matching lines...) Expand all
28 { 28 {
29 return DependentString(text, mSelectorStart); 29 return DependentString(text, mSelectorStart);
30 } 30 }
31 31
32 const DependentString GetSelector(const String& text) const 32 const DependentString GetSelector(const String& text) const
33 { 33 {
34 return DependentString(text, mSelectorStart); 34 return DependentString(text, mSelectorStart);
35 } 35 }
36 }; 36 };
37 37
38 struct ElemHideData;
39
40 class ElemHideBase : public ActiveFilter 38 class ElemHideBase : public ActiveFilter
41 { 39 {
42 protected: 40 protected:
43 ElemHideBaseData mData; 41 ElemHideData mData;
44 public: 42 public:
45 explicit ElemHideBase(Type type, const String& text, const ElemHideBaseData& d ata); 43 explicit ElemHideBase(Type type, const String& text, const ElemHideData& data) ;
46 static Type Parse(DependentString& text, ElemHideData& data); 44 static Type Parse(DependentString& text, ElemHideData& data);
47 45
48 EMSCRIPTEN_KEEPALIVE const DependentString GetSelector() const 46 EMSCRIPTEN_KEEPALIVE const DependentString GetSelector() const
49 { 47 {
50 return mData.GetSelector(mText); 48 return mData.GetSelector(mText);
51 } 49 }
52 50
53 EMSCRIPTEN_KEEPALIVE OwnedString GetSelectorDomain() const; 51 EMSCRIPTEN_KEEPALIVE OwnedString GetSelectorDomain() const;
54 }; 52 };
OLDNEW
« no previous file with comments | « no previous file | compiled/ElemHideBase.cpp » ('j') | compiled/ElemHideBase.cpp » ('J')

Powered by Google App Engine
This is Rietveld