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

Delta Between Two Patch Sets: src/plugin/PluginFilter.h

Issue 29331055: Issue #1234 - Remove 'CString' from PluginFilter.* (Closed)
Left Patch Set: Created Nov. 29, 2015, 3:49 p.m.
Right Patch Set: fix whitespace nit Created May 17, 2016, 6:40 p.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 | « no previous file | src/plugin/PluginFilter.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 /* 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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 *
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 std::wstring m_filterText; 67 std::wstring m_filterText;
68 68
69 // For domain specific filters only 69 // For domain specific filters only
70 std::wstring m_tagId; 70 std::wstring m_tagId;
71 std::wstring m_tagClassName; 71 std::wstring m_tagClassName;
72 std::wstring m_tag; 72 std::wstring m_tag;
73 73
74 std::vector<CFilterElementHideAttrSelector> m_attributeSelectors; 74 std::vector<CFilterElementHideAttrSelector> m_attributeSelectors;
75 std::shared_ptr<CFilterElementHide> m_predecessor; 75 std::shared_ptr<CFilterElementHide> m_predecessor;
76 76
77 CFilterElementHide(const std::wstring& filterText=L""); 77 CFilterElementHide(const std::wstring& filterText = L"");
sergei 2015/11/30 12:37:53 spaces around '=' are missed
Eric 2015/11/30 15:54:07 Done. I wasn't really looking for existing style
78 CFilterElementHide(const CFilterElementHide& filter); 78 CFilterElementHide(const CFilterElementHide& filter);
79 ETraverserComplexType m_type; 79 ETraverserComplexType m_type;
80 80
81 bool IsMatchFilterElementHide(IHTMLElement* pEl) const; 81 bool IsMatchFilterElementHide(IHTMLElement* pEl) const;
82 82
83 }; 83 };
84 84
85 // ============================================================================ 85 // ============================================================================
86 // CFilter 86 // CFilter
87 // ============================================================================ 87 // ============================================================================
(...skipping 30 matching lines...) Expand all
118 // ============================================================================ 118 // ============================================================================
119 119
120 class CPluginFilter 120 class CPluginFilter
121 { 121 {
122 122
123 private: 123 private:
124 124
125 std::wstring m_dataPath; 125 std::wstring m_dataPath;
126 126
127 // (Tag,Name) -> Filter 127 // (Tag,Name) -> Filter
128 typedef std::multimap<std::pair<std::wstring,std::wstring>, CFilterElementHide > TFilterElementHideTagsNamed; 128 typedef std::multimap<std::pair<std::wstring, std::wstring>, CFilterElementHid e> TFilterElementHideTagsNamed;
sergei 2015/11/30 12:37:54 space after comma is missed
Eric 2015/11/30 15:54:07 Done.
129 129
130 // Tag -> Filter 130 // Tag -> Filter
131 typedef std::multimap<std::wstring, CFilterElementHide> TFilterElementHideTags ; 131 typedef std::multimap<std::wstring, CFilterElementHide> TFilterElementHideTags ;
132 132
133 133
134 TFilterElementHideTagsNamed m_elementHideTagsId; 134 TFilterElementHideTagsNamed m_elementHideTagsId;
135 TFilterElementHideTagsNamed m_elementHideTagsClass; 135 TFilterElementHideTagsNamed m_elementHideTagsClass;
136 TFilterElementHideTags m_elementHideTags; 136 TFilterElementHideTags m_elementHideTags;
137 137
138 void ClearFilters(); 138 void ClearFilters();
139 139
140 public: 140 public:
141
142 CPluginFilter(const std::wstring& dataPath = L""); 141 CPluginFilter(const std::wstring& dataPath = L"");
143
144 bool LoadHideFilters(std::vector<std::wstring> filters); 142 bool LoadHideFilters(std::vector<std::wstring> filters);
145
146 bool AddFilterElementHide(std::wstring filter); 143 bool AddFilterElementHide(std::wstring filter);
147
148
149 bool IsElementHidden(const std::wstring& tag, IHTMLElement* pEl, const std::ws tring& domain, const std::wstring& indent) const; 144 bool IsElementHidden(const std::wstring& tag, IHTMLElement* pEl, const std::ws tring& domain, const std::wstring& indent) const;
150
151
152 bool ShouldBlock(const std::wstring& src, AdblockPlus::FilterEngine::ContentTy pe contentType, const std::wstring& domain, bool addDebug=false) const;
153
154 HANDLE hideFiltersLoadedEvent; 145 HANDLE hideFiltersLoadedEvent;
155 }; 146 };
156 147
157 148
158 #endif // _PLUGIN_FILTER_H_ 149 #endif // _PLUGIN_FILTER_H_
LEFTRIGHT

Powered by Google App Engine
This is Rietveld