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

Side by Side Diff: compiled/ElemHide.cpp

Issue 29595633: Issue 5870 - Implement the new ElemHideEmulation filter type (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Added missing ABP_NS macros Created Feb. 9, 2018, 8:34 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/String.h » ('j') | compiled/filter/ElemHideBase.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-present eyeo GmbH 3 * Copyright (C) 2006-present 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
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 mUnconditionalSelectorsCache->push_back(entry->second); 190 mUnconditionalSelectorsCache->push_back(entry->second);
191 } 191 }
192 } 192 }
193 } 193 }
194 return intrusive_ptr<ElemHide_SelectorList>(mUnconditionalSelectorsCache).rele ase(); 194 return intrusive_ptr<ElemHide_SelectorList>(mUnconditionalSelectorsCache).rele ase();
195 } 195 }
196 196
197 ElemHide_SelectorList* ElemHide::GetSelectorsForDomain(const String& domain, 197 ElemHide_SelectorList* ElemHide::GetSelectorsForDomain(const String& domain,
198 Criteria criteria) const 198 Criteria criteria) const
199 { 199 {
200 intrusive_ptr<ElemHide_SelectorList> selectors(new ElemHide_SelectorList()); 200 intrusive_ptr<ElemHide_SelectorList> selectors(new ElemHide_SelectorList(), fa lse);
sergei 2018/02/12 12:53:18 Good catch, it seems unrelated change, could you p
hub 2018/02/12 18:14:38 Done. https://codereview.adblockplus.org/29695575
201 annotate_address(selectors.get(), "ElemHide_SelectorList"); 201 annotate_address(selectors.get(), "ElemHide_SelectorList");
202 202
203 if (criteria < NO_UNCONDITIONAL) 203 if (criteria < NO_UNCONDITIONAL)
204 { 204 {
205 intrusive_ptr<ElemHide_SelectorList> selector(GetUnconditionalSelectors()); 205 intrusive_ptr<ElemHide_SelectorList> selector(GetUnconditionalSelectors(), f alse);
206 selectors->append(*selector); 206 selectors->append(*selector);
207 } 207 }
208 208
209 bool specificOnly = criteria >= SPECIFIC_ONLY; 209 bool specificOnly = criteria >= SPECIFIC_ONLY;
210 StringSet seenFilters; 210 StringSet seenFilters;
211 DependentString docDomain(domain); 211 DependentString docDomain(domain);
212 212
213 DependentString currentDomain(domain); 213 DependentString currentDomain(domain);
214 while (true) 214 while (true)
215 { 215 {
(...skipping 21 matching lines...) Expand all
237 if (currentDomain.empty()) 237 if (currentDomain.empty())
238 break; 238 break;
239 239
240 auto nextDot = currentDomain.find(u'.'); 240 auto nextDot = currentDomain.find(u'.');
241 currentDomain = nextDot == String::npos ? 241 currentDomain = nextDot == String::npos ?
242 u""_str : DependentString(currentDomain, nextDot + 1); 242 u""_str : DependentString(currentDomain, nextDot + 1);
243 } 243 }
244 244
245 return selectors.release(); 245 return selectors.release();
246 } 246 }
OLDNEW
« no previous file with comments | « no previous file | compiled/String.h » ('j') | compiled/filter/ElemHideBase.h » ('J')

Powered by Google App Engine
This is Rietveld