Bug 1501621 - Enable ESLint for netwerk/dns/ and netwerk/protocol/ (manual changes) r=dragana,Standard8

Depends on D10590

Differential Revision: https://phabricator.services.mozilla.com/D10592

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Michael Kohler 2018-11-02 10:38:14 +00:00
Родитель d7204e528f
Коммит a2423373a9
8 изменённых файлов: 42 добавлений и 60 удалений

Просмотреть файл

@ -27,8 +27,6 @@ layout/**
memory/replace/dmd/test/**
modules/**
netwerk/cookie/test/browser/**
netwerk/protocol/**
netwerk/dns/**
netwerk/test/browser/**
netwerk/test/httpserver/**
netwerk/test/mochitests/**

Просмотреть файл

@ -8,7 +8,6 @@
var EXPORTED_SYMBOLS = ["MulticastDNS"];
ChromeUtils.import("resource://gre/modules/Messaging.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
const DEBUG = false;

Просмотреть файл

@ -8,16 +8,11 @@
var EXPORTED_SYMBOLS = ["DNSResourceRecord"];
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/DataReader.jsm");
ChromeUtils.import("resource://gre/modules/DataWriter.jsm");
ChromeUtils.import("resource://gre/modules/DNSRecord.jsm");
ChromeUtils.import("resource://gre/modules/DNSTypes.jsm");
function debug(msg) {
Services.console.logStringMessage("MulticastDNS: " + msg);
}
const DNS_RESOURCE_RECORD_DEFAULT_TTL = 120; // 120 seconds
class DNSResourceRecord extends DNSRecord {

Просмотреть файл

@ -10,7 +10,6 @@ var EXPORTED_SYMBOLS = ["MulticastDNS"];
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/Timer.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/DNSPacket.jsm");
ChromeUtils.import("resource://gre/modules/DNSRecord.jsm");
@ -19,8 +18,6 @@ ChromeUtils.import("resource://gre/modules/DNSTypes.jsm");
const NS_NETWORK_LINK_TOPIC = "network:link-status-changed";
let observerService = Cc["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService);
let networkInfoService = Cc["@mozilla.org/network-info-service;1"]
.createInstance(Ci.nsINetworkInfoService);
@ -127,7 +124,7 @@ class MulticastDNS {
if (!this._isNetworkLinkObserverAttached) {
DEBUG && debug("Attaching observer " + NS_NETWORK_LINK_TOPIC);
observerService.addObserver(this._networkLinkObserver, NS_NETWORK_LINK_TOPIC);
Services.obs.addObserver(this._networkLinkObserver, NS_NETWORK_LINK_TOPIC);
this._isNetworkLinkObserverAttached = true;
}
}
@ -140,7 +137,7 @@ class MulticastDNS {
this._networkLinkObserverTimeout = setTimeout(() => {
DEBUG && debug("Detaching observer " + NS_NETWORK_LINK_TOPIC);
observerService.removeObserver(this._networkLinkObserver, NS_NETWORK_LINK_TOPIC);
Services.obs.removeObserver(this._networkLinkObserver, NS_NETWORK_LINK_TOPIC);
this._isNetworkLinkObserverAttached = false;
this._networkLinkObserverTimeout = null;
}, 5000);
@ -347,7 +344,7 @@ class MulticastDNS {
// Go through services and find services to broadcast.
let bcastServices = [];
let nextBcastWait = undefined;
for (let [serviceKey, publishedService] of this._services) {
for (let [, publishedService] of this._services) {
// if lastAdvertised is undefined, service hasn't finished it's initial
// two broadcasts.
if (publishedService.lastAdvertised === undefined) {

Просмотреть файл

@ -1,26 +1,26 @@
<html>
<script language="javascript">
/* eslint-disable no-unsanitized/method */
<!--
function add_location(url) {
// faster to do this in one assignment, but who really cares.
// faster to do this in one assignment, but who really cares.
var string = '<LI> <a href=\"javascript: ftp_open(\'';
string += url;
string += '\')\"';
string += 'onmouseover=\"window.status=\'ftp://';
string += url;
string += '\'; return true; \">';
string += url;
string += "</a>";
document.writeln(string);
var string = '<LI> <a href=\"javascript: ftp_open(\'';
string += url;
string += '\')\"';
string += 'onmouseover=\"window.status=\'ftp://';
string += url;
string += '\'; return true; \">';
string += url;
string += "</a>";
document.writeln(string);
}
function ftp_open(url) {
url = "ftp://" + url;
parent.ftp_content.location = url;
url = "ftp://" + url;
parent.ftp_content.location = url;
}
// I like this format.
@ -28,12 +28,12 @@ document.writeln("<pre>");
document.writeln("<br><OL><b>Company sites</b>");
add_location("ftp.mozilla.org");
add_location("ftp.sun.com");
add_location("ftp.iplanet.com");
add_location("ftp.netscape.com");
add_location("ftp.apple.com");
add_location("ftp.microsoft.com");
add_location("ftp.netmanage.com");
add_location("ftp.sun.com");
add_location("ftp.iplanet.com");
add_location("ftp.netscape.com");
add_location("ftp.apple.com");
add_location("ftp.microsoft.com");
add_location("ftp.netmanage.com");
document.writeln("</OL><br><OL><b>Misc sites</b>");
add_location("cal044202.student.utwente.nl");

