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

Unified Diff: compiled/subscription/UserDefinedSubscription.h

Issue 29574591: Issue 5258 - Implement Filter::As<>() method to make working with filters easier from C++ code (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Removed unnecessary base class check Created Oct. 13, 2017, 4:57 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.h ('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
@@ -22,28 +22,20 @@
#include "../bindings/runtime.h"
class UserDefinedSubscription : public Subscription
{
private:
int mDefaults;
public:
+ static constexpr Type classType = Type::USERDEFINED;
explicit UserDefinedSubscription(const String& id);
bool BINDINGS_EXPORTED IsDefaultFor(const Filter& filter) const;
void BINDINGS_EXPORTED MakeDefaultFor(const Filter& filter);
bool BINDINGS_EXPORTED IsGeneric() const
{
return mDefaults == 0;
}
void BINDINGS_EXPORTED InsertFilterAt(Filter& filter, unsigned pos);
bool BINDINGS_EXPORTED RemoveFilterAt(unsigned pos);
OwnedString BINDINGS_EXPORTED 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.h ('k') | compiled/subscription/UserDefinedSubscription.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld