Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/FilterEngine.cpp

Issue 29419629: Issue 5164 - Remove NotificationPtr (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Added arg name to declaration + doc comments Created April 24, 2017, 6:49 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/AdblockPlus/Notification.h ('k') | src/Notification.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 void FilterEngine::ShowNotification(const ShowNotificationCallback& callback, 541 void FilterEngine::ShowNotification(const ShowNotificationCallback& callback,
542 const JsValueList& params) const 542 const JsValueList& params) const
543 { 543 {
544 if (params.size() < 1) 544 if (params.size() < 1)
545 return; 545 return;
546 546
547 if (!params[0].IsObject()) 547 if (!params[0].IsObject())
548 { 548 {
549 return; 549 return;
550 } 550 }
551 callback(NotificationPtr(new Notification(JsValue(params[0])))); 551 auto notification = Notification(JsValue(params[0]));
552 callback(notification);
552 } 553 }
553 554
554 555
555 int FilterEngine::CompareVersions(const std::string& v1, const std::string& v2) const 556 int FilterEngine::CompareVersions(const std::string& v1, const std::string& v2) const
556 { 557 {
557 JsValueList params; 558 JsValueList params;
558 params.push_back(jsEngine->NewValue(v1)); 559 params.push_back(jsEngine->NewValue(v1));
559 params.push_back(jsEngine->NewValue(v2)); 560 params.push_back(jsEngine->NewValue(v2));
560 JsValue func = jsEngine->Evaluate("API.compareVersions"); 561 JsValue func = jsEngine->Evaluate("API.compareVersions");
561 return func.Call(params).AsInt(); 562 return func.Call(params).AsInt();
(...skipping 27 matching lines...) Expand all
589 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent Url); 590 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent Url);
590 if (filter) 591 if (filter)
591 { 592 {
592 return filter; 593 return filter;
593 } 594 }
594 currentUrl = parentUrl; 595 currentUrl = parentUrl;
595 } 596 }
596 while (urlIterator != documentUrls.end()); 597 while (urlIterator != documentUrls.end());
597 return FilterPtr(); 598 return FilterPtr();
598 } 599 }
OLDNEW
« no previous file with comments | « include/AdblockPlus/Notification.h ('k') | src/Notification.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld