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

Unified Diff: lib/subscriptionClasses.js

Issue 29853561: Issue 6854 - Remove deprecated FilterNotifier methods (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Aug. 11, 2018, 2:43 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
Index: lib/subscriptionClasses.js
===================================================================
--- a/lib/subscriptionClasses.js
+++ b/lib/subscriptionClasses.js
@@ -76,18 +76,17 @@
return this._title;
},
set title(value)
{
if (value != this._title)
{
let oldValue = this._title;
this._title = value;
- FilterNotifier.triggerListeners("subscription.title",
- this, value, oldValue);
+ FilterNotifier.emit("subscription.title", this, value, oldValue);
}
return this._title;
},
/**
* Determines whether the title should be editable
* @type {boolean}
*/
@@ -96,18 +95,17 @@
return this._fixedTitle;
},
set fixedTitle(value)
{
if (value != this._fixedTitle)
{
let oldValue = this._fixedTitle;
this._fixedTitle = value;
- FilterNotifier.triggerListeners("subscription.fixedTitle",
- this, value, oldValue);
+ FilterNotifier.emit("subscription.fixedTitle", this, value, oldValue);
}
return this._fixedTitle;
},
/**
* Defines whether the filters in the subscription should be disabled
* @type {boolean}
*/
@@ -116,18 +114,17 @@
return this._disabled;
},
set disabled(value)
{
if (value != this._disabled)
{
let oldValue = this._disabled;
this._disabled = value;
- FilterNotifier.triggerListeners("subscription.disabled",
- this, value, oldValue);
+ FilterNotifier.emit("subscription.disabled", this, value, oldValue);
}
return this._disabled;
},
/**
* Serializes the subscription to an array of strings for writing
* out on the disk.
* @param {string[]} buffer buffer to push the serialization results into
@@ -368,18 +365,17 @@
return this._homepage;
},
set homepage(value)
{
if (value != this._homepage)
{
let oldValue = this._homepage;
this._homepage = value;
- FilterNotifier.triggerListeners("subscription.homepage",
- this, value, oldValue);
+ FilterNotifier.emit("subscription.homepage", this, value, oldValue);
}
return this._homepage;
},
/**
* Time of the last subscription download (in seconds since the
* beginning of the epoch)
* @type {number}
@@ -389,18 +385,17 @@
return this._lastDownload;
},
set lastDownload(value)
{
if (value != this._lastDownload)
{
let oldValue = this._lastDownload;
this._lastDownload = value;
- FilterNotifier.triggerListeners("subscription.lastDownload",
- this, value, oldValue);
+ FilterNotifier.emit("subscription.lastDownload", this, value, oldValue);
}
return this._lastDownload;
},
/**
* See Subscription.serialize()
* @inheritdoc
*/
@@ -465,18 +460,17 @@
get downloadStatus()
{
return this._downloadStatus;
},
set downloadStatus(value)
{
let oldValue = this._downloadStatus;
this._downloadStatus = value;
- FilterNotifier.triggerListeners("subscription.downloadStatus",
- this, value, oldValue);
+ FilterNotifier.emit("subscription.downloadStatus", this, value, oldValue);
return this._downloadStatus;
},
/**
* Time of the last successful download (in seconds since the beginning of the
* epoch).
*/
lastSuccess: 0,
@@ -493,18 +487,17 @@
return this._lastCheck;
},
set lastCheck(value)
{
if (value != this._lastCheck)
{
let oldValue = this._lastCheck;
this._lastCheck = value;
- FilterNotifier.triggerListeners("subscription.lastCheck",
- this, value, oldValue);
+ FilterNotifier.emit("subscription.lastCheck", this, value, oldValue);
}
return this._lastCheck;
},
/**
* Hard expiration time of the filter subscription (in seconds since
* the beginning of the epoch)
* @type {number}
@@ -527,18 +520,17 @@
return this._errors;
},
set errors(value)
{
if (value != this._errors)
{
let oldValue = this._errors;
this._errors = value;
- FilterNotifier.triggerListeners("subscription.errors", this,
- value, oldValue);
+ FilterNotifier.emit("subscription.errors", this, value, oldValue);
}
return this._errors;
},
/**
* Version of the subscription data retrieved on last successful download
* @type {number}
*/
« no previous file with comments | « lib/filterStorage.js ('k') | lib/synchronizer.js » ('j') | test/filterNotifier.js » ('J')

Powered by Google App Engine
This is Rietveld