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

Unified Diff: src/FilterEngine.cpp

Issue 29419607: Issue 5163 - Reduce the use of FilterPtr (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created April 21, 2017, 1:04 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « shell/src/FiltersCommand.cpp ('k') | test/FilterEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/FilterEngine.cpp
===================================================================
--- a/src/FilterEngine.cpp
+++ b/src/FilterEngine.cpp
@@ -271,35 +271,35 @@
throw std::invalid_argument("Cannot convert argument to ContentType");
}
bool FilterEngine::IsFirstRun() const
{
return firstRun;
}
-FilterPtr FilterEngine::GetFilter(const std::string& text) const
+Filter FilterEngine::GetFilter(const std::string& text) const
{
JsValue func = jsEngine->Evaluate("API.getFilterFromText");
- return FilterPtr(new Filter(func.Call(jsEngine->NewValue(text))));
+ return Filter(func.Call(jsEngine->NewValue(text)));
}
SubscriptionPtr FilterEngine::GetSubscription(const std::string& url) const
{
JsValue func = jsEngine->Evaluate("API.getSubscriptionFromUrl");
return SubscriptionPtr(new Subscription(func.Call(jsEngine->NewValue(url))));
}
-std::vector<FilterPtr> FilterEngine::GetListedFilters() const
+std::vector<Filter> FilterEngine::GetListedFilters() const
{
JsValue func = jsEngine->Evaluate("API.getListedFilters");
JsValueList values = func.Call().AsList();
- std::vector<FilterPtr> result;
+ std::vector<Filter> result;
for (JsValueList::iterator it = values.begin(); it != values.end(); it++)
- result.push_back(FilterPtr(new Filter(std::move(*it))));
+ result.push_back(Filter(std::move(*it)));
return result;
}
std::vector<SubscriptionPtr> FilterEngine::GetListedSubscriptions() const
{
JsValue func = jsEngine->Evaluate("API.getListedSubscriptions");
JsValueList values = func.Call().AsList();
std::vector<SubscriptionPtr> result;
« no previous file with comments | « shell/src/FiltersCommand.cpp ('k') | test/FilterEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld