| 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-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 extern std::string jsSources[]; | 31 extern std::string jsSources[]; |
| 32 | 32 |
| 33 Filter::Filter(JsValue&& value) | 33 Filter::Filter(JsValue&& value) |
| 34 : JsValue(std::move(value)) | 34 : JsValue(std::move(value)) |
| 35 { | 35 { |
| 36 if (!IsObject()) | 36 if (!IsObject()) |
| 37 throw std::runtime_error("JavaScript value is not an object"); | 37 throw std::runtime_error("JavaScript value is not an object"); |
| 38 } | 38 } |
| 39 | 39 |
| 40 Filter::Type Filter::GetType() const | 40 Filter::Type Filter::GetType() |
| 41 { | 41 { |
| 42 std::string className = GetClass(); | 42 std::string className = GetClass(); |
| 43 if (className == "BlockingFilter") | 43 if (className == "BlockingFilter") |
| 44 return TYPE_BLOCKING; | 44 return TYPE_BLOCKING; |
| 45 else if (className == "WhitelistFilter") | 45 else if (className == "WhitelistFilter") |
| 46 return TYPE_EXCEPTION; | 46 return TYPE_EXCEPTION; |
| 47 else if (className == "ElemHideFilter") | 47 else if (className == "ElemHideFilter") |
| 48 return TYPE_ELEMHIDE; | 48 return TYPE_ELEMHIDE; |
| 49 else if (className == "ElemHideException") | 49 else if (className == "ElemHideException") |
| 50 return TYPE_ELEMHIDE_EXCEPTION; | 50 return TYPE_ELEMHIDE_EXCEPTION; |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent
Url); | 581 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent
Url); |
| 582 if (filter) | 582 if (filter) |
| 583 { | 583 { |
| 584 return filter; | 584 return filter; |
| 585 } | 585 } |
| 586 currentUrl = parentUrl; | 586 currentUrl = parentUrl; |
| 587 } | 587 } |
| 588 while (urlIterator != documentUrls.end()); | 588 while (urlIterator != documentUrls.end()); |
| 589 return FilterPtr(); | 589 return FilterPtr(); |
| 590 } | 590 } |
| LEFT | RIGHT |