Bug 1450982 - Remove old-event-emitter usage from devtools/shared; r=jryans.
MozReview-Commit-ID: 8Y68fHKyYXz
--- a/devtools/shared/apps/Devices.jsm
+++ b/devtools/shared/apps/Devices.jsm
@@ -1,16 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {});
-const EventEmitter = require("devtools/shared/old-event-emitter");
+const EventEmitter = require("devtools/shared/event-emitter");
/* exported EXPORTED_SYMBOLS */
const EXPORTED_SYMBOLS = ["Devices"];
var addonInstalled = false;
const Devices = {
--- a/devtools/shared/discovery/discovery.js
+++ b/devtools/shared/discovery/discovery.js
@@ -27,17 +27,17 @@
* scan.
*
* When a service is registered, is supplies a regular object with any details
* about itself (a port number, for example) in a service-defined format, which
* is then available to scanning devices.
*/
const { Cu, CC, Cc, Ci } = require("chrome");
-const EventEmitter = require("devtools/shared/old-event-emitter");
+const EventEmitter = require("devtools/shared/event-emitter");
const Services = require("Services");
const UDPSocket = CC("@mozilla.org/network/udp-socket;1",
"nsIUDPSocket",
"init");
const SCAN_PORT = 50624;
const UPDATE_PORT = 50625;
@@ -354,17 +354,17 @@ Discovery.prototype = {
},
_onRemoteScan: function() {
// Send my own status in response
log("GOT SCAN REQUEST");
this._sendStatusTo(UPDATE_PORT);
},
- _onRemoteUpdate: function(e, update) {
+ _onRemoteUpdate: function(update) {
log("GOT REMOTE UPDATE");
let remoteDevice = update.device;
let remoteHost = update.from;
// Record the reply as received so it won't be purged as missing
this._expectingReplies.from.delete(remoteDevice);
--- a/devtools/shared/discovery/tests/unit/test_discovery.js
+++ b/devtools/shared/discovery/tests/unit/test_discovery.js
@@ -3,17 +3,17 @@
/* eslint-disable mozilla/no-arbitrary-setTimeout */
"use strict";
const { require } =
ChromeUtils.import("resource://devtools/shared/Loader.jsm", {});
const Services = require("Services");
const defer = require("devtools/shared/defer");
-const EventEmitter = require("devtools/shared/old-event-emitter");
+const EventEmitter = require("devtools/shared/event-emitter");
const discovery = require("devtools/shared/discovery/discovery");
const { setTimeout, clearTimeout } = ChromeUtils.import("resource://gre/modules/Timer.jsm", {});
Services.prefs.setBoolPref("devtools.discovery.log", true);
registerCleanupFunction(() => {
Services.prefs.clearUserPref("devtools.discovery.log");
});