Bug 1460092: Add ESLint rule to enforce use of ChromeUtils.generateQI. r=Gijs
Also fixes existing code which fails the rule. MozReview-Commit-ID: CkLFgsspGMU
This commit is contained in:
@@ -46,12 +46,7 @@ classifierHelper.waitForInit = function() {
|
||||
}, "mozentries-update-finished");
|
||||
|
||||
let listener = {
|
||||
QueryInterface(iid) {
|
||||
if (iid.equals(Ci.nsISupports) ||
|
||||
iid.equals(Ci.nsIUrlClassifierUpdateObserver))
|
||||
return this;
|
||||
throw Cr.NS_ERROR_NO_INTERFACE;
|
||||
},
|
||||
QueryInterface: ChromeUtils.generateQI(["nsIUrlClassifierUpdateObserver"]),
|
||||
|
||||
handleEvent(value) {
|
||||
if (value === table) {
|
||||
@@ -137,13 +132,7 @@ classifierHelper._update = function(update) {
|
||||
try {
|
||||
await new Promise((resolve, reject) => {
|
||||
let listener = {
|
||||
QueryInterface(iid) {
|
||||
if (iid.equals(Ci.nsISupports) ||
|
||||
iid.equals(Ci.nsIUrlClassifierUpdateObserver))
|
||||
return this;
|
||||
|
||||
throw Cr.NS_ERROR_NO_INTERFACE;
|
||||
},
|
||||
QueryInterface: ChromeUtils.generateQI(["nsIUrlClassifierUpdateObserver"]),
|
||||
updateUrlRequested(url) { },
|
||||
streamFinished(status) { },
|
||||
updateError(errorCode) {
|
||||
|
||||
Reference in New Issue
Block a user