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

Delta Between Two Patch Sets: compiled/subscription/Subscription.h

Issue 29398669: Issue 5063 - [emscripten] Make FilterNotifier calls more efficient (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Left Patch Set: Rebased Created April 13, 2017, 1:07 p.m.
Right Patch Set: Addressed comments Created April 20, 2017, 8 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « compiled/subscription/DownloadableSubscription.h ('k') | test/filterClasses.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 20 matching lines...) Expand all
31 field_type name;\ 31 field_type name;\
32 public:\ 32 public:\
33 param_type EMSCRIPTEN_KEEPALIVE getter() const\ 33 param_type EMSCRIPTEN_KEEPALIVE getter() const\
34 {\ 34 {\
35 return name;\ 35 return name;\
36 }\ 36 }\
37 void EMSCRIPTEN_KEEPALIVE setter(param_type value)\ 37 void EMSCRIPTEN_KEEPALIVE setter(param_type value)\
38 {\ 38 {\
39 if (name != value)\ 39 if (name != value)\
40 {\ 40 {\
41 field_type oldvalue = name;\
42 name = value;\ 41 name = value;\
43 if (FilterNotifier::Topic::topic != FilterNotifier::Topic::NONE)\ 42 if (FilterNotifier::Topic::topic != FilterNotifier::Topic::NONE)\
44 {\ 43 {\
45 FilterNotifier::PropertyChange(FilterNotifier::Topic::topic,\ 44 FilterNotifier::SubscriptionChange(FilterNotifier::Topic::topic,\
46 this, value, oldvalue);\ 45 this);\
47 }\ 46 }\
48 }\ 47 }\
49 } 48 }
50 49
51 #define SUBSCRIPTION_PROPERTY(type, name, topic, getter, setter) \ 50 #define SUBSCRIPTION_PROPERTY(type, name, topic, getter, setter) \
52 static_assert(std::is_arithmetic<type>::value, "SUBSCRIPTION_PROPERTY macro can only be used with arithmetic types");\ 51 static_assert(std::is_arithmetic<type>::value, "SUBSCRIPTION_PROPERTY macro can only be used with arithmetic types");\
53 SUBSCRIPTION_PROPERTY_INTERNAL(type, type, name, topic, getter, setter) 52 SUBSCRIPTION_PROPERTY_INTERNAL(type, type, name, topic, getter, setter)
54 53
55 #define SUBSCRIPTION_STRING_PROPERTY(name, topic, getter, setter) \ 54 #define SUBSCRIPTION_STRING_PROPERTY(name, topic, getter, setter) \
56 SUBSCRIPTION_PROPERTY_INTERNAL(OwnedString, const String&, name, topic, gett er, setter) 55 SUBSCRIPTION_PROPERTY_INTERNAL(OwnedString, const String&, name, topic, gett er, setter)
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 89
91 EMSCRIPTEN_KEEPALIVE Filter* FilterAt(unsigned index); 90 EMSCRIPTEN_KEEPALIVE Filter* FilterAt(unsigned index);
92 EMSCRIPTEN_KEEPALIVE int IndexOfFilter(Filter* filter); 91 EMSCRIPTEN_KEEPALIVE int IndexOfFilter(Filter* filter);
93 EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const; 92 EMSCRIPTEN_KEEPALIVE OwnedString Serialize() const;
94 EMSCRIPTEN_KEEPALIVE OwnedString SerializeFilters() const; 93 EMSCRIPTEN_KEEPALIVE OwnedString SerializeFilters() const;
95 94
96 static EMSCRIPTEN_KEEPALIVE Subscription* FromID(const String& id); 95 static EMSCRIPTEN_KEEPALIVE Subscription* FromID(const String& id);
97 }; 96 };
98 97
99 typedef intrusive_ptr<Subscription> SubscriptionPtr; 98 typedef intrusive_ptr<Subscription> SubscriptionPtr;
LEFTRIGHT

Powered by Google App Engine
This is Rietveld