| OLD | NEW |
| 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 Loading... |
| 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); |
| 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 Loading... |
| 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 } |
| OLD | NEW |