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 auto notification = Notification(JsValue(params[0])); |
| 536 callback(notification); |
536 } | 537 } |
537 | 538 |
538 | 539 |
539 int FilterEngine::CompareVersions(const std::string& v1, const std::string& v2)
const | 540 int FilterEngine::CompareVersions(const std::string& v1, const std::string& v2)
const |
540 { | 541 { |
541 JsValueList params; | 542 JsValueList params; |
542 params.push_back(jsEngine->NewValue(v1)); | 543 params.push_back(jsEngine->NewValue(v1)); |
543 params.push_back(jsEngine->NewValue(v2)); | 544 params.push_back(jsEngine->NewValue(v2)); |
544 JsValue func = jsEngine->Evaluate("API.compareVersions"); | 545 JsValue func = jsEngine->Evaluate("API.compareVersions"); |
545 return func.Call(params).AsInt(); | 546 return func.Call(params).AsInt(); |
(...skipping 27 matching lines...) Expand all Loading... |
573 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent
Url); | 574 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent
Url); |
574 if (filter) | 575 if (filter) |
575 { | 576 { |
576 return filter; | 577 return filter; |
577 } | 578 } |
578 currentUrl = parentUrl; | 579 currentUrl = parentUrl; |
579 } | 580 } |
580 while (urlIterator != documentUrls.end()); | 581 while (urlIterator != documentUrls.end()); |
581 return FilterPtr(); | 582 return FilterPtr(); |
582 } | 583 } |
OLD | NEW |