OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 GetErrorCount, SetErrorCount); | 46 GetErrorCount, SetErrorCount); |
47 SUBSCRIPTION_PROPERTY(uint64_t, mDataRevision, NONE, | 47 SUBSCRIPTION_PROPERTY(uint64_t, mDataRevision, NONE, |
48 GetDataRevision, SetDataRevision); | 48 GetDataRevision, SetDataRevision); |
49 SUBSCRIPTION_STRING_PROPERTY(mRequiredVersion, NONE, | 49 SUBSCRIPTION_STRING_PROPERTY(mRequiredVersion, NONE, |
50 GetRequiredVersion, SetRequiredVersion); | 50 GetRequiredVersion, SetRequiredVersion); |
51 SUBSCRIPTION_PROPERTY(int, mDownloadCount, NONE, | 51 SUBSCRIPTION_PROPERTY(int, mDownloadCount, NONE, |
52 GetDownloadCount, SetDownloadCount); | 52 GetDownloadCount, SetDownloadCount); |
53 | 53 |
54 EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const; | 54 EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const; |
55 }; | 55 }; |
| 56 |
| 57 template<> |
| 58 inline DownloadableSubscription* Subscription::As<DownloadableSubscription>() |
| 59 { |
| 60 if (mType != Type::DOWNLOADABLE) |
| 61 return nullptr; |
| 62 |
| 63 return static_cast<DownloadableSubscription*>(this); |
| 64 } |
OLD | NEW |