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

Unified Diff: compiled/FilterNotifier.h

Issue 29426559: Issue 5137 - [emscripten] Added basic filter storage implementation (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Rebased Created May 10, 2017, 12:36 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 | « no previous file | compiled/bindings/generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiled/FilterNotifier.h
===================================================================
--- a/compiled/FilterNotifier.h
+++ b/compiled/FilterNotifier.h
@@ -25,49 +25,60 @@
class Filter;
class Subscription;
namespace FilterNotifier
{
enum class Topic
{
NONE,
+ FILTER_ADDED,
+ FILTER_REMOVED,
FILTER_DISABLED,
FILTER_HITCOUNT,
FILTER_LASTHIT,
+ SUBSCRIPTION_ADDED,
+ SUBSCRIPTION_REMOVED,
+ SUBSCRIPTION_MOVED,
SUBSCRIPTION_TITLE,
SUBSCRIPTION_DISABLED,
SUBSCRIPTION_FIXEDTITLE,
SUBSCRIPTION_HOMEPAGE,
SUBSCRIPTION_LASTCHECK,
SUBSCRIPTION_LASTDOWNLOAD,
SUBSCRIPTION_DOWNLOADSTATUS,
SUBSCRIPTION_ERRORS,
};
inline void GenerateCustomBindings()
{
printf("var FilterNotifier = require('filterNotifier').FilterNotifier;\n");
printf("var notifierTopics = new Map([\n");
+ printf(" [%i, 'filter.added'],\n", Topic::FILTER_ADDED);
+ printf(" [%i, 'filter.removed'],\n", Topic::FILTER_REMOVED);
printf(" [%i, 'filter.disabled'],\n", Topic::FILTER_DISABLED);
printf(" [%i, 'filter.hitCount'],\n", Topic::FILTER_HITCOUNT);
printf(" [%i, 'filter.lastHit'],\n", Topic::FILTER_LASTHIT);
+ printf(" [%i, 'subscription.added'],\n", Topic::SUBSCRIPTION_ADDED);
+ printf(" [%i, 'subscription.removed'],\n", Topic::SUBSCRIPTION_REMOVED);
+ printf(" [%i, 'subscription.moved'],\n", Topic::SUBSCRIPTION_MOVED);
printf(" [%i, 'subscription.title'],\n", Topic::SUBSCRIPTION_TITLE);
printf(" [%i, 'subscription.disabled'],\n", Topic::SUBSCRIPTION_DISABLED);
printf(" [%i, 'subscription.fixedTitle'],\n", Topic::SUBSCRIPTION_FIXEDTITLE);
printf(" [%i, 'subscription.homepage'],\n", Topic::SUBSCRIPTION_HOMEPAGE);
printf(" [%i, 'subscription.lastCheck'],\n", Topic::SUBSCRIPTION_LASTCHECK);
printf(" [%i, 'subscription.lastDownload'],\n", Topic::SUBSCRIPTION_LASTDOWNLOAD);
printf(" [%i, 'subscription.downloadStatus'],\n", Topic::SUBSCRIPTION_DOWNLOADSTATUS);
printf(" [%i, 'subscription.errors'],\n", Topic::SUBSCRIPTION_ERRORS);
printf("]);");
}
- inline void FilterChange(Topic topic, Filter* filter)
+ inline void FilterChange(Topic topic, Filter* filter,
+ Subscription* subscription = nullptr, unsigned int position = 0)
{
- JSNotifyFilterChange(topic, filter);
+ JSNotifyFilterChange(topic, filter, subscription, position);
}
inline void SubscriptionChange(Topic topic, Subscription* subscription)
{
JSNotifySubscriptionChange(topic, subscription);
}
}
« no previous file with comments | « no previous file | compiled/bindings/generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld