Index: compiled/filter/ActiveFilter.h |
=================================================================== |
--- a/compiled/filter/ActiveFilter.h |
+++ b/compiled/filter/ActiveFilter.h |
@@ -38,27 +38,49 @@ |
name = value;\ |
if (ABP_NS::FilterNotifier::Topic::topic != ABP_NS::FilterNotifier::Topic::NONE)\ |
{\ |
ABP_NS::FilterNotifier::FilterChange(ABP_NS::FilterNotifier::Topic::topic, *this);\ |
}\ |
}\ |
} |
+ |
ABP_NS_BEGIN |
+struct ParsedDomains |
+{ |
+ struct Domain { |
+ String::size_type pos; |
+ String::size_type len; |
+ bool reverse; |
+ }; |
+ bool hasIncludes; |
+ bool hasEmpty; |
+ std::vector<Domain> domains; |
+ |
+ ParsedDomains() |
+ : hasIncludes(false), hasEmpty(false) |
+ { |
+ } |
+}; |
+ |
class ActiveFilter : public Filter |
{ |
public: |
typedef StringMap<bool> DomainMap; |
virtual DomainMap* GetDomains() const; |
static const DependentString DEFAULT_DOMAIN; |
protected: |
typedef StringSet SitekeySet; |
- void ParseDomains(const String& domains, String::value_type separator) const; |
+ static ParsedDomains ParseDomainsInternal(const String& domains, |
+ String::value_type separator, bool ignoreTrailingDot); |
+ void FillDomains(const String& domains, const ParsedDomains& parsed) const; |
+ void ParseDomains(const String& domains, |
+ String::value_type separator, bool ignoreTrailingDot) const; |
void AddSitekey(const String& sitekey) const; |
virtual SitekeySet* GetSitekeys() const; |
mutable std::unique_ptr<DomainMap> mDomains; |
mutable std::unique_ptr<SitekeySet> mSitekeys; |
private: |
bool mIgnoreTrailingDot; |
public: |
static constexpr Type classType = Type::ACTIVE; |
@@ -72,9 +94,9 @@ |
const String& sitekey = DependentString()) const; |
bool BINDINGS_EXPORTED IsActiveOnlyOnDomain(DependentString& docDomain) const; |
bool BINDINGS_EXPORTED IsGeneric() const; |
OwnedString BINDINGS_EXPORTED Serialize() const; |
}; |
typedef intrusive_ptr<ActiveFilter> ActiveFilterPtr; |
-ABP_NS_END |
+ABP_NS_END |