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-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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 void FilterEngine::ShowNotification(const ShowNotificationCallback& callback, | 525 void FilterEngine::ShowNotification(const ShowNotificationCallback& callback, |
526 const JsValueList& params) const | 526 const JsValueList& params) const |
527 { | 527 { |
528 if (params.size() < 1) | 528 if (params.size() < 1) |
529 return; | 529 return; |
530 | 530 |
531 if (!params[0].IsObject()) | 531 if (!params[0].IsObject()) |
532 { | 532 { |
533 return; | 533 return; |
534 } | 534 } |
535 callback(NotificationPtr(new Notification(JsValue(params[0])))); | 535 callback(Notification(JsValue(params[0]))); |
536 } | 536 } |
537 | 537 |
538 | 538 |
539 int FilterEngine::CompareVersions(const std::string& v1, const std::string& v2)
const | 539 int FilterEngine::CompareVersions(const std::string& v1, const std::string& v2)
const |
540 { | 540 { |
541 JsValueList params; | 541 JsValueList params; |
542 params.push_back(jsEngine->NewValue(v1)); | 542 params.push_back(jsEngine->NewValue(v1)); |
543 params.push_back(jsEngine->NewValue(v2)); | 543 params.push_back(jsEngine->NewValue(v2)); |
544 JsValue func = jsEngine->Evaluate("API.compareVersions"); | 544 JsValue func = jsEngine->Evaluate("API.compareVersions"); |
545 return func.Call(params).AsInt(); | 545 return func.Call(params).AsInt(); |
(...skipping 27 matching lines...) Expand all Loading... |
573 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent
Url); | 573 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent
Url); |
574 if (filter) | 574 if (filter) |
575 { | 575 { |
576 return filter; | 576 return filter; |
577 } | 577 } |
578 currentUrl = parentUrl; | 578 currentUrl = parentUrl; |
579 } | 579 } |
580 while (urlIterator != documentUrls.end()); | 580 while (urlIterator != documentUrls.end()); |
581 return FilterPtr(); | 581 return FilterPtr(); |
582 } | 582 } |
OLD | NEW |