LEFT | RIGHT |
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-2015 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 return match; | 321 return match; |
322 lastDocumentUrl = documentUrl; | 322 lastDocumentUrl = documentUrl; |
323 } | 323 } |
324 | 324 |
325 return CheckFilterMatch(url, contentType, lastDocumentUrl); | 325 return CheckFilterMatch(url, contentType, lastDocumentUrl); |
326 } | 326 } |
327 | 327 |
328 bool FilterEngine::IsDocumentWhitelisted(const std::string& url, | 328 bool FilterEngine::IsDocumentWhitelisted(const std::string& url, |
329 const std::vector<std::string>& documentUrls) const | 329 const std::vector<std::string>& documentUrls) const |
330 { | 330 { |
331 return GetWhitelistingFilter(url, CONTENT_TYPE_DOCUMENT, documentUrls) != 0; | 331 return !!GetWhitelistingFilter(url, CONTENT_TYPE_DOCUMENT, documentUrls); |
332 } | 332 } |
333 | 333 |
334 bool FilterEngine::IsElemhideWhitelisted(const std::string& url, | 334 bool FilterEngine::IsElemhideWhitelisted(const std::string& url, |
335 const std::vector<std::string>& documentUrls) const | 335 const std::vector<std::string>& documentUrls) const |
336 { | 336 { |
337 return GetWhitelistingFilter(url, CONTENT_TYPE_ELEMHIDE, documentUrls) != 0; | 337 return !!GetWhitelistingFilter(url, CONTENT_TYPE_ELEMHIDE, documentUrls); |
338 } | 338 } |
339 | 339 |
340 AdblockPlus::FilterPtr FilterEngine::CheckFilterMatch(const std::string& url, | 340 AdblockPlus::FilterPtr FilterEngine::CheckFilterMatch(const std::string& url, |
341 ContentType contentType, | 341 ContentType contentType, |
342 const std::string& documentUrl) const | 342 const std::string& documentUrl) const |
343 { | 343 { |
344 JsValuePtr func = jsEngine->Evaluate("API.checkFilterMatch"); | 344 JsValuePtr func = jsEngine->Evaluate("API.checkFilterMatch"); |
345 JsValueList params; | 345 JsValueList params; |
346 params.push_back(jsEngine->NewValue(url)); | 346 params.push_back(jsEngine->NewValue(url)); |
347 params.push_back(jsEngine->NewValue(ContentTypeToString(contentType))); | 347 params.push_back(jsEngine->NewValue(ContentTypeToString(contentType))); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 currentUrl, contentType, parentUrl); | 504 currentUrl, contentType, parentUrl); |
505 if (filter) | 505 if (filter) |
506 { | 506 { |
507 return filter; | 507 return filter; |
508 } | 508 } |
509 currentUrl = parentUrl; | 509 currentUrl = parentUrl; |
510 } | 510 } |
511 while (urlIterator != documentUrls.end()); | 511 while (urlIterator != documentUrls.end()); |
512 return FilterPtr(); | 512 return FilterPtr(); |
513 } | 513 } |
LEFT | RIGHT |