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

Unified Diff: compiled/subscription/UserDefinedSubscription.h

Issue 29426559: Issue 5137 - [emscripten] Added basic filter storage implementation (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Fixed bogus assert Created Aug. 31, 2017, 12:44 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 | « compiled/subscription/Subscription.cpp ('k') | compiled/subscription/UserDefinedSubscription.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiled/subscription/UserDefinedSubscription.h
===================================================================
--- a/compiled/subscription/UserDefinedSubscription.h
+++ b/compiled/subscription/UserDefinedSubscription.h
@@ -25,12 +25,25 @@ class UserDefinedSubscription : public S
{
private:
int mDefaults;
public:
explicit UserDefinedSubscription(const String& id);
BINDINGS_EXPORTED bool IsDefaultFor(const Filter* filter) const;
BINDINGS_EXPORTED void MakeDefaultFor(const Filter* filter);
+ BINDINGS_EXPORTED bool IsGeneric() const
+ {
+ return mDefaults == 0;
+ }
BINDINGS_EXPORTED void InsertFilterAt(Filter* filter, unsigned pos);
BINDINGS_EXPORTED bool RemoveFilterAt(unsigned pos);
BINDINGS_EXPORTED OwnedString Serialize() const;
};
+
+template<>
+inline UserDefinedSubscription* Subscription::As<UserDefinedSubscription>()
+{
+ if (mType != Type::USERDEFINED)
+ return nullptr;
+
+ return static_cast<UserDefinedSubscription*>(this);
+}
« no previous file with comments | « compiled/subscription/Subscription.cpp ('k') | compiled/subscription/UserDefinedSubscription.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld