Bug 1450982 - Remove old-event-emitter usage from devtools/shared; r=jryans.
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Tue, 03 Apr 2018 16:53:20 +0200
changeset 777809 bc75aa07f46f37719fda4ae7e0f45d893ba37a03
parent 777808 22194a92dbc7cae80afcdeb264160215f5bd9998
child 777810 a4a0483a84d9e52c8d49417af24588b62575de79
push id105296
push userpaolo.mozmail@amadzone.org
push dateThu, 05 Apr 2018 10:49:16 +0000
reviewersjryans
bugs1450982
milestone61.0a1
Bug 1450982 - Remove old-event-emitter usage from devtools/shared; r=jryans. MozReview-Commit-ID: 8Y68fHKyYXz
devtools/shared/apps/Devices.jsm
devtools/shared/discovery/discovery.js
devtools/shared/discovery/tests/unit/test_discovery.js
--- 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");
 });