Просмотреть файл

@ -146,7 +146,6 @@ function buildOverrides() {
if (!Services.prefs.getBoolPref(PREF_OVERRIDES_ENABLED))
return;
let builtUAs = new Map;
let domains = gPrefBranch.getChildList("");
for (let domain of domains) {

Просмотреть файл

@ -28,12 +28,6 @@ ChromeUtils.defineModuleGetter(
XPCOMUtils.defineLazyServiceGetter(
this, "gUpdateTimer", "@mozilla.org/updates/timer-manager;1", "nsIUpdateTimerManager");
XPCOMUtils.defineLazyGetter(this, "gApp",
function() {
return Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo)
.QueryInterface(Ci.nsIXULRuntime);
});
XPCOMUtils.defineLazyGetter(this, "gDecoder",
function() { return new TextDecoder(); }
);
@ -183,11 +177,11 @@ var UserAgentUpdates = {
_getParameters() {
return {
"%DATE%": function() { return Date.now().toString(); },
"%PRODUCT%": function() { return gApp.name; },
"%APP_ID%": function() { return gApp.ID; },
"%APP_VERSION%": function() { return gApp.version; },
"%BUILD_ID%": function() { return gApp.appBuildID; },
"%OS%": function() { return gApp.OS; },
"%PRODUCT%": function() { return Services.appinfo.name; },
"%APP_ID%": function() { return Services.appinfo.ID; },
"%APP_VERSION%": function() { return Services.appinfo.version; },
"%BUILD_ID%": function() { return Services.appinfo.appBuildID; },
"%OS%": function() { return Services.appinfo.OS; },
"%CHANNEL%": function() { return UpdateUtils.UpdateChannel; },
"%DISTRIBUTION%": function() { return this._getPref(PREF_APP_DISTRIBUTION, ""); },
"%DISTRIBUTION_VERSION%": function() { return this._getPref(PREF_APP_DISTRIBUTION_VERSION, ""); },
@ -236,7 +230,7 @@ var UserAgentUpdates = {
_scheduleUpdate(retry) {
// only schedule updates in the main process
if (gApp.processType !== Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
if (Services.appinfo.processType !== Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
return;
}
let interval = this._getPref(PREF_UPDATES_INTERVAL, 604800 /* 1 week */);

Просмотреть файл

@ -22,20 +22,20 @@ WellKnownOpportunisticUtils.prototype = {
classDescription: "Well-Known Opportunistic Utils",
QueryInterface: ChromeUtils.generateQI([Ci.nsIWellKnownOpportunisticUtils]),
verify(aJSON, aOrigin, aAlternatePort) {
try {
let obj = JSON.parse(aJSON.toLowerCase());
let ports = obj[aOrigin.toLowerCase()]["tls-ports"];
if (!ports.includes(aAlternatePort)) {
throw "invalid port";
}
this.lifetime = obj[aOrigin.toLowerCase()].lifetime;
this.mixed = obj[aOrigin.toLowerCase()]["mixed-scheme"];
} catch (e) {
return;
}
this.valid = true;
},
verify(aJSON, aOrigin, aAlternatePort) {
try {
let obj = JSON.parse(aJSON.toLowerCase());
let ports = obj[aOrigin.toLowerCase()]["tls-ports"];
if (!ports.includes(aAlternatePort)) {
throw "invalid port";
}
this.lifetime = obj[aOrigin.toLowerCase()].lifetime;
this.mixed = obj[aOrigin.toLowerCase()]["mixed-scheme"];
} catch (e) {
return;
}
this.valid = true;
},
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WellKnownOpportunisticUtils]);