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

Unified Diff: compiled/subscription/UserDefinedSubscription.cpp

Issue 29532626: Issue 5603 - Support references in parameters of exported functions (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Created Aug. 31, 2017, 12:36 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
Index: compiled/subscription/UserDefinedSubscription.cpp
===================================================================
--- a/compiled/subscription/UserDefinedSubscription.cpp
+++ b/compiled/subscription/UserDefinedSubscription.cpp
@@ -47,60 +47,60 @@ namespace
);
}
UserDefinedSubscription::UserDefinedSubscription(const String& id)
: Subscription(Type::USERDEFINED, id), mDefaults(0)
{
}
-bool UserDefinedSubscription::IsDefaultFor(const Filter* filter) const
+bool UserDefinedSubscription::IsDefaultFor(const Filter& filter) const
{
- if (filter->mType >= Filter::Type::VALUE_COUNT)
+ if (filter.mType >= Filter::Type::VALUE_COUNT)
{
assert(false, "Filter type exceeds valid range");
abort();
}
- return mDefaults & filterTypeToCategory[filter->mType];
+ return mDefaults & filterTypeToCategory[filter.mType];
}
-void UserDefinedSubscription::MakeDefaultFor(const Filter* filter)
+void UserDefinedSubscription::MakeDefaultFor(const Filter& filter)
{
- if (filter->mType >= Filter::Type::VALUE_COUNT)
+ if (filter.mType >= Filter::Type::VALUE_COUNT)
{
assert(false, "Filter type exceeds valid range");
abort();
}
- mDefaults |= filterTypeToCategory[filter->mType];
+ mDefaults |= filterTypeToCategory[filter.mType];
}
-void UserDefinedSubscription::InsertFilterAt(Filter* filter, unsigned pos)
+void UserDefinedSubscription::InsertFilterAt(Filter& filter, unsigned pos)
{
if (pos >= mFilters.size())
pos = mFilters.size();
- mFilters.emplace(mFilters.begin() + pos, filter);
+ mFilters.emplace(mFilters.begin() + pos, &filter);
if (GetListed())
{
- FilterNotifier::FilterChange(FilterNotifier::Topic::FILTER_ADDED, filter, this,
- pos);
+ FilterNotifier::FilterChange(FilterNotifier::Topic::FILTER_ADDED, filter,
+ this, pos);
}
}
bool UserDefinedSubscription::RemoveFilterAt(unsigned pos)
{
if (pos >= mFilters.size())
return false;
FilterPtr filter(mFilters[pos]);
mFilters.erase(mFilters.begin() + pos);
if (GetListed())
{
FilterNotifier::FilterChange(FilterNotifier::Topic::FILTER_REMOVED,
- filter.get(), this, pos);
+ *filter.get(), this, pos);
}
return true;
}
OwnedString UserDefinedSubscription::Serialize() const
{
OwnedString result(Subscription::Serialize());
if (!IsGeneric())
« compiled/bindings/generator.cpp ('K') | « compiled/subscription/UserDefinedSubscription.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld