forked from mirrors/gecko-dev
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:
parent
d7204e528f
commit
a2423373a9
8 changed files with 42 additions and 60 deletions
|
|
@ -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,7 +1,7 @@
|
|||
<html>
|
||||
|
||||
<script language="javascript">
|
||||
|
||||
/* eslint-disable no-unsanitized/method */
|
||||
<!--
|
||||
|
||||
function add_location(url) {
|
||||
|
|
|
|||
|
|
@ -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 */);
|
||||
|
|
|
|||
Loading…
Reference in a new issue