Bug 1391562 - use obj.on/off/emit rather than static methods from devtools event-emitter;r=zer0
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 18 Aug 2017 17:05:04 +0200
changeset 377818 e54ed7547a3e9deec8c94f638c91eb5c587a584a
parent 377817 19738c33b0f5b9db157ddaeec579db2776500fbf
child 377819 0145883aea3a74740298a2dc3072e4a4e80c8570
push id32416
push userarchaeopteryx@coole-files.de
push dateThu, 31 Aug 2017 12:35:23 +0000
treeherdermozilla-central@c9079d347aaa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerszer0
bugs1391562
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1391562 - use obj.on/off/emit rather than static methods from devtools event-emitter;r=zer0 MozReview-Commit-ID: I50W8zGB9d0
devtools/client/debugger/test/mochitest/browser_dbg_promises-allocation-stack.js
devtools/client/debugger/test/mochitest/browser_dbg_promises-chrome-allocation-stack.js
devtools/client/debugger/test/mochitest/browser_dbg_promises-fulfillment-stack.js
devtools/client/debugger/test/mochitest/browser_dbg_promises-rejection-stack.js
devtools/client/inspector/markup/test/actor_events_form.js
devtools/docs/backend/actor-best-practices.md
devtools/docs/backend/protocol.js.md
devtools/server/actors/animation.js
devtools/server/actors/call-watcher.js
devtools/server/actors/csscoverage.js
devtools/server/actors/eventlooplag.js
devtools/server/actors/gcli.js
devtools/server/actors/highlighters.js
devtools/server/actors/highlighters/measuring-tool.js
devtools/server/actors/highlighters/rulers.js
devtools/server/actors/highlighters/utils/markup.js
devtools/server/actors/inspector.js
devtools/server/actors/memory.js
devtools/server/actors/performance-entries.js
devtools/server/actors/performance.js
devtools/server/actors/profiler.js
devtools/server/actors/promises.js
devtools/server/actors/reflow.js
devtools/server/actors/script.js
devtools/server/actors/storage.js
devtools/server/actors/styleeditor.js
devtools/server/actors/styles.js
devtools/server/actors/stylesheets.js
devtools/server/actors/tab.js
devtools/server/actors/timeline.js
devtools/server/actors/webaudio.js
devtools/server/actors/webconsole.js
devtools/server/actors/webgl.js
devtools/server/actors/worker.js
devtools/server/main.js
devtools/server/performance/framerate.js
devtools/server/performance/memory.js
devtools/server/performance/profiler.js
devtools/server/performance/recorder.js
devtools/server/performance/timeline.js
devtools/server/tests/browser/browser_navigateEvents.js
devtools/server/tests/mochitest/test_memory_gc_events.html
devtools/server/tests/unit/test_layout-reflows-observer.js
devtools/server/tests/unit/test_promises_actor_onnewpromise.js
devtools/server/tests/unit/test_promises_actor_onpromisesettled.js
devtools/server/tests/unit/test_promises_client_getdependentpromises.js
devtools/server/tests/unit/test_promises_object_creationtimestamp.js
devtools/server/tests/unit/test_promises_object_timetosettle-01.js
devtools/server/tests/unit/test_promises_object_timetosettle-02.js
devtools/server/tests/unit/test_protocol_children.js
devtools/server/tests/unit/test_protocol_longstring.js
devtools/server/tests/unit/test_protocol_simple.js
devtools/shared/client/main.js
devtools/shared/content-observer.js
devtools/shared/fronts/inspector.js
devtools/shared/fronts/profiler.js
devtools/shared/fronts/styleeditor.js
devtools/shared/fronts/stylesheets.js
devtools/shared/gcli/commands/measure.js
devtools/shared/gcli/commands/rulers.js
--- a/devtools/client/debugger/test/mochitest/browser_dbg_promises-allocation-stack.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_promises-allocation-stack.js
@@ -6,17 +6,17 @@
 /**
  * Test that we can get a stack to a promise's allocation point.
  */
 
 "use strict";
 
 const TAB_URL = EXAMPLE_URL + "doc_promise-get-allocation-stack.html";
 const { PromisesFront } = require("devtools/shared/fronts/promises");
-var events = require("devtools/shared/event-emitter");
+var EventEmitter = require("devtools/shared/event-emitter");
 
 function test() {
   Task.spawn(function* () {
     DebuggerServer.init();
     DebuggerServer.addBrowserActors();
 
     let options = {
       source: TAB_URL,
@@ -43,17 +43,17 @@ function test() {
 function* testGetAllocationStack(client, form, tab) {
   let front = PromisesFront(client, form);
 
   yield front.attach();
   yield front.listPromises();
 
   // Get the grip for promise p
   let onNewPromise = new Promise(resolve => {
-    events.on(front, "new-promises", promises => {
+    EventEmitter.on(front, "new-promises", promises => {
       for (let p of promises) {
         if (p.preview.ownProperties.name &&
             p.preview.ownProperties.name.value === "p") {
           resolve(p);
         }
       }
     });
   });
--- a/devtools/client/debugger/test/mochitest/browser_dbg_promises-chrome-allocation-stack.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_promises-chrome-allocation-stack.js
@@ -7,17 +7,17 @@
  * Test that we can get a stack to a promise's allocation point in the chrome
  * process.
  */
 
 "use strict";
 
 const SOURCE_URL = "browser_dbg_promises-chrome-allocation-stack.js";
 const PromisesFront = require("devtools/shared/fronts/promises");
-var events = require("devtools/shared/event-emitter");
+var EventEmitter = require("devtools/shared/event-emitter");
 
 const STACK_DATA = [
   { functionDisplayName: "test/</<" },
   { functionDisplayName: "testGetAllocationStack" },
 ];
 
 function test() {
   Task.spawn(function* () {
@@ -52,17 +52,17 @@ function test() {
 function* testGetAllocationStack(client, form, makePromises) {
   let front = PromisesFront(client, form);
 
   yield front.attach();
   yield front.listPromises();
 
   // Get the grip for promise p
   let onNewPromise = new Promise(resolve => {
-    events.on(front, "new-promises", promises => {
+    EventEmitter.on(front, "new-promises", promises => {
       for (let p of promises) {
         if (p.preview.ownProperties.name &&
             p.preview.ownProperties.name.value === "p") {
           resolve(p);
         }
       }
     });
   });
--- a/devtools/client/debugger/test/mochitest/browser_dbg_promises-fulfillment-stack.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_promises-fulfillment-stack.js
@@ -6,17 +6,17 @@
 /**
  * Test that we can get a stack to a promise's fulfillment point.
  */
 
 "use strict";
 
 const TAB_URL = EXAMPLE_URL + "doc_promise-get-fulfillment-stack.html";
 const { PromisesFront } = require("devtools/shared/fronts/promises");
-var events = require("devtools/shared/event-emitter");
+var EventEmitter = require("devtools/shared/event-emitter");
 
 const TEST_DATA = [
   {
     functionDisplayName: "returnPromise/<",
     line: 19,
     column: 37
   },
   {
@@ -61,17 +61,17 @@ function test() {
 function* testGetFulfillmentStack(client, form, tab) {
   let front = PromisesFront(client, form);
 
   yield front.attach();
   yield front.listPromises();
 
   // Get the grip for promise p
   let onNewPromise = new Promise(resolve => {
-    events.on(front, "new-promises", promises => {
+    EventEmitter.on(front, "new-promises", promises => {
       for (let p of promises) {
         if (p.preview.ownProperties.name &&
             p.preview.ownProperties.name.value === "p") {
           resolve(p);
         }
       }
     });
   });
--- a/devtools/client/debugger/test/mochitest/browser_dbg_promises-rejection-stack.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_promises-rejection-stack.js
@@ -6,17 +6,17 @@
 /**
  * Test that we can get a stack to a promise's rejection point.
  */
 
 "use strict";
 
 const TAB_URL = EXAMPLE_URL + "doc_promise-get-rejection-stack.html";
 const { PromisesFront } = require("devtools/shared/fronts/promises");
-var events = require("devtools/shared/event-emitter");
+var EventEmitter = require("devtools/shared/event-emitter");
 
 // The code in the document above leaves an uncaught rejection. This is only
 // reported to the testing framework if the code is loaded in the main process.
 if (!gMultiProcessBrowser) {
   Cu.import("resource://testing-common/PromiseTestUtils.jsm", this);
   PromiseTestUtils.expectUncaughtRejection(/hello/);
 }
 
@@ -68,17 +68,17 @@ function test() {
 function* testGetRejectionStack(client, form, tab) {
   let front = PromisesFront(client, form);
 
   yield front.attach();
   yield front.listPromises();
 
   // Get the grip for promise p
   let onNewPromise = new Promise(resolve => {
-    events.on(front, "new-promises", promises => {
+    EventEmitter.on(front, "new-promises", promises => {
       for (let p of promises) {
         if (p.preview.ownProperties.name &&
             p.preview.ownProperties.name.value === "p") {
           resolve(p);
         }
       }
     });
   });
--- a/devtools/client/inspector/markup/test/actor_events_form.js
+++ b/devtools/client/inspector/markup/test/actor_events_form.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // This test actor is used for testing the addition of custom form data
 // on NodeActor. Custom form property is set when 'form' event is sent
 // by NodeActor actor (see 'onNodeActorForm' method).
 
-const Events = require("devtools/shared/event-emitter");
+const EventEmitter = require("devtools/shared/event-emitter");
 const {ActorClassWithSpec, Actor, FrontClassWithSpec, Front, generateActorSpec} =
   require("devtools/shared/protocol");
 
 const {NodeActor} = require("devtools/server/actors/inspector");
 
 var eventsSpec = generateActorSpec({
   typeName: "eventsFormActor",
 
@@ -29,21 +29,21 @@ var eventsSpec = generateActorSpec({
 });
 
 var EventsFormActor = ActorClassWithSpec(eventsSpec, {
   initialize: function () {
     Actor.prototype.initialize.apply(this, arguments);
   },
 
   attach: function () {
-    Events.on(NodeActor, "form", this.onNodeActorForm);
+    EventEmitter.on(NodeActor, "form", this.onNodeActorForm);
   },
 
   detach: function () {
-    Events.off(NodeActor, "form", this.onNodeActorForm);
+    EventEmitter.off(NodeActor, "form", this.onNodeActorForm);
   },
 
   onNodeActorForm: function (event) {
     let nodeActor = event.target;
     if (nodeActor.rawNode.id == "container") {
       let form = event.data;
       form.setFormProperty("test-property", "test-value");
     }
--- a/devtools/docs/backend/actor-best-practices.md
+++ b/devtools/docs/backend/actor-best-practices.md
@@ -14,18 +14,18 @@ Then there's no need for the client to s
 
 ## Actor Destruction
 
 Ensure that the actor's destroy is really destroying everything that it should. Here's an example from the animation actor:
 
 ```js
 destroy: function() {
   Actor.prototype.destroy.call(this);
-  events.off(this.tabActor, "will-navigate", this.onWillNavigate);
-  events.off(this.tabActor, "navigate", this.onNavigate);
+  this.tabActor.off("will-navigate", this.onWillNavigate);
+  this.tabActor.off("navigate", this.onNavigate);
 
   this.stopAnimationPlayerUpdates();
   this.tabActor = this.observer = this.actors = null;
 },
 ```
 
 ## Child Actors
 
--- a/devtools/docs/backend/protocol.js.md
+++ b/devtools/docs/backend/protocol.js.md
@@ -482,21 +482,21 @@ Here's how you'd set it up in a spec:
     methods: {
       giveGoodNews: {
         request: { news: Arg(0) }
       }
     }
 
 Here's how the implementation would look:
 
-    const event = require("devtools/shared/event-emitter");
+    const EventEmitter = require("devtools/shared/event-emitter");
 
     // In your protocol.ActorClassWithSpec definition:
     giveGoodNews: function (news) {
-      event.emit(this, "good-news", news);
+      EventEmitter.emit(this, "good-news", news);
     }
 
 Now you can listen to events on a front:
 
     front.on("good-news", news => {
       console.log(`Got some good news: ${news}\n`);
     });
     front.giveGoodNews().then(() => { console.log("request returned.") });
--- a/devtools/server/actors/animation.js
+++ b/devtools/server/actors/animation.js
@@ -25,17 +25,16 @@
  *   /dom/webidl/Animation*.webidl
  */
 
 const {Cu, Ci} = require("chrome");
 const promise = require("promise");
 const protocol = require("devtools/shared/protocol");
 const {Actor} = protocol;
 const {animationPlayerSpec, animationsSpec} = require("devtools/shared/specs/animation");
-const events = require("devtools/shared/event-emitter");
 
 // Types of animations.
 const ANIMATION_TYPES = {
   CSS_ANIMATION: "cssanimation",
   CSS_TRANSITION: "csstransition",
   SCRIPT_ANIMATION: "scriptanimation",
   UNKNOWN: "unknown"
 };
@@ -380,17 +379,17 @@ var AnimationPlayerActor = protocol.Acto
                      newState.iterationStart !== oldState.iterationStart ||
                      newState.duration !== oldState.duration ||
                      newState.endDelay !== oldState.endDelay;
         break;
       }
     }
 
     if (hasChanged) {
-      events.emit(this, "changed", this.getCurrentState());
+      this.emit("changed", this.getCurrentState());
     }
   },
 
   /**
    * Pause the player.
    */
   pause: function () {
     this.player.pause();
@@ -590,24 +589,24 @@ exports.AnimationsActor = protocol.Actor
     Actor.prototype.initialize.call(this, conn);
     this.tabActor = tabActor;
 
     this.onWillNavigate = this.onWillNavigate.bind(this);
     this.onNavigate = this.onNavigate.bind(this);
     this.onAnimationMutation = this.onAnimationMutation.bind(this);
 
     this.allAnimationsPaused = false;
-    events.on(this.tabActor, "will-navigate", this.onWillNavigate);
-    events.on(this.tabActor, "navigate", this.onNavigate);
+    this.tabActor.on("will-navigate", this.onWillNavigate);
+    this.tabActor.on("navigate", this.onNavigate);
   },
 
   destroy: function () {
     Actor.prototype.destroy.call(this);
-    events.off(this.tabActor, "will-navigate", this.onWillNavigate);
-    events.off(this.tabActor, "navigate", this.onNavigate);
+    this.tabActor.off("will-navigate", this.onWillNavigate);
+    this.tabActor.off("navigate", this.onNavigate);
 
     this.stopAnimationPlayerUpdates();
     this.tabActor = this.observer = this.actors = this.walker = null;
   },
 
   /**
    * Clients can optionally call this with a reference to their WalkerActor.
    * If they do, then AnimationPlayerActor's forms are going to also include
@@ -724,17 +723,17 @@ exports.AnimationsActor = protocol.Actor
         readyPromises.push(player.ready);
       }
     }
 
     if (eventData.length) {
       // Let's wait for all added animations to be ready before telling the
       // front-end.
       Promise.all(readyPromises).then(() => {
-        events.emit(this, "mutations", eventData);
+        this.emit("mutations", eventData);
       });
     }
   },
 
   /**
    * After the client has called getAnimationPlayersForNode for a given DOM
    * node, the actor starts sending animation mutations for this node. If the
    * client doesn't want this to happen anymore, it should call this method.
--- a/devtools/server/actors/call-watcher.js
+++ b/devtools/server/actors/call-watcher.js
@@ -1,22 +1,19 @@
 /* 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";
 
 /* global XPCNativeWrapper */
 
 const {Ci, Cu} = require("chrome");
-const events = require("devtools/shared/event-emitter");
 const protocol = require("devtools/shared/protocol");
 const {serializeStack, parseStack} = require("toolkit/loader");
 
-const {on, off, emit} = events;
-
 const { functionCallSpec, callWatcherSpec } = require("devtools/shared/specs/call-watcher");
 const { CallWatcherFront } = require("devtools/shared/fronts/call-watcher");
 
 /**
  * This actor contains information about a function call, like the function
  * type, name, stack, arguments, returned value etc.
  */
 var FunctionCallActor = protocol.ActorClassWithSpec(functionCallSpec, {
@@ -232,23 +229,23 @@ var FunctionCallActor = protocol.ActorCl
  */
 exports.CallWatcherActor = protocol.ActorClassWithSpec(callWatcherSpec, {
   initialize: function (conn, tabActor) {
     protocol.Actor.prototype.initialize.call(this, conn);
     this.tabActor = tabActor;
     this._onGlobalCreated = this._onGlobalCreated.bind(this);
     this._onGlobalDestroyed = this._onGlobalDestroyed.bind(this);
     this._onContentFunctionCall = this._onContentFunctionCall.bind(this);
-    on(this.tabActor, "window-ready", this._onGlobalCreated);
-    on(this.tabActor, "window-destroyed", this._onGlobalDestroyed);
+    this.tabActor.on("window-ready", this._onGlobalCreated);
+    this.tabActor.on("window-destroyed", this._onGlobalDestroyed);
   },
   destroy: function (conn) {
     protocol.Actor.prototype.destroy.call(this, conn);
-    off(this.tabActor, "window-ready", this._onGlobalCreated);
-    off(this.tabActor, "window-destroyed", this._onGlobalDestroyed);
+    this.tabActor.off("window-ready", this._onGlobalCreated);
+    this.tabActor.off("window-destroyed", this._onGlobalDestroyed);
     this.finalize();
   },
 
   /**
    * Lightweight listener invoked whenever an instrumented function is called
    * while recording. We're doing this to avoid the event emitter overhead,
    * since this is expected to be a very hot function.
    */
@@ -538,17 +535,17 @@ exports.CallWatcherActor = protocol.Acto
 
     if (this._storeCalls) {
       this._functionCalls.push(functionCall);
     }
 
     if (this.onCall) {
       this.onCall(functionCall);
     } else {
-      emit(this, "call", functionCall);
+      this.emit("call", functionCall);
     }
   }
 });
 
 /**
  * A lookup table for cross-referencing flags or properties with their name
  * assuming they look LIKE_THIS most of the time.
  *
--- a/devtools/server/actors/csscoverage.js
+++ b/devtools/server/actors/csscoverage.js
@@ -4,17 +4,16 @@
 
 "use strict";
 
 const { Cc, Ci } = require("chrome");
 
 const Services = require("Services");
 const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
 
-const events = require("devtools/shared/event-emitter");
 const protocol = require("devtools/shared/protocol");
 const { cssUsageSpec } = require("devtools/shared/specs/csscoverage");
 
 loader.lazyGetter(this, "DOMUtils", () => {
   return Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
 });
 loader.lazyRequireGetter(this, "stylesheets", "devtools/server/actors/stylesheets");
 loader.lazyRequireGetter(this, "prettifyCSS", "devtools/shared/inspector/css-logic", true);
@@ -130,32 +129,32 @@ var CSSUsageActor = protocol.ActorClassW
     if (noreload) {
       // If we're not starting by reloading the page, then pretend that onload
       // has just happened.
       this._onTabLoad(this._tabActor.window.document);
     } else {
       this._tabActor.window.location.reload();
     }
 
-    events.emit(this, "state-change", { isRunning: true });
+    this.emit("state-change", { isRunning: true });
   },
 
   /**
    * Cease recording usage data
    */
   stop: function () {
     if (!this._running) {
       throw new Error(l10n.lookup("csscoverageNotRunningError"));
     }
 
     this._progress.removeProgressListener(this._progressListener, this._notifyOn);
     this._progress = undefined;
 
     this._running = false;
-    events.emit(this, "state-change", { isRunning: false });
+    this.emit("state-change", { isRunning: false });
   },
 
   /**
    * Start/stop recording usage data depending on what we're currently doing.
    */
   toggle: function () {
     return this._running ? this.stop() : this.start();
   },
--- a/devtools/server/actors/eventlooplag.js
+++ b/devtools/server/actors/eventlooplag.js
@@ -9,17 +9,16 @@
  * loop gets unresponsive. The event comes with a "time" property (the
  * duration of the lag in milliseconds).
  */
 
 const {Ci} = require("chrome");
 const Services = require("Services");
 const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
 const {Actor, ActorClassWithSpec} = require("devtools/shared/protocol");
-const events = require("devtools/shared/event-emitter");
 const {eventLoopLagSpec} = require("devtools/shared/specs/eventlooplag");
 
 exports.EventLoopLagActor = ActorClassWithSpec(eventLoopLagSpec, {
   _observerAdded: false,
 
   /**
    * Start tracking the event loop lags.
    */
@@ -47,14 +46,14 @@ exports.EventLoopLagActor = ActorClassWi
     Actor.prototype.destroy.call(this);
   },
 
   // nsIObserver
 
   observe: function (subject, topic, data) {
     if (topic == "event-loop-lag") {
       // Forward event loop lag event
-      events.emit(this, "event-loop-lag", data);
+      this.emit("event-loop-lag", data);
     }
   },
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
 });
--- a/devtools/server/actors/gcli.js
+++ b/devtools/server/actors/gcli.js
@@ -1,17 +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 { Actor, ActorClassWithSpec } = require("devtools/shared/protocol");
 const { gcliSpec } = require("devtools/shared/specs/gcli");
-const events = require("devtools/shared/event-emitter");
 const { createSystem } = require("gcli/system");
 
 /**
  * Manage remote connections that want to talk to GCLI
  */
 const GcliActor = ActorClassWithSpec(gcliSpec, {
   initialize: function (conn, tabActor) {
     Actor.prototype.initialize.call(this, conn);
@@ -217,13 +216,13 @@ const GcliActor = ActorClassWithSpec(gcl
 
     return this._requisitionPromise;
   },
 
   /**
    * Pass events from requisition.system.commands.onCommandsChange upwards
    */
   _commandsChanged: function () {
-    events.emit(this, "commands-changed");
+    this.emit("commands-changed");
   },
 });
 
 exports.GcliActor = GcliActor;
--- a/devtools/server/actors/highlighters.js
+++ b/devtools/server/actors/highlighters.js
@@ -3,17 +3,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { Ci, Cu } = require("chrome");
 
 const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
 const EventEmitter = require("devtools/shared/old-event-emitter");
-const events = require("devtools/shared/event-emitter");
 const protocol = require("devtools/shared/protocol");
 const Services = require("Services");
 const { isWindowIncluded } = require("devtools/shared/layout/utils");
 const { highlighterSpec, customHighlighterSpec } = require("devtools/shared/specs/highlighters");
 const { isXUL } = require("./highlighters/utils/markup");
 const { SimpleOutlineHighlighter } = require("./highlighters/simple-outline");
 
 const HIGHLIGHTER_PICKED_TIMER = 1000;
@@ -101,17 +100,17 @@ exports.HighlighterActor = protocol.Acto
     // Only try to create the highlighter when the document is loaded,
     // otherwise, wait for the navigate event to fire.
     if (doc.documentElement && doc.readyState != "uninitialized") {
       this._createHighlighter();
     }
 
     // Listen to navigation events to switch from the BoxModelHighlighter to the
     // SimpleOutlineHighlighter, and back, if the top level window changes.
-    events.on(this._tabActor, "navigate", this._onNavigate);
+    this._tabActor.on("navigate", this._onNavigate);
   },
 
   get conn() {
     return this._inspector && this._inspector.conn;
   },
 
   form: function () {
     return {
@@ -160,17 +159,17 @@ exports.HighlighterActor = protocol.Acto
     }
   },
 
   destroy: function () {
     protocol.Actor.prototype.destroy.call(this);
 
     this.hideBoxModel();
     this._destroyHighlighter();
-    events.off(this._tabActor, "navigate", this._onNavigate);
+    this._tabActor.off("navigate", this._onNavigate);
 
     this._highlighterEnv.destroy();
     this._highlighterEnv = null;
 
     this._autohide = null;
     this._inspector = null;
     this._walker = null;
     this._tabActor = null;
@@ -250,45 +249,45 @@ exports.HighlighterActor = protocol.Acto
 
       if (!this._isEventAllowed(event)) {
         return;
       }
 
       // If shift is pressed, this is only a preview click, send the event to
       // the client, but don't stop picking.
       if (event.shiftKey) {
-        events.emit(this._walker, "picker-node-previewed",
+        this._walker.emit("picker-node-previewed",
           this._findAndAttachElement(event));
         return;
       }
 
       this._stopPickerListeners();
       this._isPicking = false;
       if (this._autohide) {
         this._tabActor.window.setTimeout(() => {
           this._highlighter.hide();
         }, HIGHLIGHTER_PICKED_TIMER);
       }
       if (!this._currentNode) {
         this._currentNode = this._findAndAttachElement(event);
       }
-      events.emit(this._walker, "picker-node-picked", this._currentNode);
+      this._walker.emit("picker-node-picked", this._currentNode);
     };
 
     this._onHovered = event => {
       this._preventContentEvent(event);
 
       if (!this._isEventAllowed(event)) {
         return;
       }
 
       this._currentNode = this._findAndAttachElement(event);
       if (this._hoveredNode !== this._currentNode.node) {
         this._highlighter.show(this._currentNode.node.rawNode);
-        events.emit(this._walker, "picker-node-hovered", this._currentNode);
+        this._walker.emit("picker-node-hovered", this._currentNode);
         this._hoveredNode = this._currentNode.node;
       }
     };
 
     this._onKey = event => {
       if (!this._currentNode || !this._isPicking) {
         return;
       }
@@ -340,32 +339,32 @@ exports.HighlighterActor = protocol.Acto
         // Select the element.
         case Ci.nsIDOMKeyEvent.DOM_VK_RETURN:
           this._onPick(event);
           return;
 
         // Cancel pick mode.
         case Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE:
           this.cancelPick();
-          events.emit(this._walker, "picker-node-canceled");
+          this._walker.emit("picker-node-canceled");
           return;
         case Ci.nsIDOMKeyEvent.DOM_VK_C:
           if ((IS_OSX && event.metaKey && event.altKey) ||
             (!IS_OSX && event.ctrlKey && event.shiftKey)) {
             this.cancelPick();
-            events.emit(this._walker, "picker-node-canceled");
+            this._walker.emit("picker-node-canceled");
           }
           return;
         default: return;
       }
 
       // Store currently attached element
       this._currentNode = this._walker.attachElement(currentNode);
       this._highlighter.show(this._currentNode.node.rawNode);
-      events.emit(this._walker, "picker-node-hovered", this._currentNode);
+      this._walker.emit("picker-node-hovered", this._currentNode);
     };
 
     this._startPickerListeners();
 
     return null;
   },
 
   /**
@@ -409,21 +408,21 @@ exports.HighlighterActor = protocol.Acto
     target.removeEventListener("mousedown", this._preventContentEvent, true);
     target.removeEventListener("mouseup", this._preventContentEvent, true);
     target.removeEventListener("dblclick", this._preventContentEvent, true);
     target.removeEventListener("keydown", this._onKey, true);
     target.removeEventListener("keyup", this._preventContentEvent, true);
   },
 
   _highlighterReady: function () {
-    events.emit(this._inspector.walker, "highlighter-ready");
+    this._inspector.walker.emit("highlighter-ready");
   },
 
   _highlighterHidden: function () {
-    events.emit(this._inspector.walker, "highlighter-hide");
+    this._inspector.walker.emit("highlighter-hide");
   },
 
   cancelPick: function () {
     if (this._isPicking) {
       this._highlighter.hide();
       this._stopPickerListeners();
       this._isPicking = false;
       this._hoveredNode = null;
@@ -513,17 +512,17 @@ exports.CustomHighlighterActor = protoco
       this._highlighter.hide();
     }
   },
 
   /**
    * Upon receiving an event from the highlighter, forward it to the client.
    */
   _onHighlighterEvent: function (type, data) {
-    events.emit(this, "highlighter-event", data);
+    this.emit("highlighter-event", data);
   },
 
   /**
    * Kill this actor. This method is called automatically just before the actor
    * is destroyed.
    */
   finalize: function () {
     if (this._highlighter) {
@@ -562,19 +561,19 @@ function HighlighterEnvironment() {
   EventEmitter.decorate(this);
 }
 
 exports.HighlighterEnvironment = HighlighterEnvironment;
 
 HighlighterEnvironment.prototype = {
   initFromTabActor: function (tabActor) {
     this._tabActor = tabActor;
-    events.on(this._tabActor, "window-ready", this.relayTabActorWindowReady);
-    events.on(this._tabActor, "navigate", this.relayTabActorNavigate);
-    events.on(this._tabActor, "will-navigate", this.relayTabActorWillNavigate);
+    this._tabActor.on("window-ready", this.relayTabActorWindowReady);
+    this._tabActor.on("navigate", this.relayTabActorNavigate);
+    this._tabActor.on("will-navigate", this.relayTabActorWillNavigate);
   },
 
   initFromWindow: function (win) {
     this._win = win;
 
     // We need a progress listener to know when the window will navigate/has
     // navigated.
     let self = this;
@@ -681,19 +680,19 @@ HighlighterEnvironment.prototype = {
   },
 
   relayTabActorWillNavigate: function (data) {
     this.emit("will-navigate", data);
   },
 
   destroy: function () {
     if (this._tabActor) {
-      events.off(this._tabActor, "window-ready", this.relayTabActorWindowReady);
-      events.off(this._tabActor, "navigate", this.relayTabActorNavigate);
-      events.off(this._tabActor, "will-navigate", this.relayTabActorWillNavigate);
+      this._tabActor.off("window-ready", this.relayTabActorWindowReady);
+      this._tabActor.off("navigate", this.relayTabActorNavigate);
+      this._tabActor.off("will-navigate", this.relayTabActorWillNavigate);
     }
 
     // In case the environment was initialized from a window, we need to remove
     // the progress listener.
     if (this._win) {
       try {
         this.webProgress.removeProgressListener(this.listener);
       } catch (e) {
--- a/devtools/server/actors/highlighters/measuring-tool.js
+++ b/devtools/server/actors/highlighters/measuring-tool.js
@@ -1,15 +1,15 @@
 /* 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 events = require("devtools/shared/event-emitter");
+const EventEmitter = require("devtools/shared/event-emitter");
 const { getCurrentZoom, getWindowDimensions,
   setIgnoreLayoutChanges } = require("devtools/shared/layout/utils");
 const {
   CanvasFrameAnonymousContentHelper,
   createSVGNode, createNode } = require("./utils/markup");
 
 // Hard coded value about the size of measuring tool label, in order to
 // position and flip it when is needed.
@@ -207,17 +207,17 @@ MeasuringToolHighlighter.prototype = {
       pageListenerTarget.removeEventListener("mouseup", this);
       pageListenerTarget.removeEventListener("scroll", this);
       pageListenerTarget.removeEventListener("pagehide", this);
       pageListenerTarget.removeEventListener("mouseleave", this);
     }
 
     this.markup.destroy();
 
-    events.emit(this, "destroy");
+    EventEmitter.emit(this, "destroy");
   },
 
   show() {
     setIgnoreLayoutChanges(true);
 
     this.getElement("root").removeAttribute("hidden");
 
     this._update();
--- a/devtools/server/actors/highlighters/rulers.js
+++ b/devtools/server/actors/highlighters/rulers.js
@@ -1,15 +1,15 @@
 /* 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 events = require("devtools/shared/event-emitter");
+const EventEmitter = require("devtools/shared/event-emitter");
 const { getCurrentZoom,
   setIgnoreLayoutChanges } = require("devtools/shared/layout/utils");
 const {
   CanvasFrameAnonymousContentHelper,
   createSVGNode, createNode } = require("./utils/markup");
 
 // Maximum size, in pixel, for the horizontal ruler and vertical ruler
 // used by RulersHighlighter
@@ -272,17 +272,17 @@ RulersHighlighter.prototype = {
 
     if (pageListenerTarget) {
       pageListenerTarget.removeEventListener("scroll", this);
       pageListenerTarget.removeEventListener("pagehide", this);
     }
 
     this.markup.destroy();
 
-    events.emit(this, "destroy");
+    EventEmitter.emit(this, "destroy");
   },
 
   show: function () {
     this.markup.removeAttributeForElement(this.ID_CLASS_PREFIX + "elements",
       "hidden");
 
     this._update();
 
--- a/devtools/server/actors/highlighters/utils/markup.js
+++ b/devtools/server/actors/highlighters/utils/markup.js
@@ -2,17 +2,17 @@
  * 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 { Cc, Ci, Cu, Cr } = require("chrome");
 const { getCurrentZoom, getWindowDimensions, getViewportDimensions,
   getRootBindingParent, loadSheet } = require("devtools/shared/layout/utils");
-const { on, emit } = require("devtools/shared/event-emitter");
+const EventEmitter = require("devtools/shared/event-emitter");
 
 const lazyContainer = {};
 
 loader.lazyRequireGetter(lazyContainer, "CssLogic",
   "devtools/server/css-logic", true);
 exports.getComputedStyle = (node) =>
   lazyContainer.CssLogic.getComputedStyle(node);
 
@@ -56,25 +56,25 @@ ClassList.prototype = {
   },
   contains(token) {
     return this[_tokens].includes(token);
   },
   add(token) {
     if (!this.contains(token)) {
       this[_tokens].push(token);
     }
-    emit(this, "update");
+    EventEmitter.emit(this, "update");
   },
   remove(token) {
     let index = this[_tokens].indexOf(token);
 
     if (index > -1) {
       this[_tokens].splice(index, 1);
     }
-    emit(this, "update");
+    EventEmitter.emit(this, "update");
   },
   toggle(token) {
     if (this.contains(token)) {
       this.remove(token);
     } else {
       this.add(token);
     }
   },
@@ -477,17 +477,17 @@ CanvasFrameAnonymousContentHelper.protot
 
   getElement(id) {
     if (this.elements.has(id)) {
       return this.elements.get(id);
     }
 
     let classList = new ClassList(this.getAttributeForElement(id, "class"));
 
-    on(classList, "update", () => {
+    EventEmitter.on(classList, "update", () => {
       this.setAttributeForElement(id, "class", classList.toString());
     });
 
     let element = {
       getTextContent: () => this.getTextContentForElement(id),
       setTextContent: text => this.setTextContentForElement(id, text),
       setAttribute: (name, val) => this.setAttributeForElement(id, name, val),
       getAttribute: name => this.getAttributeForElement(id, name),
--- a/devtools/server/actors/inspector.js
+++ b/devtools/server/actors/inspector.js
@@ -53,17 +53,17 @@
 const {Cc, Ci, Cu} = require("chrome");
 const Services = require("Services");
 const protocol = require("devtools/shared/protocol");
 const {LayoutActor} = require("devtools/server/actors/layout");
 const {LongStringActor} = require("devtools/server/actors/string");
 const promise = require("promise");
 const defer = require("devtools/shared/defer");
 const {Task} = require("devtools/shared/task");
-const events = require("devtools/shared/event-emitter");
+const EventEmitter = require("devtools/shared/event-emitter");
 const {WalkerSearch} = require("devtools/server/actors/utils/walker-search");
 const {PageStyleActor, getFontPreviewData} = require("devtools/server/actors/styles");
 const {
   HighlighterActor,
   CustomHighlighterActor,
   isTypeRegistered,
   HighlighterEnvironment
 } = require("devtools/server/actors/highlighters");
@@ -293,17 +293,17 @@ var NodeActor = exports.NodeActor = prot
       if (!form.props) {
         form.props = {};
       }
       form.props[name] = value;
     };
 
     // Fire an event so, other modules can create its own properties
     // that should be passed to the client (within the form.props field).
-    events.emit(NodeActor, "form", {
+    EventEmitter.emit(NodeActor, "form", {
       target: this,
       data: form
     });
 
     return form;
   },
 
   /**
@@ -885,18 +885,18 @@ var WalkerActor = protocol.ActorClassWit
     // even when it is orphaned with the `retainNode` method.  This
     // list contains orphaned nodes that were so retained.
     this._retainedOrphans = new Set();
 
     this.onMutations = this.onMutations.bind(this);
     this.onFrameLoad = this.onFrameLoad.bind(this);
     this.onFrameUnload = this.onFrameUnload.bind(this);
 
-    events.on(tabActor, "will-navigate", this.onFrameUnload);
-    events.on(tabActor, "window-ready", this.onFrameLoad);
+    tabActor.on("will-navigate", this.onFrameUnload);
+    tabActor.on("window-ready", this.onFrameLoad);
 
     // Ensure that the root document node actor is ready and
     // managed.
     this.rootNode = this.document();
 
     this.layoutChangeObserver = getLayoutChangesObserver(this.tabActor);
     this._onReflows = this._onReflows.bind(this);
     this.layoutChangeObserver.on("reflows", this._onReflows);
@@ -976,18 +976,18 @@ var WalkerActor = protocol.ActorClassWit
       this.rootWin = null;
       this.rootDoc = null;
       this.rootNode = null;
       this.layoutHelpers = null;
       this._orphaned = null;
       this._retainedOrphans = null;
       this._refMap = null;
 
-      events.off(this.tabActor, "will-navigate", this.onFrameUnload);
-      events.off(this.tabActor, "window-ready", this.onFrameLoad);
+      this.tabActor.off("will-navigate", this.onFrameUnload);
+      this.tabActor.off("window-ready", this.onFrameLoad);
 
       this.onFrameLoad = null;
       this.onFrameUnload = null;
 
       this.walkerSearch.destroy();
 
       this.layoutChangeObserver.off("reflows", this._onReflows);
       this.layoutChangeObserver.off("resize", this._onResize);
@@ -997,17 +997,17 @@ var WalkerActor = protocol.ActorClassWit
       eventListenerService.removeListenerChangeListener(
         this._onEventListenerChange);
 
       this.onMutations = null;
 
       this.layoutActor = null;
       this.tabActor = null;
 
-      events.emit(this, "destroyed");
+      this.emit("destroyed");
     } catch (e) {
       console.error(e);
     }
   },
 
   release: function () {},
 
   unmanage: function (actor) {
@@ -1072,25 +1072,25 @@ var WalkerActor = protocol.ActorClassWit
       if (isDisplayed !== actor.wasDisplayed) {
         changes.push(actor);
         // Updating the original value
         actor.wasDisplayed = isDisplayed;
       }
     }
 
     if (changes.length) {
-      events.emit(this, "display-change", changes);
+      this.emit("display-change", changes);
     }
   },
 
   /**
    * When the browser window gets resized, relay the event to the front.
    */
   _onResize: function () {
-    events.emit(this, "resize");
+    this.emit("resize");
   },
 
   /**
    * This is kept for backward-compatibility reasons with older remote targets.
    * Targets prior to bug 916443.
    *
    * pick/cancelPick are used to pick a node on click on the content
    * document. But in their implementation prior to bug 916443, they don't allow
@@ -2328,31 +2328,31 @@ var WalkerActor = protocol.ActorClassWit
     }
     // We only send the `new-mutations` notification once, until the client
     // fetches mutations with the `getMutations` packet.
     let needEvent = this._pendingMutations.length === 0;
 
     this._pendingMutations.push(mutation);
 
     if (needEvent) {
-      events.emit(this, "new-mutations");
+      this.emit("new-mutations");
     }
   },
 
   /**
    * Handles mutations from the DOM mutation observer API.
    *
    * @param array[MutationRecord] mutations
    *    See https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver#MutationRecord
    */
   onMutations: function (mutations) {
     // Notify any observers that want *all* mutations (even on nodes that aren't
     // referenced).  This is not sent over the protocol so can only be used by
     // scripts running in the server process.
-    events.emit(this, "any-mutation");
+    this.emit("any-mutation");
 
     for (let change of mutations) {
       let targetActor = this.getNode(change.target);
       if (!targetActor) {
         continue;
       }
       let targetNode = change.target;
       let type = change.type;
@@ -2755,17 +2755,17 @@ exports.InspectorActor = protocol.ActorC
     this._walkerPromise = deferred.promise;
 
     let window = this.window;
     let domReady = () => {
       let tabActor = this.tabActor;
       window.removeEventListener("DOMContentLoaded", domReady, true);
       this.walker = WalkerActor(this.conn, tabActor, options);
       this.manage(this.walker);
-      events.once(this.walker, "destroyed", () => {
+      this.walker.once("destroyed", () => {
         this._walkerPromise = null;
         this._pageStylePromise = null;
       });
       deferred.resolve(this.walker);
     };
 
     if (window.document.readyState === "loading") {
       window.addEventListener("DOMContentLoaded", domReady, true);
@@ -2908,30 +2908,30 @@ exports.InspectorActor = protocol.ActorC
    * cancels the picker.
    * @param {Object} options
    */
   pickColorFromPage: function (options) {
     this.createEyeDropper();
     this._eyeDropper.show(this.window.document.documentElement, options);
     this._eyeDropper.once("selected", this._onColorPicked);
     this._eyeDropper.once("canceled", this._onColorPickCanceled);
-    events.once(this.tabActor, "will-navigate", this.destroyEyeDropper);
+    this.tabActor.once("will-navigate", this.destroyEyeDropper);
   },
 
   /**
    * After the pickColorFromPage method is called, the only way to dismiss the eye-dropper
    * highlighter is for the user to click in the page and select a color. If you need to
    * dismiss the eye-dropper programatically instead, use this method.
    */
   cancelPickColorFromPage: function () {
     if (this._eyeDropper) {
       this._eyeDropper.hide();
       this._eyeDropper.off("selected", this._onColorPicked);
       this._eyeDropper.off("canceled", this._onColorPickCanceled);
-      events.off(this.tabActor, "will-navigate", this.destroyEyeDropper);
+      this.tabActor.off("will-navigate", this.destroyEyeDropper);
     }
   },
 
   /**
    * Check if the current document supports highlighters using a canvasFrame anonymous
    * content container (ie all highlighters except the SimpleOutlineHighlighter).
    * It is impossible to detect the feature programmatically as some document types simply
    * don't render the canvasFrame without throwing any error.
@@ -2949,21 +2949,21 @@ exports.InspectorActor = protocol.ActorC
     if (ns === SVG_NS) {
       return false;
     }
 
     return true;
   },
 
   _onColorPicked: function (e, color) {
-    events.emit(this, "color-picked", color);
+    this.emit("color-picked", color);
   },
 
   _onColorPickCanceled: function () {
-    events.emit(this, "color-pick-canceled");
+    this.emit("color-pick-canceled");
   }
 });
 
 // Exported for test purposes.
 exports._documentWalker = DocumentWalker;
 
 function nodeDocument(node) {
   if (Cu.isDeadWrapper(node)) {
--- a/devtools/server/actors/memory.js
+++ b/devtools/server/actors/memory.js
@@ -3,17 +3,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const protocol = require("devtools/shared/protocol");
 const { Memory } = require("devtools/server/performance/memory");
 const { actorBridgeWithSpec } = require("devtools/server/actors/common");
 const { memorySpec } = require("devtools/shared/specs/memory");
-loader.lazyRequireGetter(this, "events", "devtools/shared/event-emitter");
 loader.lazyRequireGetter(this, "StackFrameCache",
                          "devtools/server/actors/utils/stack", true);
 
 /**
  * An actor that returns memory usage data for its parent actor's window.
  * A tab-scoped instance of this actor will measure the memory footprint of its
  * parent tab. A global-scoped instance however, will measure the memory
  * footprint of the chrome window referenced by the root actor.
@@ -66,18 +65,18 @@ exports.MemoryActor = protocol.ActorClas
   forceCycleCollection: actorBridgeWithSpec("forceCycleCollection"),
 
   measure: actorBridgeWithSpec("measure"),
 
   residentUnique: actorBridgeWithSpec("residentUnique"),
 
   _onGarbageCollection: function (data) {
     if (this.conn.transport) {
-      events.emit(this, "garbage-collection", data);
+      this.emit("garbage-collection", data);
     }
   },
 
   _onAllocations: function (data) {
     if (this.conn.transport) {
-      events.emit(this, "allocations", data);
+      this.emit("allocations", data);
     }
   },
 });
--- a/devtools/server/actors/performance-entries.js
+++ b/devtools/server/actors/performance-entries.js
@@ -8,17 +8,16 @@
  * The performanceEntries actor emits events corresponding to performance
  * entries. It receives `performanceentry` events containing the performance
  * entry details and emits an event containing the name, type, origin, and
  * epoch of the performance entry.
  */
 
 const { Actor, ActorClassWithSpec } = require("devtools/shared/protocol");
 const performanceSpec = require("devtools/shared/specs/performance-entries");
-const events = require("devtools/shared/event-emitter");
 
 var PerformanceEntriesActor = ActorClassWithSpec(performanceSpec, {
   listenerAdded: false,
 
   initialize: function (conn, tabActor) {
     Actor.prototype.initialize.call(this, conn);
     this.window = tabActor.window;
   },
@@ -51,13 +50,13 @@ var PerformanceEntriesActor = ActorClass
 
   onPerformanceEntry: function (e) {
     let emitDetail = {
       type: e.entryType,
       name: e.name,
       origin: e.origin,
       epoch: e.epoch
     };
-    events.emit(this, "entry", emitDetail);
+    this.emit("entry", emitDetail);
   }
 });
 
 exports.PerformanceEntriesActor = PerformanceEntriesActor;
--- a/devtools/server/actors/performance.js
+++ b/devtools/server/actors/performance.js
@@ -4,18 +4,16 @@
 
 "use strict";
 
 const { Task } = require("devtools/shared/task");
 const { Actor, ActorClassWithSpec } = require("devtools/shared/protocol");
 const { actorBridgeWithSpec } = require("devtools/server/actors/common");
 const { performanceSpec } = require("devtools/shared/specs/performance");
 
-loader.lazyRequireGetter(this, "events", "devtools/shared/event-emitter");
-
 loader.lazyRequireGetter(this, "PerformanceRecorder",
   "devtools/server/performance/recorder", true);
 loader.lazyRequireGetter(this, "normalizePerformanceFeatures",
   "devtools/shared/performance/recording-utils", true);
 
 const PIPE_TO_FRONT_EVENTS = new Set([
   "recording-started", "recording-stopping", "recording-stopped",
   "profiler-status", "timeline-data", "console-profile-start"
@@ -43,21 +41,21 @@ var PerformanceActor = ActorClassWithSpe
       withAllocations: true,
     },
   },
 
   initialize: function (conn, tabActor) {
     Actor.prototype.initialize.call(this, conn);
     this._onRecorderEvent = this._onRecorderEvent.bind(this);
     this.bridge = new PerformanceRecorder(conn, tabActor);
-    events.on(this.bridge, "*", this._onRecorderEvent);
+    this.bridge.on("*", this._onRecorderEvent);
   },
 
   destroy: function () {
-    events.off(this.bridge, "*", this._onRecorderEvent);
+    this.bridge.off("*", this._onRecorderEvent);
     this.bridge.destroy();
     Actor.prototype.destroy.call(this);
   },
 
   connect: function (config) {
     this.bridge.connect({ systemClient: config.systemClient });
     return { traits: this.traits };
   },
@@ -93,14 +91,14 @@ var PerformanceActor = ActorClassWithSpe
     // update its internal state.
     if (RECORDING_STATE_CHANGE_EVENTS.has(eventName)) {
       let recording = data[0];
       let extraData = data[1];
       recording._setState(eventName, extraData);
     }
 
     if (PIPE_TO_FRONT_EVENTS.has(eventName)) {
-      events.emit(this, eventName, ...data);
+      this.emit(eventName, ...data);
     }
   },
 });
 
 exports.PerformanceActor = PerformanceActor;
--- a/devtools/server/actors/profiler.js
+++ b/devtools/server/actors/profiler.js
@@ -3,35 +3,33 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 const { Actor, ActorClassWithSpec } = require("devtools/shared/protocol");
 const { Profiler } = require("devtools/server/performance/profiler");
 const { actorBridgeWithSpec } = require("devtools/server/actors/common");
 const { profilerSpec } = require("devtools/shared/specs/profiler");
 
-loader.lazyRequireGetter(this, "events", "devtools/shared/event-emitter");
-
 /**
  * This actor wraps the Profiler module at devtools/server/performance/profiler.js
  * and provides RDP definitions.
  *
  * @see devtools/server/performance/profiler.js for documentation.
  */
 exports.ProfilerActor = ActorClassWithSpec(profilerSpec, {
   initialize: function (conn) {
     Actor.prototype.initialize.call(this, conn);
     this._onProfilerEvent = this._onProfilerEvent.bind(this);
 
     this.bridge = new Profiler();
-    events.on(this.bridge, "*", this._onProfilerEvent);
+    this.bridge.on("*", this._onProfilerEvent);
   },
 
   destroy: function () {
-    events.off(this.bridge, "*", this._onProfilerEvent);
+    this.bridge.off("*", this._onProfilerEvent);
     this.bridge.destroy();
     Actor.prototype.destroy.call(this);
   },
 
   startProfiler: actorBridgeWithSpec("start"),
   stopProfiler: actorBridgeWithSpec("stop"),
   getProfile: actorBridgeWithSpec("getProfile"),
   getFeatures: actorBridgeWithSpec("getFeatures"),
@@ -42,11 +40,11 @@ exports.ProfilerActor = ActorClassWithSp
   registerEventNotifications: actorBridgeWithSpec("registerEventNotifications"),
   unregisterEventNotifications: actorBridgeWithSpec("unregisterEventNotifications"),
   setProfilerStatusInterval: actorBridgeWithSpec("setProfilerStatusInterval"),
 
   /**
    * Pipe events from Profiler module to this actor.
    */
   _onProfilerEvent: function (eventName, ...data) {
-    events.emit(this, eventName, ...data);
+    this.emit(eventName, ...data);
   },
 });
--- a/devtools/server/actors/promises.js
+++ b/devtools/server/actors/promises.js
@@ -4,17 +4,17 @@
 
 "use strict";
 
 const protocol = require("devtools/shared/protocol");
 const { promisesSpec } = require("devtools/shared/specs/promises");
 const { expectState, ActorPool } = require("devtools/server/actors/common");
 const { ObjectActor, createValueGrip } = require("devtools/server/actors/object");
 const DevToolsUtils = require("devtools/shared/DevToolsUtils");
-loader.lazyRequireGetter(this, "events", "devtools/shared/event-emitter");
+const EventEmitter = require("devtools/shared/event-emitter");
 
 /**
  * The Promises Actor provides support for getting the list of live promises and
  * observing changes to their settlement state.
  */
 var PromisesActor = protocol.ActorClassWithSpec(promisesSpec, {
   /**
    * @param conn DebuggerServerConnection.
@@ -67,17 +67,17 @@ var PromisesActor = protocol.ActorClassW
     this.dbg.findScripts().forEach(s => {
       this.parentActor.sources.createSourceActors(s.source);
     });
 
     this.dbg.onNewScript = s => {
       this.parentActor.sources.createSourceActors(s.source);
     };
 
-    events.on(this.parentActor, "window-ready", this._onWindowReady);
+    EventEmitter.on(this.parentActor, "window-ready", this._onWindowReady);
 
     this.state = "attached";
   }, "attaching to the PromisesActor"),
 
   /**
    * Detach from the PromisesActor upon Debugger closing.
    */
   detach: expectState("attached", function () {
@@ -87,17 +87,17 @@ var PromisesActor = protocol.ActorClassW
     this._newPromises = null;
     this._promisesSettled = null;
 
     if (this._navigationLifetimePool) {
       this.conn.removeActorPool(this._navigationLifetimePool);
       this._navigationLifetimePool = null;
     }
 
-    events.off(this.parentActor, "window-ready", this._onWindowReady);
+    EventEmitter.off(this.parentActor, "window-ready", this._onWindowReady);
 
     this.state = "detached";
   }),
 
   _createActorPool: function () {
     let pool = new ActorPool(this.conn);
     pool.objectActors = new WeakMap();
     return pool;
@@ -175,17 +175,17 @@ var PromisesActor = protocol.ActorClassW
     return promise => {
       let actor = this._createObjectActorForPromise(promise);
       let needsScheduling = array.length == 0;
 
       array.push(actor);
 
       if (needsScheduling) {
         DevToolsUtils.executeSoon(() => {
-          events.emit(this, eventName, array.splice(0, array.length));
+          this.emit(eventName, array.splice(0, array.length));
         });
       }
     };
   },
 
   _onWindowReady: expectState("attached", function ({ isTopLevel }) {
     if (!isTopLevel) {
       return;
--- a/devtools/server/actors/reflow.js
+++ b/devtools/server/actors/reflow.js
@@ -22,17 +22,16 @@
  * - Dedicated observers: There's only one of them for now: ReflowObserver which
  *   listens to reflow events via the docshell,
  *   These dedicated classes are used by the LayoutChangesObserver.
  */
 
 const {Ci} = require("chrome");
 const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
 const protocol = require("devtools/shared/protocol");
-const events = require("devtools/shared/event-emitter");
 const EventEmitter = require("devtools/shared/old-event-emitter");
 const {reflowSpec} = require("devtools/shared/specs/reflow");
 
 /**
  * The reflow actor tracks reflows and emits events about them.
  */
 exports.ReflowActor = protocol.ActorClassWithSpec(reflowSpec, {
   initialize: function (conn, tabActor) {
@@ -74,17 +73,17 @@ exports.ReflowActor = protocol.ActorClas
     if (this._isStarted) {
       this.observer.off("reflows", this._onReflow);
       this._isStarted = false;
     }
   },
 
   _onReflow: function (event, reflows) {
     if (this._isStarted) {
-      events.emit(this, "reflows", reflows);
+      this.emit("reflows", reflows);
     }
   }
 });
 
 /**
  * Base class for all sorts of observers that need to listen to events on the
  * tabActor's windows.
  * @param {TabActor} tabActor
@@ -92,18 +91,18 @@ exports.ReflowActor = protocol.ActorClas
  */
 function Observable(tabActor, callback) {
   this.tabActor = tabActor;
   this.callback = callback;
 
   this._onWindowReady = this._onWindowReady.bind(this);
   this._onWindowDestroyed = this._onWindowDestroyed.bind(this);
 
-  events.on(this.tabActor, "window-ready", this._onWindowReady);
-  events.on(this.tabActor, "window-destroyed", this._onWindowDestroyed);
+  this.tabActor.on("window-ready", this._onWindowReady);
+  this.tabActor.on("window-destroyed", this._onWindowDestroyed);
 }
 
 Observable.prototype = {
   /**
    * Is the observer currently observing
    */
   isObserving: false,
 
@@ -113,18 +112,18 @@ Observable.prototype = {
   destroy: function () {
     if (this.isDestroyed) {
       return;
     }
     this.isDestroyed = true;
 
     this.stop();
 
-    events.off(this.tabActor, "window-ready", this._onWindowReady);
-    events.off(this.tabActor, "window-destroyed", this._onWindowDestroyed);
+    this.tabActor.off("window-ready", this._onWindowReady);
+    this.tabActor.off("window-destroyed", this._onWindowDestroyed);
 
     this.callback = null;
     this.tabActor = null;
   },
 
   /**
    * Start observing whatever it is this observer is supposed to observe
    */
--- a/devtools/server/actors/script.js
+++ b/devtools/server/actors/script.js
@@ -23,23 +23,23 @@ const { resolve, reject, all } = promise
 
 loader.lazyGetter(this, "Debugger", () => {
   let Debugger = require("Debugger");
   hackDebugger(Debugger);
   return Debugger;
 });
 loader.lazyRequireGetter(this, "CssLogic", "devtools/server/css-logic", true);
 loader.lazyRequireGetter(this, "findCssSelector", "devtools/shared/inspector/css-logic", true);
-loader.lazyRequireGetter(this, "events", "devtools/shared/event-emitter");
 loader.lazyRequireGetter(this, "mapURIToAddonID", "devtools/server/actors/utils/map-uri-to-addon-id");
 loader.lazyRequireGetter(this, "BreakpointActor", "devtools/server/actors/breakpoint", true);
 loader.lazyRequireGetter(this, "setBreakpointAtEntryPoints", "devtools/server/actors/breakpoint", true);
 loader.lazyRequireGetter(this, "getSourceURL", "devtools/server/actors/source", true);
 loader.lazyRequireGetter(this, "EnvironmentActor", "devtools/server/actors/environment", true);
 loader.lazyRequireGetter(this, "FrameActor", "devtools/server/actors/frame", true);
+loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
 
 /**
  * A BreakpointActorMap is a map from locations to instances of BreakpointActor.
  */
 function BreakpointActorMap() {
   this._size = 0;
   this._actors = {};
 }
@@ -447,17 +447,17 @@ const ThreadActor = ActorClassWithSpec(t
     this.onNewGlobal = this.onNewGlobal.bind(this);
     this.onSourceEvent = this.onSourceEvent.bind(this);
     this.uncaughtExceptionHook = this.uncaughtExceptionHook.bind(this);
     this.onDebuggerStatement = this.onDebuggerStatement.bind(this);
     this.onNewScript = this.onNewScript.bind(this);
     this.objectGrip = this.objectGrip.bind(this);
     this.pauseObjectGrip = this.pauseObjectGrip.bind(this);
     this._onWindowReady = this._onWindowReady.bind(this);
-    events.on(this._parent, "window-ready", this._onWindowReady);
+    EventEmitter.on(this._parent, "window-ready", this._onWindowReady);
     // Set a wrappedJSObject property so |this| can be sent via the observer svc
     // for the xpcshell harness.
     this.wrappedJSObject = this;
   },
 
   // Used by the ObjectActor to keep track of the depth of grip() calls.
   _gripDepth: null,
 
@@ -574,17 +574,17 @@ const ThreadActor = ActorClassWithSpec(t
       this.onResume();
     }
 
     // Blow away our source actor ID store because those IDs are only
     // valid for this connection. This is ok because we never keep
     // things like breakpoints across connections.
     this._sourceActorStore = null;
 
-    events.off(this._parent, "window-ready", this._onWindowReady);
+    EventEmitter.off(this._parent, "window-ready", this._onWindowReady);
     this.sources.off("newSource", this.onSourceEvent);
     this.sources.off("updatedSource", this.onSourceEvent);
     this.clearDebuggees();
     this.conn.removeActorPool(this._threadLifetimePool);
     this._threadLifetimePool = null;
 
     if (this._prettyPrintWorker) {
       this._prettyPrintWorker.destroy();
--- a/devtools/server/actors/storage.js
+++ b/devtools/server/actors/storage.js
@@ -1,16 +1,15 @@
 /* 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 {Cc, Ci, Cu, CC} = require("chrome");
-const events = require("devtools/shared/event-emitter");
 const protocol = require("devtools/shared/protocol");
 const {LongStringActor} = require("devtools/server/actors/string");
 const {DebuggerServer} = require("devtools/server/main");
 const Services = require("Services");
 const promise = require("promise");
 const defer = require("devtools/shared/defer");
 const {isWindowIncluded} = require("devtools/shared/layout/utils");
 const specs = require("devtools/shared/specs/storage");
@@ -187,28 +186,28 @@ StorageActors.defaults = function (typeN
       this.populateStoresForHosts();
       if (observationTopics) {
         observationTopics.forEach((observationTopic) => {
           Services.obs.addObserver(this, observationTopic);
         });
       }
       this.onWindowReady = this.onWindowReady.bind(this);
       this.onWindowDestroyed = this.onWindowDestroyed.bind(this);
-      events.on(this.storageActor, "window-ready", this.onWindowReady);
-      events.on(this.storageActor, "window-destroyed", this.onWindowDestroyed);
+      this.storageActor.on("window-ready", this.onWindowReady);
+      this.storageActor.on("window-destroyed", this.onWindowDestroyed);
     },
 
     destroy() {
       if (observationTopics) {
         observationTopics.forEach((observationTopic) => {
           Services.obs.removeObserver(this, observationTopic);
         });
       }
-      events.off(this.storageActor, "window-ready", this.onWindowReady);
-      events.off(this.storageActor, "window-destroyed", this.onWindowDestroyed);
+      this.storageActor.off("window-ready", this.onWindowReady);
+      this.storageActor.off("window-destroyed", this.onWindowDestroyed);
 
       this.hostVsStores.clear();
 
       protocol.Actor.prototype.destroy.call(this);
 
       this.storageActor = null;
     },
 
@@ -449,32 +448,32 @@ StorageActors.createActor({
     this.storageActor = storageActor;
 
     this.maybeSetupChildProcess();
     this.populateStoresForHosts();
     this.addCookieObservers();
 
     this.onWindowReady = this.onWindowReady.bind(this);
     this.onWindowDestroyed = this.onWindowDestroyed.bind(this);
-    events.on(this.storageActor, "window-ready", this.onWindowReady);
-    events.on(this.storageActor, "window-destroyed", this.onWindowDestroyed);
+    this.storageActor.on("window-ready", this.onWindowReady);
+    this.storageActor.on("window-destroyed", this.onWindowDestroyed);
   },
 
   destroy() {
     this.hostVsStores.clear();
 
     // We need to remove the cookie listeners early in E10S mode so we need to
     // use a conditional here to ensure that we only attempt to remove them in
     // single process mode.
     if (!DebuggerServer.isInChildProcess) {
       this.removeCookieObservers();
     }
 
-    events.off(this.storageActor, "window-ready", this.onWindowReady);
-    events.off(this.storageActor, "window-destroyed", this.onWindowDestroyed);
+    this.storageActor.off("window-ready", this.onWindowReady);
+    this.storageActor.off("window-destroyed", this.onWindowDestroyed);
 
     this._pendingResponse = null;
 
     protocol.Actor.prototype.destroy.call(this);
 
     this.storageActor = null;
   },
 
@@ -1577,26 +1576,26 @@ StorageActors.createActor({
 
     this.maybeSetupChildProcess();
 
     this.objectsSize = {};
     this.storageActor = storageActor;
     this.onWindowReady = this.onWindowReady.bind(this);
     this.onWindowDestroyed = this.onWindowDestroyed.bind(this);
 
-    events.on(this.storageActor, "window-ready", this.onWindowReady);
-    events.on(this.storageActor, "window-destroyed", this.onWindowDestroyed);
+    this.storageActor.on("window-ready", this.onWindowReady);
+    this.storageActor.on("window-destroyed", this.onWindowDestroyed);
   },
 
   destroy() {
     this.hostVsStores.clear();
     this.objectsSize = null;
 
-    events.off(this.storageActor, "window-ready", this.onWindowReady);
-    events.off(this.storageActor, "window-destroyed", this.onWindowDestroyed);
+    this.storageActor.off("window-ready", this.onWindowReady);
+    this.storageActor.off("window-destroyed", this.onWindowDestroyed);
 
     protocol.Actor.prototype.destroy.call(this);
 
     this.storageActor = null;
   },
 
   /**
    * Remove an indexedDB database from given host with a given name.
@@ -2630,22 +2629,22 @@ let StorageActor = protocol.ActorClassWi
     if (subject.location &&
         (!subject.location.href || subject.location.href == "about:blank")) {
       return null;
     }
 
     if (topic == "content-document-global-created" &&
         this.isIncludedInTopLevelWindow(subject)) {
       this.childWindowPool.add(subject);
-      events.emit(this, "window-ready", subject);
+      this.emit("window-ready", subject);
     } else if (topic == "inner-window-destroyed") {
       let window = this.getWindowFromInnerWindowID(subject);
       if (window) {
         this.childWindowPool.delete(window);
-        events.emit(this, "window-destroyed", window);
+        this.emit("window-destroyed", window);
       }
     }
     return null;
   },
 
   /**
    * Called on "pageshow" or "pagehide" event on the chromeEventHandler of
    * current tab.
@@ -2661,22 +2660,22 @@ let StorageActor = protocol.ActorClassWi
   onPageChange({target, type, persisted}) {
     if (this.destroyed) {
       return;
     }
 
     let window = target.defaultView;
 
     if (type == "pagehide" && this.childWindowPool.delete(window)) {
-      events.emit(this, "window-destroyed", window);
+      this.emit("window-destroyed", window);
     } else if (type == "pageshow" && persisted && window.location.href &&
                window.location.href != "about:blank" &&
                this.isIncludedInTopLevelWindow(window)) {
       this.childWindowPool.add(window);
-      events.emit(this, "window-ready", window);
+      this.emit("window-ready", window);
     }
   },
 
   /**
    * Lists the available hosts for all the registered storage types.
    *
    * @returns {object} An object containing with the following structure:
    *  - <storageType> : [{
@@ -2715,17 +2714,17 @@ let StorageActor = protocol.ActorClassWi
    *           }
    *           Where host1, host2 are the host in which this change happened and
    *           [<store_namesX] is an array of the names of the changed store objects.
    *           Pass an empty array if the host itself was affected: either completely
    *           removed or cleared.
    */
   update(action, storeType, data) {
     if (action == "cleared") {
-      events.emit(this, "stores-cleared", { [storeType]: data });
+      this.emit("stores-cleared", { [storeType]: data });
       return null;
     }
 
     if (this.batchTimer) {
       clearTimeout(this.batchTimer);
     }
     if (!this.boundUpdate[action]) {
       this.boundUpdate[action] = {};
@@ -2771,17 +2770,17 @@ let StorageActor = protocol.ActorClassWi
             this.boundUpdate.changed[storeType][host]) {
           delete this.boundUpdate.changed[storeType][host];
         }
       }
     }
 
     this.batchTimer = setTimeout(() => {
       clearTimeout(this.batchTimer);
-      events.emit(this, "stores-update", this.boundUpdate);
+      this.emit("stores-update", this.boundUpdate);
       this.boundUpdate = {};
     }, BATCH_DELAY);
 
     return null;
   },
 
   /**
    * This method removes data from the this.boundUpdate object in the same
--- a/devtools/server/actors/styleeditor.js
+++ b/devtools/server/actors/styleeditor.js
@@ -2,17 +2,16 @@
  * 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 {Cc, Ci} = require("chrome");
 const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
 const promise = require("promise");
-const events = require("devtools/shared/event-emitter");
 const protocol = require("devtools/shared/protocol");
 const {fetch} = require("devtools/shared/DevToolsUtils");
 const {oldStyleSheetSpec, styleEditorSpec} = require("devtools/shared/specs/styleeditor");
 
 loader.lazyGetter(this, "CssLogic", () => require("devtools/shared/inspector/css-logic"));
 
 var TRANSITION_CLASS = "moz-styleeditor-transitioning";
 var TRANSITION_DURATION_MS = 500;
@@ -151,26 +150,26 @@ var OldStyleSheetActor = protocol.ActorC
   /**
    * Send an event notifying that a property of the stylesheet
    * has changed.
    *
    * @param  {string} property
    *         Name of the changed property
    */
   _notifyPropertyChanged: function (property) {
-    events.emit(this, "property-change", property, this.form()[property]);
+    this.emit("property-change", property, this.form()[property]);
   },
 
    /**
     * Fetch the source of the style sheet from its URL. Send a "sourceLoad"
     * event when it's been fetched.
     */
   fetchSource: function () {
     this._getText().then((content) => {
-      events.emit(this, "source-load", this.text);
+      this.emit("source-load", this.text);
     });
   },
 
   /**
    * Fetch the text for this stylesheet from the cache or network. Return
    * cached text if it's already been fetched.
    *
    * @return {Promise}
@@ -290,17 +289,17 @@ var OldStyleSheetActor = protocol.ActorC
     * notifies that the style has been applied.
     */
   _onTransitionEnd: function () {
     if (--this._transitionRefCount == 0) {
       this.document.documentElement.classList.remove(TRANSITION_CLASS);
       this.rawSheet.deleteRule(this.rawSheet.cssRules.length - 1);
     }
 
-    events.emit(this, "style-applied");
+    this.emit("style-applied");
   }
 });
 
 exports.OldStyleSheetActor = OldStyleSheetActor;
 
 /**
  * Creates a StyleEditorActor. StyleEditorActor provides remote access to the
  * stylesheets of a document.
@@ -373,17 +372,17 @@ var StyleEditorActor = protocol.ActorCla
       let sheetForms = this._addStyleSheets(doc.styleSheets);
       forms = forms.concat(sheetForms);
       // Recursively handle style sheets of the documents in iframes.
       for (let iframe of doc.getElementsByTagName("iframe")) {
         documents.push(iframe.contentDocument);
       }
     }
 
-    events.emit(this, "document-load", forms);
+    this.emit("document-load", forms);
   },
 
   /**
    * Add all the stylesheets to the map and create an actor for each one
    * if not already created. Send event that there are new stylesheets.
    *
    * @param {[DOMStyleSheet]} styleSheets
    *        Stylesheets to add
--- a/devtools/server/actors/styles.js
+++ b/devtools/server/actors/styles.js
@@ -7,17 +7,16 @@
 const {Cc, Ci} = require("chrome");
 const promise = require("promise");
 const protocol = require("devtools/shared/protocol");
 const {LongStringActor} = require("devtools/server/actors/string");
 const {getDefinedGeometryProperties} = require("devtools/server/actors/highlighters/geometry-editor");
 const {parseNamedDeclarations} = require("devtools/shared/css/parsing-utils");
 const {isCssPropertyKnown} = require("devtools/server/actors/css-properties");
 const {Task} = require("devtools/shared/task");
-const events = require("devtools/shared/event-emitter");
 
 // This will also add the "stylesheet" actor type for protocol.js to recognize
 const {UPDATE_PRESERVING_RULES, UPDATE_GENERAL} = require("devtools/server/actors/stylesheets");
 const {pageStyleSpec, styleRuleSpec, ELEMENT_STYLE} = require("devtools/shared/specs/styles");
 
 loader.lazyGetter(this, "CssLogic", () => require("devtools/server/css-logic").CssLogic);
 loader.lazyGetter(this, "SharedCssLogic", () => require("devtools/shared/inspector/css-logic"));
 loader.lazyGetter(this, "DOMUtils", () => Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils));
@@ -62,30 +61,30 @@ var PageStyleActor = protocol.ActorClass
     this.refMap = new Map();
 
     // Maps document elements to style elements, used to add new rules.
     this.styleElements = new WeakMap();
 
     this.onFrameUnload = this.onFrameUnload.bind(this);
     this.onStyleSheetAdded = this.onStyleSheetAdded.bind(this);
 
-    events.on(this.inspector.tabActor, "will-navigate", this.onFrameUnload);
-    events.on(this.inspector.tabActor, "stylesheet-added", this.onStyleSheetAdded);
+    this.inspector.tabActor.on("will-navigate", this.onFrameUnload);
+    this.inspector.tabActor.on("stylesheet-added", this.onStyleSheetAdded);
 
     this._styleApplied = this._styleApplied.bind(this);
     this._watchedSheets = new Set();
   },
 
   destroy: function () {
     if (!this.walker) {
       return;
     }
     protocol.Actor.prototype.destroy.call(this);
-    events.off(this.inspector.tabActor, "will-navigate", this.onFrameUnload);
-    events.off(this.inspector.tabActor, "stylesheet-added", this.onStyleSheetAdded);
+    this.inspector.tabActor.off("will-navigate", this.onFrameUnload);
+    this.inspector.tabActor.off("stylesheet-added", this.onStyleSheetAdded);
     this.inspector = null;
     this.walker = null;
     this.refMap = null;
     this.cssLogic = null;
     this.styleElements = null;
 
     for (let sheet of this._watchedSheets) {
       sheet.off("style-applied", this._styleApplied);
@@ -119,17 +118,17 @@ var PageStyleActor = protocol.ActorClass
   /**
    * Called when a style sheet is updated.
    */
   _styleApplied: function (kind, styleSheet) {
     // No matter what kind of update is done, we need to invalidate
     // the keyframe cache.
     this.cssLogic.reset();
     if (kind === UPDATE_GENERAL) {
-      events.emit(this, "stylesheet-updated", styleSheet);
+      this.emit("stylesheet-updated", styleSheet);
     }
   },
 
   /**
    * Return or create a StyleRuleActor for the given item.
    * @param item Either a CSSStyleRule or a DOM element.
    */
   _styleRef: function (item) {
@@ -1116,17 +1115,17 @@ var StyleRuleActor = protocol.ActorClass
   /**
    * Send an event notifying that the location of the rule has
    * changed.
    *
    * @param {Number} line the new line number
    * @param {Number} column the new column number
    */
   _notifyLocationChanged: function (line, column) {
-    events.emit(this, "location-changed", line, column);
+    this.emit("location-changed", line, column);
   },
 
   /**
    * Compute the index of this actor's raw rule in its parent style
    * sheet.  The index is a vector where each element is the index of
    * a given CSS rule in its parent.  A vector is used to support
    * nested rules.
    */
--- a/devtools/server/actors/stylesheets.js
+++ b/devtools/server/actors/stylesheets.js
@@ -5,17 +5,16 @@
 "use strict";
 
 const {Cc, Ci} = require("chrome");
 const Services = require("Services");
 const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
 const promise = require("promise");
 const defer = require("devtools/shared/defer");
 const {Task} = require("devtools/shared/task");
-const events = require("devtools/shared/event-emitter");
 const protocol = require("devtools/shared/protocol");
 const {LongStringActor} = require("devtools/server/actors/string");
 const {fetch} = require("devtools/shared/DevToolsUtils");
 const {listenOnce} = require("devtools/shared/async-utils");
 const {originalSourceSpec, mediaRuleSpec, styleSheetSpec,
        styleSheetsSpec} = require("devtools/shared/specs/stylesheets");
 const {SourceMapConsumer} = require("source-map");
 const {
@@ -170,17 +169,17 @@ var MediaRuleActor = protocol.ActorClass
       column: this.column,
       parentStyleSheet: this.parentActor.actorID
     };
 
     return form;
   },
 
   _matchesChange: function () {
-    events.emit(this, "matches-change", this.matches);
+    this.emit("matches-change", this.matches);
   }
 });
 
 /**
  * A StyleSheetActor represents a stylesheet on the server.
  */
 var StyleSheetActor = protocol.ActorClassWithSpec(styleSheetSpec, {
   /* List of original sources that generated this stylesheet */
@@ -394,17 +393,17 @@ var StyleSheetActor = protocol.ActorClas
   /**
    * Send an event notifying that a property of the stylesheet
    * has changed.
    *
    * @param  {string} property
    *         Name of the changed property
    */
   _notifyPropertyChanged: function (property) {
-    events.emit(this, "property-change", property, this.form()[property]);
+    this.emit("property-change", property, this.form()[property]);
   },
 
   /**
    * Protocol method to get the text of this stylesheet.
    */
   getText: function () {
     return this._getText().then((text) => {
       return new LongStringActor(this.conn, text || "");
@@ -741,21 +740,21 @@ var StyleSheetActor = protocol.ActorClas
 
     this.text = text;
 
     this._notifyPropertyChanged("ruleCount");
 
     if (transition) {
       this._insertTransistionRule(kind);
     } else {
-      events.emit(this, "style-applied", kind, this);
+      this.emit("style-applied", kind, this);
     }
 
     this._getMediaRules().then((rules) => {
-      events.emit(this, "media-rules-changed", rules);
+      this.emit("media-rules-changed", rules);
     });
   },
 
   /**
    * Insert a catch-all transition rule into the document. Set a timeout
    * to remove the rule after a certain time.
    */
   _insertTransistionRule: function (kind) {
@@ -781,17 +780,17 @@ var StyleSheetActor = protocol.ActorClas
     removePseudoClassLock(this.document.documentElement, TRANSITION_PSEUDO_CLASS);
 
     let index = this.rawSheet.cssRules.length - 1;
     let rule = this.rawSheet.cssRules[index];
     if (rule.selectorText == TRANSITION_RULE_SELECTOR) {
       this.rawSheet.deleteRule(index);
     }
 
-    events.emit(this, "style-applied", kind, this);
+    this.emit("style-applied", kind, this);
   }
 });
 
 exports.StyleSheetActor = StyleSheetActor;
 
 /**
  * Creates a StyleSheetsActor. StyleSheetsActor provides remote access to the
  * stylesheets of a document.
--- a/devtools/server/actors/tab.js
+++ b/devtools/server/actors/tab.js
@@ -19,27 +19,23 @@ var promise = require("promise");
 var {
   ActorPool, createExtraActors, appendExtraActors
 } = require("devtools/server/actors/common");
 var { DebuggerServer } = require("devtools/server/main");
 var DevToolsUtils = require("devtools/shared/DevToolsUtils");
 var { assert } = DevToolsUtils;
 var { TabSources } = require("./utils/TabSources");
 var makeDebugger = require("./utils/make-debugger");
+const EventEmitter = require("devtools/shared/event-emitter");
 
 loader.lazyRequireGetter(this, "ThreadActor", "devtools/server/actors/script", true);
 loader.lazyRequireGetter(this, "unwrapDebuggerObjectGlobal", "devtools/server/actors/script", true);
 loader.lazyRequireGetter(this, "WorkerActorList", "devtools/server/actors/worker-list", true);
 loader.lazyImporter(this, "ExtensionContent", "resource://gre/modules/ExtensionContent.jsm");
 
-// Assumptions on events module:
-// events needs to be dispatched synchronously,
-// by calling the listeners in the order or registration.
-loader.lazyRequireGetter(this, "events", "devtools/shared/event-emitter");
-
 loader.lazyRequireGetter(this, "StyleSheetActor", "devtools/server/actors/stylesheets", true);
 
 function getWindowID(window) {
   return window.QueryInterface(Ci.nsIInterfaceRequestor)
                .getInterface(Ci.nsIDOMWindowUtils)
                .currentInnerWindowID;
 }
 
@@ -190,16 +186,20 @@ function getInnerId(window) {
  *
  * This class is subclassed by ContentActor and others.
  * Subclasses are expected to implement a getter for the docShell property.
  *
  * @param connection DebuggerServerConnection
  *        The conection to the client.
  */
 function TabActor(connection) {
+  // This usage of decorate should be removed in favor of using ES6 extends EventEmitter.
+  // See Bug 1394816.
+  EventEmitter.decorate(this);
+
   this.conn = connection;
   this._tabActorPool = null;
   // A map of actor names to actor instances provided by extensions.
   this._extraActors = {};
   this._exited = false;
   this._sources = null;
 
   // Map of DOM stylesheets to StyleSheetActors
@@ -1204,17 +1204,17 @@ TabActor.prototype = {
     // Here is the very important call where we switch the currently
     // targeted context (it will indirectly update this.window and
     // many other attributes defined from docShell).
     Object.defineProperty(this, "docShell", {
       value: docShell,
       enumerable: true,
       configurable: true
     });
-    events.emit(this, "changed-toplevel-document");
+    this.emit("changed-toplevel-document");
     this.conn.send({
       from: this.actorID,
       type: "frameUpdate",
       selected: this.outerWindowID
     });
   },
 
   /**
@@ -1226,17 +1226,17 @@ TabActor.prototype = {
     let isTopLevel = window == this.window;
 
     // We just reset iframe list on WillNavigate, so we now list all existing
     // frames when we load a new document in the original window
     if (window == this._originalWindow && !isFrameSwitching) {
       this._updateChildDocShells();
     }
 
-    events.emit(this, "window-ready", {
+    this.emit("window-ready", {
       window: window,
       isTopLevel: isTopLevel,
       id: getWindowID(window)
     });
 
     // TODO bug 997119: move that code to ThreadActor by listening to
     // window-ready
     let threadActor = this.threadActor;
@@ -1253,17 +1253,17 @@ TabActor.prototype = {
     // Refresh the debuggee list when a new window object appears (top window or
     // iframe).
     if (threadActor.attached) {
       threadActor.dbg.addDebuggees();
     }
   },
 
   _windowDestroyed(window, id = null, isFrozen = false) {
-    events.emit(this, "window-destroyed", {
+    this.emit("window-destroyed", {
       window: window,
       isTopLevel: window == this.window,
       id: id || getWindowID(window),
       isFrozen: isFrozen
     });
   },
 
   /**
@@ -1290,17 +1290,17 @@ TabActor.prototype = {
       }
     }
 
     // will-navigate event needs to be dispatched synchronously,
     // by calling the listeners in the order or registration.
     // This event fires once navigation starts,
     // (all pending user prompts are dealt with),
     // but before the first request starts.
-    events.emit(this, "will-navigate", {
+    this.emit("will-navigate", {
       window: window,
       isTopLevel: isTopLevel,
       newURI: newURI,
       request: request
     });
 
     // We don't do anything for inner frames in TabActor.
     // (we will only update thread actor on window-ready)
@@ -1339,17 +1339,17 @@ TabActor.prototype = {
    */
   _navigate(window, isFrameSwitching = false) {
     let isTopLevel = window == this.window;
 
     // navigate event needs to be dispatched synchronously,
     // by calling the listeners in the order or registration.
     // This event is fired once the document is loaded,
     // after the load event, it's document ready-state is 'complete'.
-    events.emit(this, "navigate", {
+    this.emit("navigate", {
       window: window,
       isTopLevel: isTopLevel
     });
 
     // We don't do anything for inner frames in TabActor.
     // (we will only update thread actor on window-ready)
     if (!isTopLevel) {
       return;
@@ -1407,17 +1407,17 @@ TabActor.prototype = {
   createStyleSheetActor(styleSheet) {
     if (this._styleSheetActors.has(styleSheet)) {
       return this._styleSheetActors.get(styleSheet);
     }
     let actor = new StyleSheetActor(styleSheet, this);
     this._styleSheetActors.set(styleSheet, actor);
 
     this._tabPool.addActor(actor);
-    events.emit(this, "stylesheet-added", actor);
+    this.emit("stylesheet-added", actor);
 
     return actor;
   },
 
   removeActorByName(name) {
     if (name in this._extraActors) {
       const actor = this._extraActors[name];
       if (this._tabActorPool.has(actor)) {
--- a/devtools/server/actors/timeline.js
+++ b/devtools/server/actors/timeline.js
@@ -16,51 +16,50 @@
  * @see devtools/server/performance/timeline.js
  */
 
 const protocol = require("devtools/shared/protocol");
 const { Option, RetVal } = protocol;
 const { actorBridgeWithSpec } = require("devtools/server/actors/common");
 const { Timeline } = require("devtools/server/performance/timeline");
 const { timelineSpec } = require("devtools/shared/specs/timeline");
-const events = require("devtools/shared/event-emitter");
 
 /**
  * The timeline actor pops and forwards timeline markers registered in docshells.
  */
 exports.TimelineActor = protocol.ActorClassWithSpec(timelineSpec, {
   /**
    * Initializes this actor with the provided connection and tab actor.
    */
   initialize: function (conn, tabActor) {
     protocol.Actor.prototype.initialize.call(this, conn);
     this.tabActor = tabActor;
     this.bridge = new Timeline(tabActor);
 
     this._onTimelineEvent = this._onTimelineEvent.bind(this);
-    events.on(this.bridge, "*", this._onTimelineEvent);
+    this.bridge.on("*", this._onTimelineEvent);
   },
 
   /**
    * Destroys this actor, stopping recording first.
    */
   destroy: function () {
-    events.off(this.bridge, "*", this._onTimelineEvent);
+    this.bridge.off("*", this._onTimelineEvent);
     this.bridge.destroy();
     this.bridge = null;
     this.tabActor = null;
     protocol.Actor.prototype.destroy.call(this);
   },
 
   /**
    * Propagate events from the Timeline module over RDP if the event is defined
    * here.
    */
   _onTimelineEvent: function (eventName, ...args) {
-    events.emit(this, eventName, ...args);
+    this.emit(eventName, ...args);
   },
 
   isRecording: actorBridgeWithSpec("isRecording", {
     request: {},
     response: {
       value: RetVal("boolean")
     }
   }),
--- a/devtools/server/actors/webaudio.js
+++ b/devtools/server/actors/webaudio.js
@@ -2,22 +2,20 @@
  * 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";
 
 /* global XPCNativeWrapper */
 
 const { Cu, Cc, Ci } = require("chrome");
 
-const events = require("devtools/shared/event-emitter");
 const protocol = require("devtools/shared/protocol");
 const { CallWatcherActor } = require("devtools/server/actors/call-watcher");
 const { createValueGrip } = require("devtools/server/actors/object");
 const AutomationTimeline = require("./utils/automation-timeline");
-const { on, off, emit } = events;
 const {
   audionodeSpec,
   webAudioSpec
 } = require("devtools/shared/specs/webaudio");
 const { WebAudioFront } = require("devtools/shared/fronts/webaudio");
 
 const observerService = Cc["@mozilla.org/observer-service;1"]
                        .getService(Ci.nsIObserverService);
@@ -464,20 +462,20 @@ exports.WebAudioActor = protocol.ActorCl
       tracedGlobals: AUDIO_GLOBALS,
       startRecording: true,
       performReload: reload,
       holdWeak: true,
       storeCalls: false
     });
     // Bind to `window-ready` so we can reenable recording on the
     // call watcher
-    on(this.tabActor, "window-ready", this._onGlobalCreated);
+    this.tabActor.on("window-ready", this._onGlobalCreated);
     // Bind to the `window-destroyed` event so we can unbind events between
     // the global destruction and the `finalize` cleanup method on the actor.
-    on(this.tabActor, "window-destroyed", this._onGlobalDestroyed);
+    this.tabActor.on("window-destroyed", this._onGlobalDestroyed);
   },
 
   /**
    * Invoked whenever an instrumented function is called, like an
    * BaseAudioContext method or an AudioNode method.
    */
   _onContentFunctionCall: function (functionCall) {
     let { name } = functionCall.details;
@@ -560,18 +558,18 @@ exports.WebAudioActor = protocol.ActorCl
 
     try {
       observerService.removeObserver(this, "webaudio-node-demise");
     } catch (e) {
       // Maybe we've shutdown already and it's too late to remove the observer. So avoid
       // NS_ERROR_FAILURE errors with this silent try/catch.
     }
 
-    off(this.tabActor, "window-destroyed", this._onGlobalDestroyed);
-    off(this.tabActor, "window-ready", this._onGlobalCreated);
+    this.tabActor.off("window-destroyed", this._onGlobalDestroyed);
+    this.tabActor.off("window-ready", this._onGlobalCreated);
     this.tabActor = null;
     this._nativeToActorID = null;
     this._callWatcher.eraseRecording();
     this._callWatcher.finalize();
     this._callWatcher = null;
   },
 
   /**
@@ -623,71 +621,71 @@ exports.WebAudioActor = protocol.ActorCl
     return actor;
   },
 
   /**
    * Called on first audio node creation, signifying audio context usage
    */
   _onStartContext: function () {
     observerService.addObserver(this, "webaudio-node-demise");
-    emit(this, "start-context");
+    this.emit("start-context");
   },
 
   /**
    * Called when one audio node is connected to another.
    */
   _onConnectNode: function (source, dest) {
     let sourceActor = this._getActorByNativeID(source.id);
     let destActor = this._getActorByNativeID(dest.id);
 
-    emit(this, "connect-node", {
+    this.emit("connect-node", {
       source: sourceActor,
       dest: destActor
     });
   },
 
   /**
    * Called when an audio node is connected to an audio param.
    */
   _onConnectParam: function (source, param) {
     let sourceActor = this._getActorByNativeID(source.id);
     let destActor = this._getActorByNativeID(param._parentID);
-    emit(this, "connect-param", {
+    this.emit("connect-param", {
       source: sourceActor,
       dest: destActor,
       param: param._paramName
     });
   },
 
   /**
    * Called when an audio node is disconnected.
    */
   _onDisconnectNode: function (node) {
     let actor = this._getActorByNativeID(node.id);
-    emit(this, "disconnect-node", actor);
+    this.emit("disconnect-node", actor);
   },
 
   /**
    * Called when a parameter changes on an audio node
    */
   _onParamChange: function (node, param, value) {
     let actor = this._getActorByNativeID(node.id);
-    emit(this, "param-change", {
+    this.emit("param-change", {
       source: actor,
       param: param,
       value: value
     });
   },
 
   /**
    * Called on node creation.
    */
   _onCreateNode: function (node) {
     let actor = this._constructAudioNode(node);
-    emit(this, "create-node", actor);
+    this.emit("create-node", actor);
   },
 
   /**
    * Called by the ObserverService when webaudio-node-demise events are emitted.
    */
   observe: function (subject, topic, data) {
     switch (topic) {
       case "webaudio-node-demise":
@@ -705,17 +703,17 @@ exports.WebAudioActor = protocol.ActorCl
   _handleNodeDestroyed: function (nodeNativeID) {
     let actor = this._getActorByNativeID(nodeNativeID);
 
     // If actorID exists, emit; in the case where we get demise
     // notifications for a document that no longer exists,
     // the mapping should not be found, so we do not emit an event.
     if (actor) {
       this._nativeToActorID.delete(nodeNativeID);
-      emit(this, "destroy-node", actor);
+      this.emit("destroy-node", actor);
     }
   },
 
   /**
    * Ensures that the new global has recording on
    * so we can proxy the function calls.
    */
   _onGlobalCreated: function () {
@@ -729,17 +727,17 @@ exports.WebAudioActor = protocol.ActorCl
 
     this._callWatcher.resumeRecording();
   },
 
   /**
    * Fired when an automation event is added to an AudioNode.
    */
   _onAutomationEvent: function ({node, paramName, eventName, args}) {
-    emit(this, "automation-event", {
+    this.emit("automation-event", {
       node: node,
       paramName: paramName,
       eventName: eventName,
       args: args
     });
   },
 
   /**
--- a/devtools/server/actors/webconsole.js
+++ b/devtools/server/actors/webconsole.js
@@ -15,25 +15,25 @@ const { ThreadActor } = require("devtool
 const { ObjectActor, LongStringActor, createValueGrip, stringIsLong } = require("devtools/server/actors/object");
 const DevToolsUtils = require("devtools/shared/DevToolsUtils");
 const ErrorDocs = require("devtools/server/actors/errordocs");
 
 loader.lazyRequireGetter(this, "NetworkMonitor", "devtools/shared/webconsole/network-monitor", true);
 loader.lazyRequireGetter(this, "NetworkMonitorChild", "devtools/shared/webconsole/network-monitor", true);
 loader.lazyRequireGetter(this, "ConsoleProgressListener", "devtools/shared/webconsole/network-monitor", true);
 loader.lazyRequireGetter(this, "StackTraceCollector", "devtools/shared/webconsole/network-monitor", true);
-loader.lazyRequireGetter(this, "events", "devtools/shared/event-emitter");
 loader.lazyRequireGetter(this, "ServerLoggingListener", "devtools/shared/webconsole/server-logger", true);
 loader.lazyRequireGetter(this, "JSPropertyProvider", "devtools/shared/webconsole/js-property-provider", true);
 loader.lazyRequireGetter(this, "Parser", "resource://devtools/shared/Parser.jsm", true);
 loader.lazyRequireGetter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm", true);
 loader.lazyRequireGetter(this, "addWebConsoleCommands", "devtools/server/actors/webconsole/utils", true);
 loader.lazyRequireGetter(this, "CONSOLE_WORKER_IDS", "devtools/server/actors/webconsole/utils", true);
 loader.lazyRequireGetter(this, "WebConsoleUtils", "devtools/server/actors/webconsole/utils", true);
 loader.lazyRequireGetter(this, "EnvironmentActor", "devtools/server/actors/environment", true);
+loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
 
 // Overwrite implemented listeners for workers so that we don't attempt
 // to load an unsupported module.
 if (isWorker) {
   loader.lazyRequireGetter(this, "ConsoleAPIListener", "devtools/server/actors/webconsole/worker-listeners", true);
   loader.lazyRequireGetter(this, "ConsoleServiceListener", "devtools/server/actors/webconsole/worker-listeners", true);
 } else {
   loader.lazyRequireGetter(this, "ConsoleAPIListener", "devtools/server/actors/webconsole/listeners", true);
@@ -66,17 +66,17 @@ function WebConsoleActor(connection, par
   this._netEvents = new Map();
   this._gripDepth = 0;
   this._listeners = new Set();
   this._lastConsoleInputEvaluation = undefined;
 
   this.objectGrip = this.objectGrip.bind(this);
   this._onWillNavigate = this._onWillNavigate.bind(this);
   this._onChangedToplevelDocument = this._onChangedToplevelDocument.bind(this);
-  events.on(this.parentActor, "changed-toplevel-document",
+  EventEmitter.on(this.parentActor, "changed-toplevel-document",
             this._onChangedToplevelDocument);
   this._onObserverNotification = this._onObserverNotification.bind(this);
   if (this.parentActor.isRootActor) {
     Services.obs.addObserver(this._onObserverNotification,
                              "last-pb-context-exited");
   }
 
   this.traits = {
@@ -244,17 +244,17 @@ WebConsoleActor.prototype =
   get evalWindow() {
     return this._evalWindow || this.window;
   },
 
   set evalWindow(window) {
     this._evalWindow = window;
 
     if (!this._progressListenerActive) {
-      events.on(this.parentActor, "will-navigate", this._onWillNavigate);
+      EventEmitter.on(this.parentActor, "will-navigate", this._onWillNavigate);
       this._progressListenerActive = true;
     }
   },
 
   /**
    * Flag used to track if we are listening for events from the progress
    * listener of the tab actor. We use the progress listener to clear
    * this.evalWindow on page navigation.
@@ -369,17 +369,17 @@ WebConsoleActor.prototype =
       this.serverLoggingListener.destroy();
       this.serverLoggingListener = null;
     }
     if (this.contentProcessListener) {
       this.contentProcessListener.destroy();
       this.contentProcessListener = null;
     }
 
-    events.off(this.parentActor, "changed-toplevel-document",
+    EventEmitter.off(this.parentActor, "changed-toplevel-document",
                this._onChangedToplevelDocument);
 
     this.conn.removeActorPool(this._actorPool);
 
     if (this.parentActor.isRootActor) {
       Services.obs.removeObserver(this._onObserverNotification,
                                   "last-pb-context-exited");
     }
@@ -1860,17 +1860,17 @@ WebConsoleActor.prototype =
 
   /**
    * The "will-navigate" progress listener. This is used to clear the current
    * eval scope.
    */
   _onWillNavigate: function ({ window, isTopLevel }) {
     if (isTopLevel) {
       this._evalWindow = null;
-      events.off(this.parentActor, "will-navigate", this._onWillNavigate);
+      EventEmitter.off(this.parentActor, "will-navigate", this._onWillNavigate);
       this._progressListenerActive = false;
     }
   },
 
   /**
    * This listener is called when we switch to another frame,
    * mostly to unregister previous listeners and start listening on the new document.
    */
--- a/devtools/server/actors/webgl.js
+++ b/devtools/server/actors/webgl.js
@@ -1,21 +1,20 @@
 /* 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";
 
 /* global XPCNativeWrapper */
 
 const {Cu} = require("chrome");
-const events = require("devtools/shared/event-emitter");
+const EventEmitter = require("devtools/shared/event-emitter");
 const defer = require("devtools/shared/defer");
 const protocol = require("devtools/shared/protocol");
 const { ContentObserver } = require("devtools/shared/content-observer");
-const { on, off, emit } = events;
 const {
   shaderSpec,
   programSpec,
   webGLSpec,
 } = require("devtools/shared/specs/webgl");
 
 const WEBGL_CONTEXT_NAMES = ["webgl", "experimental-webgl", "moz-webgl"];
 
@@ -210,19 +209,19 @@ exports.WebGLActor = protocol.ActorClass
     if (this._initialized) {
       return;
     }
     this._initialized = true;
 
     this._programActorsCache = [];
     this._webglObserver = new WebGLObserver();
 
-    on(this.tabActor, "window-ready", this._onGlobalCreated);
-    on(this.tabActor, "window-destroyed", this._onGlobalDestroyed);
-    on(this._webglObserver, "program-linked", this._onProgramLinked);
+    this.tabActor.on("window-ready", this._onGlobalCreated);
+    this.tabActor.on("window-destroyed", this._onGlobalDestroyed);
+    EventEmitter.on(this._webglObserver, "program-linked", this._onProgramLinked);
 
     if (reload) {
       this.tabActor.window.location.reload();
     }
   },
 
   /**
    * Stops listening for document global changes and puts this actor
@@ -230,19 +229,19 @@ exports.WebGLActor = protocol.ActorClass
    * actor is destroyed.
    */
   finalize: function () {
     if (!this._initialized) {
       return;
     }
     this._initialized = false;
 
-    off(this.tabActor, "window-ready", this._onGlobalCreated);
-    off(this.tabActor, "window-destroyed", this._onGlobalDestroyed);
-    off(this._webglObserver, "program-linked", this._onProgramLinked);
+    this.tabActor.off("window-ready", this._onGlobalCreated);
+    this.tabActor.off("window-destroyed", this._onGlobalDestroyed);
+    EventEmitter.off(this._webglObserver, "program-linked", this._onProgramLinked);
 
     this._programActorsCache = null;
     this._contentObserver = null;
     this._webglObserver = null;
   },
 
   /**
    * Gets an array of cached program actors for the current tab actor's window.
@@ -302,38 +301,38 @@ exports.WebGLActor = protocol.ActorClass
   },
 
   /**
    * Invoked whenever the current tab actor's document global is created.
    */
   _onGlobalCreated: function ({id, window, isTopLevel}) {
     if (isTopLevel) {
       WebGLInstrumenter.handle(window, this._webglObserver);
-      events.emit(this, "global-created", id);
+      this.emit("global-created", id);
     }
   },
 
   /**
    * Invoked whenever the current tab actor's inner window is destroyed.
    */
   _onGlobalDestroyed: function ({id, isTopLevel, isFrozen}) {
     if (isTopLevel && !isFrozen) {
       removeFromArray(this._programActorsCache, e => e.ownerWindow == id);
       this._webglObserver.unregisterContextsForWindow(id);
-      events.emit(this, "global-destroyed", id);
+      this.emit("global-destroyed", id);
     }
   },
 
   /**
    * Invoked whenever an observed WebGL context links a program.
    */
   _onProgramLinked: function (...args) {
     let programActor = new ProgramActor(this.conn, args);
     this._programActorsCache.push(programActor);
-    events.emit(this, "program-linked", programActor);
+    this.emit("program-linked", programActor);
   }
 });
 
 /**
  * Instruments a HTMLCanvasElement with the appropriate inspection methods.
  */
 var WebGLInstrumenter = {
   /**
@@ -571,17 +570,17 @@ WebGLObserver.prototype = {
    *        The state storage for the WebGL context initiating this call.
    * @param WebGLProxy proxy
    *        The proxy methods for the WebGL context initiating this call.
    */
   linkProgram: function (glArgs, glResult, cache, proxy) {
     let program = glArgs[0];
     let shaders = proxy.getAttachedShaders(program);
     cache.addProgram(program, PROGRAM_DEFAULT_TRAITS);
-    emit(this, "program-linked", program, shaders, cache, proxy);
+    EventEmitter.emit(this, "program-linked", program, shaders, cache, proxy);
   },
 
   /**
    * Called immediately *after* 'getAttribLocation' is requested in the context.
    *
    * @param array glArgs
    *        Overridable arguments with which the function is called.
    * @param GLint glResult
--- a/devtools/server/actors/worker.js
+++ b/devtools/server/actors/worker.js
@@ -12,17 +12,16 @@ const protocol = require("devtools/share
 const {
   workerSpec,
   pushSubscriptionSpec,
   serviceWorkerRegistrationSpec,
   serviceWorkerSpec,
 } = require("devtools/shared/specs/worker");
 
 loader.lazyRequireGetter(this, "ChromeUtils");
-loader.lazyRequireGetter(this, "events", "devtools/shared/event-emitter");
 
 XPCOMUtils.defineLazyServiceGetter(
   this, "swm",
   "@mozilla.org/serviceworkers/manager;1",
   "nsIServiceWorkerManager"
 );
 
 XPCOMUtils.defineLazyServiceGetter(
@@ -275,17 +274,17 @@ protocol.ActorClassWithSpec(serviceWorke
     this._waitingWorker.destroy();
     this._activeWorker.destroy();
 
     let {installingWorker, waitingWorker, activeWorker} = this._registration;
     this._installingWorker = new ServiceWorkerActor(this._conn, installingWorker);
     this._waitingWorker = new ServiceWorkerActor(this._conn, waitingWorker);
     this._activeWorker = new ServiceWorkerActor(this._conn, activeWorker);
 
-    events.emit(this, "registration-changed");
+    this.emit("registration-changed");
   },
 
   form(detail) {
     if (detail === "actorid") {
       return this.actorID;
     }
     let registration = this._registration;
     let installingWorker = this._installingWorker.form();
@@ -339,17 +338,17 @@ protocol.ActorClassWithSpec(serviceWorke
       return;
     }
     switch (topic) {
       case PushService.subscriptionModifiedTopic:
         if (this._pushSubscriptionActor) {
           this._pushSubscriptionActor.destroy();
           this._pushSubscriptionActor = null;
         }
-        events.emit(this, "push-subscription-modified");
+        this.emit("push-subscription-modified");
         break;
     }
   },
 
   start() {
     if (!_serviceWorkerProcessScriptLoaded) {
       Services.ppmm.loadProcessScript(
         "resource://devtools/server/service-worker-child.js", true);
--- a/devtools/server/main.js
+++ b/devtools/server/main.js
@@ -12,17 +12,17 @@ var { Ci, Cc, CC, Cu, Cr } = require("ch
 var Services = require("Services");
 var { ActorPool, OriginalLocation, RegisteredActorFactory,
       ObservedActorFactory } = require("devtools/server/actors/common");
 var { LocalDebuggerTransport, ChildDebuggerTransport, WorkerDebuggerTransport } =
   require("devtools/shared/transport/transport");
 var DevToolsUtils = require("devtools/shared/DevToolsUtils");
 var { dumpn, dumpv } = DevToolsUtils;
 var flags = require("devtools/shared/flags");
-var EventEmitter = require("devtools/shared/old-event-emitter");
+var OldEventEmitter = require("devtools/shared/old-event-emitter");
 var SyncPromise = require("devtools/shared/deprecated-sync-thenables");
 
 DevToolsUtils.defineLazyGetter(this, "DebuggerSocket", () => {
   let { DebuggerSocket } = require("devtools/shared/security/socket");
   return DebuggerSocket;
 });
 DevToolsUtils.defineLazyGetter(this, "Authentication", () => {
   return require("devtools/shared/security/auth");
@@ -81,17 +81,17 @@ function loadSubScript(url) {
                    (e.fileName ? "at " + e.fileName + " : " + e.lineNumber + "\n" : "") +
                    e + " - " + e.stack + "\n";
     dump(errorStr);
     reportError(errorStr);
     throw e;
   }
 }
 
-loader.lazyRequireGetter(this, "events", "devtools/shared/event-emitter");
+loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
 
 var gRegisteredModules = Object.create(null);
 
 /**
  * The ModuleAPI object is passed to modules loaded using the
  * DebuggerServer.registerModule() API.  Modules can use this
  * object to register actor factories.
  * Factories registered through the module API will be removed
@@ -769,17 +769,17 @@ var DebuggerServer = {
     // Send a message to the content process debugger server script to forward it the
     // prefix.
     mm.sendAsyncMessage("debug:init-content-server", {
       prefix: prefix
     });
 
     function onClose() {
       Services.obs.removeObserver(onMessageManagerClose, "message-manager-close");
-      events.off(connection, "closed", onClose);
+      EventEmitter.off(connection, "closed", onClose);
       if (childTransport) {
         // If we have a child transport, the actor has already
         // been created. We need to stop using this message manager.
         childTransport.close();
         childTransport = null;
         connection.cancelForwarding(prefix);
 
         // ... and notify the child process to clean the tab actors.
@@ -799,17 +799,17 @@ var DebuggerServer = {
       if (subject == mm) {
         onClose();
         connection.send({ from: actor.actor, type: "tabDetached" });
       }
     });
     Services.obs.addObserver(onMessageManagerClose,
                              "message-manager-close");
 
-    events.on(connection, "closed", onClose);
+    EventEmitter.on(connection, "closed", onClose);
 
     return deferred.promise;
   },
 
   connectToWorker(connection, dbg, id, options) {
     return new Promise((resolve, reject) => {
       // Step 1: Ensure the worker debugger is initialized.
       if (!dbg.isInitialized) {
@@ -1129,17 +1129,17 @@ var DebuggerServer = {
       });
 
       if (childTransport) {
         childTransport.swapBrowser(mm);
       }
     };
 
     let destroy = DevToolsUtils.makeInfallible(function () {
-      events.off(connection, "closed", destroy);
+      EventEmitter.off(connection, "closed", destroy);
       Services.obs.removeObserver(onMessageManagerClose, "message-manager-close");
 
       // provides hook to actor modules that need to exchange messages
       // between e10s parent and child processes
       parentModules.forEach(mod => {
         if (mod.onDisconnected) {
           mod.onDisconnected();
         }
@@ -1194,17 +1194,17 @@ var DebuggerServer = {
         destroy();
       }
     };
     Services.obs.addObserver(onMessageManagerClose,
                              "message-manager-close");
 
     // Listen for connection close to cleanup things
     // when user unplug the device or we lose the connection somehow.
-    events.on(connection, "closed", destroy);
+    EventEmitter.on(connection, "closed", destroy);
 
     mm.sendAsyncMessage("debug:connect", { prefix, addonId });
 
     return deferred.promise;
   },
 
   /**
    * Create a new debugger connection for the given transport. Called after
@@ -1424,17 +1424,17 @@ var DebuggerServer = {
 // Expose these to save callers the trouble of importing DebuggerSocket
 DevToolsUtils.defineLazyGetter(DebuggerServer, "Authenticators", () => {
   return Authentication.Authenticators;
 });
 DevToolsUtils.defineLazyGetter(DebuggerServer, "AuthenticationResult", () => {
   return Authentication.AuthenticationResult;
 });
 
-EventEmitter.decorate(DebuggerServer);
+OldEventEmitter.decorate(DebuggerServer);
 
 if (this.exports) {
   exports.DebuggerServer = DebuggerServer;
   exports.ActorPool = ActorPool;
   exports.OriginalLocation = OriginalLocation;
 }
 
 // Needed on B2G (See header note)
@@ -1887,17 +1887,17 @@ DebuggerServerConnection.prototype = {
   onClosed(status) {
     dumpn("Cleaning up connection.");
     if (!this._actorPool) {
       // Ignore this call if the connection is already closed.
       return;
     }
     this._actorPool = null;
 
-    events.emit(this, "closed", status);
+    EventEmitter.emit(this, "closed", status);
 
     this._extraPools.forEach(p => p.destroy());
     this._extraPools = null;
 
     this.rootActor = null;
     this._transport = null;
     DebuggerServer._connectionClosed(this);
   },
--- a/devtools/server/performance/framerate.js
+++ b/devtools/server/performance/framerate.js
@@ -1,32 +1,29 @@
 /* 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 { on, off } = require("devtools/shared/event-emitter");
-
 /**
  * A very simple utility for monitoring framerate. Takes a `tabActor`
  * and monitors framerate over time. The actor wrapper around this
  * can be found at devtools/server/actors/framerate.js
  */
 class Framerate {
   constructor(tabActor) {
     this.tabActor = tabActor;
     this._contentWin = tabActor.window;
     this._onRefreshDriverTick = this._onRefreshDriverTick.bind(this);
     this._onGlobalCreated = this._onGlobalCreated.bind(this);
-
-    on(this.tabActor, "window-ready", this._onGlobalCreated);
+    this.tabActor.on("window-ready", this._onGlobalCreated);
   }
 
   destroy(conn) {
-    off(this.tabActor, "window-ready", this._onGlobalCreated);
+    this.tabActor.off("window-ready", this._onGlobalCreated);
     this.stopRecording();
   }
 
   /**
    * Starts monitoring framerate, storing the frames per second.
    */
   startRecording() {
     if (this._recording) {
--- a/devtools/server/performance/memory.js
+++ b/devtools/server/performance/memory.js
@@ -390,34 +390,34 @@ Memory.prototype = {
   residentUnique: function () {
     return this._mgr.residentUnique;
   },
 
   /**
    * Handler for GC events on the Debugger.Memory instance.
    */
   _onGarbageCollection: function (data) {
-    EventEmitter.emit(this, "garbage-collection", data);
+    this.emit("garbage-collection", data);
 
     // If `drainAllocationsTimeout` set, fire an allocations event with the drained log,
     // which will restart the timer.
     if (this._poller) {
       this._poller.disarm();
       this._emitAllocations();
     }
   },
 
   /**
    * Called on `drainAllocationsTimeoutTimer` interval if and only if set
    * during `startRecordingAllocations`, or on a garbage collection event if
    * drainAllocationsTimeout was set.
    * Drains allocation log and emits as an event and restarts the timer.
    */
   _emitAllocations: function () {
-    EventEmitter.emit(this, "allocations", this.getAllocations());
+    this.emit("allocations", this.getAllocations());
     this._poller.arm();
   },
 
   /**
    * Accesses the docshell to return the current process time.
    */
   _getCurrentTime: function () {
     return (this.parent.isRootActor ? this.parent.docShell :
--- a/devtools/server/performance/profiler.js
+++ b/devtools/server/performance/profiler.js
@@ -347,17 +347,17 @@ const ProfilerManager = (function () {
      * @param {object} data
      */
     emitEvent: function (eventName, data) {
       let subscribers = Array.from(consumers).filter(c => {
         return c.subscribedEvents.has(eventName);
       });
 
       for (let subscriber of subscribers) {
-        EventEmitter.emit(subscriber, eventName, data);
+        subscriber.emit(eventName, data);
       }
     },
 
     /**
      * Updates the frequency that the "profiler-status" event is emitted
      * during recording.
      *
      * @param {number} interval
--- a/devtools/server/performance/recorder.js
+++ b/devtools/server/performance/recorder.js
@@ -148,17 +148,17 @@ PerformanceRecorder.prototype = {
       if (data.subject.action === "profile") {
         this._onConsoleProfileStart(data.details);
       } else if (data.subject.action === "profileEnd") {
         this._onConsoleProfileEnd(data.details);
       }
     } else if (topic === "profiler-stopped") {
       this._onProfilerUnexpectedlyStopped();
     } else if (topic === "profiler-status") {
-      EventEmitter.emit(this, "profiler-status", data);
+      this.emit("profiler-status", data);
     }
   },
 
   /**
    * Invoked whenever `console.profile` is called.
    *
    * @param string profileLabel
    *        The provided string argument if available; undefined otherwise.
@@ -171,17 +171,17 @@ PerformanceRecorder.prototype = {
 
     // Abort if a profile with this label already exists.
     if (recordings.find(e => e.getLabel() === profileLabel)) {
       return;
     }
 
     // Immediately emit this so the client can start setting things up,
     // expecting a recording very soon.
-    EventEmitter.emit(this, "console-profile-start");
+    this.emit("console-profile-start");
 
     yield this.startRecording(Object.assign({}, getPerformanceRecordingPrefs(), {
       console: true,
       label: profileLabel
     }));
   }),
 
   /**
@@ -268,17 +268,17 @@ PerformanceRecorder.prototype = {
       }
     }
 
     // Filter by only recordings that are currently recording;
     // TODO should filter by recordings that have realtimeMarkers enabled.
     let activeRecordings = this._recordings.filter(r => r.isRecording());
 
     if (activeRecordings.length) {
-      EventEmitter.emit(this, "timeline-data", eventName, eventData, activeRecordings);
+      this.emit("timeline-data", eventName, eventData, activeRecordings);
     }
   },
 
   /**
    * Checks whether or not recording is currently supported. At the moment,
    * this is only influenced by private browsing mode and the profiler.
    */
   canCurrentlyRecord: function () {
@@ -368,17 +368,17 @@ PerformanceRecorder.prototype = {
     data.totalSize = profilerStartData.totalSize;
 
     data.systemClient = this._systemClient;
     data.systemHost = yield getSystemInfo();
 
     let model = new PerformanceRecordingActor(this.conn, options, data);
     this._recordings.push(model);
 
-    EventEmitter.emit(this, "recording-started", model);
+    this.emit("recording-started", model);
     return model;
   }),
 
   /**
    * Manually ends the recording session for the corresponding PerformanceRecording.
    *
    * @param PerformanceRecording model
    *        The corresponding PerformanceRecording that belongs to the recording
@@ -392,17 +392,17 @@ PerformanceRecorder.prototype = {
     // from a different target.
     if (this._recordings.indexOf(model) === -1) {
       return model;
     }
 
     // Flag the recording as no longer recording, so that `model.isRecording()`
     // is false. Do this before we fetch all the data, and then subsequently
     // the recording can be considered "completed".
-    EventEmitter.emit(this, "recording-stopping", model);
+    this.emit("recording-stopping", model);
 
     // Currently there are two ways profiles stop recording. Either manually in the
     // performance tool, or via console.profileEnd. Once a recording is done,
     // we want to deliver the model to the performance tool (either as a return
     // from the PerformanceFront or via `console-profile-stop` event) and then
     // remove it from the internal store.
     //
     // In the case where a console.profile is generated via the console (so the tools are
@@ -427,17 +427,17 @@ PerformanceRecorder.prototype = {
 
     let recordingData = {
       // Data available only at the end of a recording.
       profile: profilerData.profile,
       // End times for all the actors.
       duration: profilerData.currentTime - startTime,
     };
 
-    EventEmitter.emit(this, "recording-stopped", model, recordingData);
+    this.emit("recording-stopped", model, recordingData);
     return model;
   }),
 
   /**
    * Checks all currently stored recording handles and returns a boolean
    * if there is a session currently being recorded.
    *
    * @return Boolean
--- a/devtools/server/performance/timeline.js
+++ b/devtools/server/performance/timeline.js
@@ -46,27 +46,27 @@ function Timeline(tabActor) {
   this._isRecording = false;
   this._stackFrames = null;
   this._memory = null;
   this._framerate = null;
 
   // Make sure to get markers from new windows as they become available
   this._onWindowReady = this._onWindowReady.bind(this);
   this._onGarbageCollection = this._onGarbageCollection.bind(this);
-  EventEmitter.on(this.tabActor, "window-ready", this._onWindowReady);
+  this.tabActor.on("window-ready", this._onWindowReady);
 }
 
 Timeline.prototype = {
   /**
    * Destroys this actor, stopping recording first.
    */
   destroy: function () {
     this.stop();
 
-    EventEmitter.off(this.tabActor, "window-ready", this._onWindowReady);
+    this.tabActor.off("window-ready", this._onWindowReady);
     this.tabActor = null;
   },
 
   /**
    * Get the list of docShells in the currently attached tabActor. Note that we
    * always list the docShells included in the real root docShell, even if the
    * tabActor was switched to a child frame. This is because for now, paint
    * markers are only recorded at parent frame level so switching the timeline
@@ -136,43 +136,43 @@ Timeline.prototype = {
               );
             }
           }
 
           // Emit some helper events for "DOMContentLoaded" and "Load" markers.
           if (this._withDocLoadingEvents) {
             if (marker.name == "document::DOMContentLoaded" ||
                 marker.name == "document::Load") {
-              EventEmitter.emit(this, "doc-loading", marker, endTime);
+              this.emit("doc-loading", marker, endTime);
             }
           }
         }
       }
     }
 
     // Emit markers if requested.
     if (this._withMarkers && markers.length > 0) {
-      EventEmitter.emit(this, "markers", markers, endTime);
+      this.emit("markers", markers, endTime);
     }
 
     // Emit framerate data if requested.
     if (this._withTicks) {
-      EventEmitter.emit(this, "ticks", endTime, this._framerate.getPendingTicks());
+      this.emit("ticks", endTime, this._framerate.getPendingTicks());
     }
 
     // Emit memory data if requested.
     if (this._withMemory) {
-      EventEmitter.emit(this, "memory", endTime, this._memory.measure());
+      this.emit("memory", endTime, this._memory.measure());
     }
 
     // Emit stack frames data if requested.
     if (this._withFrames && this._withMarkers) {
       let frames = this._stackFrames.makeEvent();
       if (frames) {
-        EventEmitter.emit(this, "frames", endTime, frames);
+        this.emit("frames", endTime, frames);
       }
     }
 
     this._dataPullTimeout = setTimeout(() => {
       this._pullTimelineData();
     }, DEFAULT_TIMELINE_DATA_PULL_TIMEOUT);
   },
 
@@ -242,17 +242,17 @@ Timeline.prototype = {
     }
 
     if (this._withMemory || this._withGCEvents) {
       this._memory = new Memory(this.tabActor, this._stackFrames);
       this._memory.attach();
     }
 
     if (this._withGCEvents) {
-      EventEmitter.on(this._memory, "garbage-collection", this._onGarbageCollection);
+      this._memory.on("garbage-collection", this._onGarbageCollection);
     }
 
     if (this._withFrames && this._withMarkers) {
       this._stackFrames = new StackFrameCache();
       this._stackFrames.initFrames();
     }
 
     this._pullTimelineData();
@@ -285,17 +285,17 @@ Timeline.prototype = {
     }
 
     if (this._withMemory || this._withGCEvents) {
       this._memory.detach();
       this._memory.destroy();
     }
 
     if (this._withGCEvents) {
-      EventEmitter.off(this._memory, "garbage-collection", this._onGarbageCollection);
+      this._memory.off("garbage-collection", this._onGarbageCollection);
     }
 
     if (this._withFrames && this._withMarkers) {
       this._stackFrames = null;
     }
 
     this._isRecording = false;
     this._withMarkers = false;
@@ -337,17 +337,17 @@ Timeline.prototype = {
   }) {
     let docShells = this.docShells;
     if (!this._isRecording || !docShells.length) {
       return;
     }
 
     let endTime = docShells[0].now();
 
-    EventEmitter.emit(this, "markers", collections.map(({
+    this.emit("markers", collections.map(({
       startTimestamp: start, endTimestamp: end
     }) => {
       return {
         name: "GarbageCollection",
         causeName: reason,
         nonincrementalReason: nonincrementalReason,
         cycle: gcCycleNumber,
         start,
--- a/devtools/server/tests/browser/browser_navigateEvents.js
+++ b/devtools/server/tests/browser/browser_navigateEvents.js
@@ -2,17 +2,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const URL1 = MAIN_DOMAIN + "navigate-first.html";
 const URL2 = MAIN_DOMAIN + "navigate-second.html";
 
-var events = require("devtools/shared/event-emitter");
+var EventEmitter = require("devtools/shared/event-emitter");
 var client;
 
 SpecialPowers.pushPrefEnv(
   {"set": [["dom.require_user_interaction_for_beforeunload", false]]});
 
 // State machine to check events order
 var i = 0;
 function assertEvent(event, data) {
@@ -120,20 +120,20 @@ function getServerTabActor(callback) {
   });
 }
 
 function test() {
   // Open a test tab
   addTab(URL1).then(function (browser) {
     getServerTabActor(function (tabActor) {
       // In order to listen to internal will-navigate/navigate events
-      events.on(tabActor, "will-navigate", function (data) {
+      EventEmitter.on(tabActor, "will-navigate", function (data) {
         assertEvent("will-navigate", data);
       });
-      events.on(tabActor, "navigate", function (data) {
+      EventEmitter.on(tabActor, "navigate", function (data) {
         assertEvent("navigate", data);
       });
 
       // Start listening for page load events
       browser.addEventListener("DOMContentLoaded", onDOMContentLoaded, true);
       browser.addEventListener("load", onLoad, true);
 
       // Listen for alert() call being made in navigate-first during unload
--- a/devtools/server/tests/mochitest/test_memory_gc_events.html
+++ b/devtools/server/tests/mochitest/test_memory_gc_events.html
@@ -13,24 +13,24 @@ Bug 1137527 - Test receiving GC events f
 <pre id="test">
 <script src="memory-helpers.js" type="application/javascript"></script>
 <script>
 "use strict";
 
 window.onload = function () {
   SimpleTest.waitForExplicitFinish();
 
-  let event = require("devtools/shared/event-emitter");
+  let EventEmitter = require("devtools/shared/event-emitter");
 
   Task.spawn(function* () {
     let { memory, client } = yield startServerAndGetSelectedTabMemory();
     yield memory.attach();
 
     let gotGcEvent = new Promise(resolve => {
-      event.on(memory, "garbage-collection", gcData => {
+      EventEmitter.on(memory, "garbage-collection", gcData => {
         ok(gcData, "Got GC data");
         resolve();
       });
     });
 
     memory.forceGarbageCollection();
     yield gotGcEvent;
 
--- a/devtools/server/tests/unit/test_layout-reflows-observer.js
+++ b/devtools/server/tests/unit/test_layout-reflows-observer.js
@@ -5,30 +5,34 @@
 
 // Test the LayoutChangesObserver
 
 var {
   getLayoutChangesObserver,
   releaseLayoutChangesObserver,
   LayoutChangesObserver
 } = require("devtools/server/actors/reflow");
+const EventEmitter = require("devtools/shared/event-emitter");
 
 // Override set/clearTimeout on LayoutChangesObserver to avoid depending on
 // time in this unit test. This means that LayoutChangesObserver.eventLoopTimer
 // will be the timeout callback instead of the timeout itself, so test cases
 // will need to execute it to fake a timeout
 LayoutChangesObserver.prototype._setTimeout = cb => cb;
 LayoutChangesObserver.prototype._clearTimeout = function () {};
 
 // Mock the tabActor since we only really want to test the LayoutChangesObserver
 // and don't want to depend on a window object, nor want to test protocol.js
-function MockTabActor() {
-  this.window = new MockWindow();
-  this.windows = [this.window];
-  this.attached = true;
+class MockTabActor extends EventEmitter {
+  constructor() {
+    super();
+    this.window = new MockWindow();
+    this.windows = [this.window];
+    this.attached = true;
+  }
 }
 
 function MockWindow() {}
 MockWindow.prototype = {
   QueryInterface: function () {
     let self = this;
     return {
       getInterface: function () {
--- a/devtools/server/tests/unit/test_promises_actor_onnewpromise.js
+++ b/devtools/server/tests/unit/test_promises_actor_onnewpromise.js
@@ -5,17 +5,17 @@
  * Test that we can get the list of all new Promise objects from the
  * PromisesActor onNewPromise event handler.
  */
 
 "use strict";
 
 const { PromisesFront } = require("devtools/shared/fronts/promises");
 
-var events = require("devtools/shared/event-emitter");
+var EventEmitter = require("devtools/shared/event-emitter");
 
 add_task(function* () {
   let client = yield startTestDebuggerServer("promises-actor-test");
   let chromeActors = yield getChromeActors(client);
 
   ok(Promise.toString().includes("native code"), "Expect native DOM Promise");
 
   // We have to attach the chrome TabActor before playing with the PromiseActor
@@ -39,17 +39,17 @@ function* testNewPromisesEvent(client, f
   let front = PromisesFront(client, form);
   let resolution = "MyLittleSecret" + Math.random();
   let found = false;
 
   yield front.attach();
   yield front.listPromises();
 
   let onNewPromise = new Promise(resolve => {
-    events.on(front, "new-promises", promises => {
+    EventEmitter.on(front, "new-promises", promises => {
       for (let p of promises) {
         equal(p.type, "object", "Expect type to be Object");
         equal(p.class, "Promise", "Expect class to be Promise");
         equal(typeof p.promiseState.creationTimestamp, "number",
           "Expect creation timestamp to be a number");
 
         if (p.promiseState.state === "fulfilled" &&
             p.promiseState.value === resolution) {
--- a/devtools/server/tests/unit/test_promises_actor_onpromisesettled.js
+++ b/devtools/server/tests/unit/test_promises_actor_onpromisesettled.js
@@ -7,17 +7,17 @@
  */
 
 "use strict";
 
 Cu.import("resource://testing-common/PromiseTestUtils.jsm", this);
 
 const { PromisesFront } = require("devtools/shared/fronts/promises");
 
-var events = require("devtools/shared/event-emitter");
+var EventEmitter = require("devtools/shared/event-emitter");
 
 add_task(function* () {
   let client = yield startTestDebuggerServer("promises-actor-test");
   let chromeActors = yield getChromeActors(client);
 
   ok(Promise.toString().includes("native code"), "Expect native DOM Promise");
 
   // We have to attach the chrome TabActor before playing with the PromiseActor
@@ -63,17 +63,17 @@ function* testPromisesSettled(client, fo
   yield front.detach();
   // Appease eslint
   void resolvedPromise;
   void rejectedPromise;
 }
 
 function oncePromiseSettled(front, resolution, resolveValue, rejectValue) {
   return new Promise(resolve => {
-    events.on(front, "promises-settled", promises => {
+    EventEmitter.on(front, "promises-settled", promises => {
       for (let p of promises) {
         equal(p.type, "object", "Expect type to be Object");
         equal(p.class, "Promise", "Expect class to be Promise");
         equal(typeof p.promiseState.creationTimestamp, "number",
           "Expect creation timestamp to be a number");
         equal(typeof p.promiseState.timeToSettle, "number",
           "Expect time to settle to be a number");
 
--- a/devtools/server/tests/unit/test_promises_client_getdependentpromises.js
+++ b/devtools/server/tests/unit/test_promises_client_getdependentpromises.js
@@ -4,17 +4,17 @@
 /**
  * Test that we can get the list of dependent promises from the ObjectClient.
  */
 
 "use strict";
 
 const { PromisesFront } = require("devtools/shared/fronts/promises");
 
-var events = require("devtools/shared/event-emitter");
+var EventEmitter = require("devtools/shared/event-emitter");
 
 add_task(function* () {
   let client = yield startTestDebuggerServer("test-promises-dependentpromises");
   let chromeActors = yield getChromeActors(client);
   yield attachTab(client, chromeActors);
 
   ok(Promise.toString().includes("native code"), "Expect native DOM Promise.");
 
@@ -54,17 +54,17 @@ add_task(function* () {
 function* testGetDependentPromises(client, form, makePromises) {
   let front = PromisesFront(client, form);
 
   yield front.attach();
   yield front.listPromises();
 
   // Get the grip for promise p
   let onNewPromise = new Promise(resolve => {
-    events.on(front, "new-promises", promises => {
+    EventEmitter.on(front, "new-promises", promises => {
       for (let p of promises) {
         if (p.preview.ownProperties.name &&
             p.preview.ownProperties.name.value === "p") {
           resolve(p);
         }
       }
     });
   });
--- a/devtools/server/tests/unit/test_promises_object_creationtimestamp.js
+++ b/devtools/server/tests/unit/test_promises_object_creationtimestamp.js
@@ -4,17 +4,17 @@
 /**
  * Test that we get the approximate time range for promise creation timestamp.
  */
 
 "use strict";
 
 const { PromisesFront } = require("devtools/shared/fronts/promises");
 
-var events = require("devtools/shared/event-emitter");
+var EventEmitter = require("devtools/shared/event-emitter");
 
 add_task(function* () {
   let client = yield startTestDebuggerServer("promises-object-test");
   let chromeActors = yield getChromeActors(client);
 
   ok(Promise.toString().includes("native code"), "Expect native DOM Promise.");
 
   // We have to attach the chrome TabActor before playing with the PromiseActor
@@ -38,17 +38,17 @@ add_task(function* () {
 function* testPromiseCreationTimestamp(client, form, makePromise) {
   let front = PromisesFront(client, form);
   let resolution = "MyLittleSecret" + Math.random();
 
   yield front.attach();
   yield front.listPromises();
 
   let onNewPromise = new Promise(resolve => {
-    events.on(front, "new-promises", promises => {
+    EventEmitter.on(front, "new-promises", promises => {
       for (let p of promises) {
         if (p.promiseState.state === "fulfilled" &&
             p.promiseState.value === resolution) {
           resolve(p);
         }
       }
     });
   });
--- a/devtools/server/tests/unit/test_promises_object_timetosettle-01.js
+++ b/devtools/server/tests/unit/test_promises_object_timetosettle-01.js
@@ -5,17 +5,17 @@
  * Test whether or not we get the time to settle depending on the state of the
  * promise.
  */
 
 "use strict";
 
 const { PromisesFront } = require("devtools/shared/fronts/promises");
 
-var events = require("devtools/shared/event-emitter");
+var EventEmitter = require("devtools/shared/event-emitter");
 
 add_task(function* () {
   let client = yield startTestDebuggerServer("test-promises-timetosettle");
   let chromeActors = yield getChromeActors(client);
 
   ok(Promise.toString().includes("native code"), "Expect native DOM Promise.");
 
   // We have to attach the chrome TabActor before playing with the PromiseActor
@@ -50,17 +50,17 @@ add_task(function* () {
 
 function* testGetTimeToSettle(client, form, makePromises) {
   let front = PromisesFront(client, form);
 
   yield front.attach();
   yield front.listPromises();
 
   let onNewPromise = new Promise(resolve => {
-    events.on(front, "new-promises", promises => {
+    EventEmitter.on(front, "new-promises", promises => {
       for (let p of promises) {
         if (p.promiseState.state === "pending") {
           ok(!p.promiseState.timeToSettle,
             "Expect no time to settle for unsettled promise.");
         } else {
           ok(p.promiseState.timeToSettle,
             "Expect time to settle for settled promise.");
           equal(typeof p.promiseState.timeToSettle, "number",
--- a/devtools/server/tests/unit/test_promises_object_timetosettle-02.js
+++ b/devtools/server/tests/unit/test_promises_object_timetosettle-02.js
@@ -6,17 +6,17 @@
  * Test that we get the expected settlement time for promise time to settle.
  */
 
 "use strict";
 
 const { PromisesFront } = require("devtools/shared/fronts/promises");
 const { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
 
-var events = require("devtools/shared/event-emitter");
+var EventEmitter = require("devtools/shared/event-emitter");
 
 add_task(function* () {
   let client = yield startTestDebuggerServer("test-promises-timetosettle");
   let chromeActors = yield getChromeActors(client);
   yield attachTab(client, chromeActors);
 
   ok(Promise.toString().includes("native code"), "Expect native DOM Promise.");
 
@@ -43,17 +43,17 @@ function* testGetTimeToSettle(client, fo
   let front = PromisesFront(client, form);
   let resolution = "MyLittleSecret" + Math.random();
   let found = false;
 
   yield front.attach();
   yield front.listPromises();
 
   let onNewPromise = new Promise(resolve => {
-    events.on(front, "promises-settled", promises => {
+    EventEmitter.on(front, "promises-settled", promises => {
       for (let p of promises) {
         if (p.promiseState.state === "fulfilled" &&
             p.promiseState.value === resolution) {
           let timeToSettle = Math.floor(p.promiseState.timeToSettle / 100) * 100;
           ok(timeToSettle >= 100,
             "Expect time to settle for resolved promise to be " +
             "at least 100ms, got " + timeToSettle + "ms.");
           found = true;
--- a/devtools/server/tests/unit/test_protocol_children.js
+++ b/devtools/server/tests/unit/test_protocol_children.js
@@ -5,17 +5,17 @@
 "use strict";
 
 /**
  * Test simple requests using the protocol helpers.
  */
 var protocol = require("devtools/shared/protocol");
 var {preEvent, types, Arg, RetVal} = protocol;
 
-var events = require("devtools/shared/event-emitter");
+var EventEmitter = require("devtools/shared/event-emitter");
 
 function simpleHello() {
   return {
     from: "root",
     applicationType: "xpcshell-tests",
     traits: [],
   };
 }
@@ -146,21 +146,21 @@ var ChildActor = protocol.ActorClassWith
     return f();
   },
 
   getSibling: function (id) {
     return this.parent().getChild(id);
   },
 
   emitEvents: function () {
-    events.emit(this, "event1", 1, 2, 3);
-    events.emit(this, "event2", 4, 5, 6);
-    events.emit(this, "named-event", 1, 2, 3);
-    events.emit(this, "object-event", this);
-    events.emit(this, "array-object-event", [this]);
+    EventEmitter.emit(this, "event1", 1, 2, 3);
+    EventEmitter.emit(this, "event2", 4, 5, 6);
+    EventEmitter.emit(this, "named-event", 1, 2, 3);
+    EventEmitter.emit(this, "object-event", this);
+    EventEmitter.emit(this, "array-object-event", [this]);
   },
 
   release: function () { },
 });
 
 var ChildFront = protocol.FrontClassWithSpec(childSpec, {
   initialize: function (client, form) {
     protocol.Front.prototype.initialize.call(this, client, form);
--- a/devtools/server/tests/unit/test_protocol_longstring.js
+++ b/devtools/server/tests/unit/test_protocol_longstring.js
@@ -4,17 +4,17 @@
 
 "use strict";
 
 /**
  * Test simple requests using the protocol helpers.
  */
 var protocol = require("devtools/shared/protocol");
 var {RetVal, Arg} = protocol;
-var events = require("devtools/shared/event-emitter");
+var EventEmitter = require("devtools/shared/event-emitter");
 var {LongStringActor} = require("devtools/server/actors/string");
 
 // The test implicitly relies on this.
 require("devtools/shared/fronts/string");
 
 function simpleHello() {
   return {
     from: "root",
@@ -72,21 +72,21 @@ var RootActor = protocol.ActorClassWithS
     return new LongStringActor(this.conn, SHORT_STR);
   },
 
   longString: function () {
     return new LongStringActor(this.conn, LONG_STR);
   },
 
   emitShortString: function () {
-    events.emit(this, "string-event", new LongStringActor(this.conn, SHORT_STR));
+    EventEmitter.emit(this, "string-event", new LongStringActor(this.conn, SHORT_STR));
   },
 
   emitLongString: function () {
-    events.emit(this, "string-event", new LongStringActor(this.conn, LONG_STR));
+    EventEmitter.emit(this, "string-event", new LongStringActor(this.conn, LONG_STR));
   },
 });
 
 var RootFront = protocol.FrontClassWithSpec(rootSpec, {
   initialize: function (client) {
     this.actorID = "root";
     protocol.Front.prototype.initialize.call(this, client);
     // Root owns itself.
--- a/devtools/server/tests/unit/test_protocol_simple.js
+++ b/devtools/server/tests/unit/test_protocol_simple.js
@@ -4,17 +4,17 @@
 "use strict";
 
 /**
  * Test simple requests using the protocol helpers.
  */
 
 var protocol = require("devtools/shared/protocol");
 var {Arg, Option, RetVal} = protocol;
-var events = require("devtools/shared/event-emitter");
+var EventEmitter = require("devtools/shared/event-emitter");
 
 function simpleHello() {
   return {
     from: "root",
     applicationType: "xpcshell-tests",
     traits: [],
   };
 }
@@ -153,21 +153,21 @@ var RootActor = protocol.ActorClassWithS
     if (this.conn.currentPacket.type != "echo") {
       return "goodbye";
     }
     return a;
   },
 
   testOneWay: function (a) {
     // Emit to show that we got this message, because there won't be a response.
-    events.emit(this, "oneway", a);
+    EventEmitter.emit(this, "oneway", a);
   },
 
   emitFalsyOptions: function () {
-    events.emit(this, "falsyOptions", { zero: 0, farce: false });
+    EventEmitter.emit(this, "falsyOptions", { zero: 0, farce: false });
   }
 });
 
 var RootFront = protocol.FrontClassWithSpec(rootSpec, {
   initialize: function (client) {
     this.actorID = "root";
     protocol.Front.prototype.initialize.call(this, client);
     // Root owns itself.
--- a/devtools/shared/client/main.js
+++ b/devtools/shared/client/main.js
@@ -7,17 +7,17 @@
 "use strict";
 
 const { Ci, Cu } = require("chrome");
 const DevToolsUtils = require("devtools/shared/DevToolsUtils");
 const { getStack, callFunctionWithAsyncStack } = require("devtools/shared/platform/stack");
 
 const promise = Cu.import("resource://devtools/shared/deprecated-sync-thenables.js", {}).Promise;
 
-loader.lazyRequireGetter(this, "events", "devtools/shared/event-emitter");
+loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
 loader.lazyRequireGetter(this, "WebConsoleClient", "devtools/shared/webconsole/client", true);
 loader.lazyRequireGetter(this, "DebuggerSocket", "devtools/shared/security/socket", true);
 loader.lazyRequireGetter(this, "Authentication", "devtools/shared/security/auth");
 
 const noop = () => {};
 
 /**
  * TODO: Get rid of this API in favor of EventTarget (bug 1042642)
@@ -330,17 +330,17 @@ DebuggerClient.prototype = {
    *         and behaviors of the server we connect to. See RootActor).
    */
   connect: function (onConnected) {
     let deferred = promise.defer();
     this.emit("connect");
 
     // Also emit the event on the |DebuggerClient| object (not on the instance),
     // so it's possible to track all instances.
-    events.emit(DebuggerClient, "connect", this);
+    EventEmitter.emit(DebuggerClient, "connect", this);
 
     this.addOneTimeListener("connected", (name, applicationType, traits) => {
       this.traits = traits;
       if (onConnected) {
         onConnected(applicationType, traits);
       }
       deferred.resolve([applicationType, traits]);
     });
@@ -1305,43 +1305,26 @@ DebuggerClient.prototype = {
   /**
    * Currently attached addon.
    */
   activeAddon: null
 };
 
 eventSource(DebuggerClient.prototype);
 
-function Request(request) {
-  this.request = request;
-}
-
-Request.prototype = {
-
-  on: function (type, listener) {
-    events.on(this, type, listener);
-  },
-
-  off: function (type, listener) {
-    events.off(this, type, listener);
-  },
-
-  once: function (type, listener) {
-    events.once(this, type, listener);
-  },
-
-  emit: function (type, ...args) {
-    events.emit(this, type, ...args);
-  },
+class Request extends EventEmitter {
+  constructor(request) {
+    super();
+    this.request = request;
+  }
 
   get actor() {
     return this.request.to || this.request.actor;
   }
-
-};
+}
 
 /**
  * Creates a tab client for the remote debugging protocol server. This client
  * is a front to the tab actor created in the server side, hiding the protocol
  * details in a traditional JavaScript API.
  *
  * @param client DebuggerClient
  *        The debugger client parent.
--- a/devtools/shared/content-observer.js
+++ b/devtools/shared/content-observer.js
@@ -1,17 +1,17 @@
 /* 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 {Ci} = require("chrome");
 const Services = require("Services");
 
-const events = require("devtools/shared/event-emitter");
+const EventEmitter = require("devtools/shared/event-emitter");
 
 /**
  * Handles adding an observer for the creation of content document globals,
  * event sent immediately after a web content document window has been set up,
  * but before any script code has been executed.
  */
 function ContentObserver(tabActor) {
   this._contentWindow = tabActor.window;
@@ -43,26 +43,26 @@ ContentObserver.prototype = {
       this._onInnerWindowDestroyed, "inner-window-destroyed");
   },
 
   /**
    * Fired immediately after a web content document window has been set up.
    */
   _onContentGlobalCreated: function (subject, topic, data) {
     if (subject == this._contentWindow) {
-      events.emit(this, "global-created", subject);
+      EventEmitter.emit(this, "global-created", subject);
     }
   },
 
   /**
    * Fired when an inner window is removed from the backward/forward cache.
    */
   _onInnerWindowDestroyed: function (subject, topic, data) {
     let id = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
-    events.emit(this, "global-destroyed", id);
+    EventEmitter.emit(this, "global-destroyed", id);
   }
 };
 
 // Utility functions.
 
 ContentObserver.GetInnerWindowID = function (window) {
   return window
     .QueryInterface(Ci.nsIInterfaceRequestor)
--- a/devtools/shared/fronts/inspector.js
+++ b/devtools/shared/fronts/inspector.js
@@ -18,17 +18,16 @@ const {
   inspectorSpec,
   nodeSpec,
   nodeListSpec,
   walkerSpec
 } = require("devtools/shared/specs/inspector");
 const promise = require("promise");
 const defer = require("devtools/shared/defer");
 const { Task } = require("devtools/shared/task");
-const events = require("devtools/shared/event-emitter");
 const nodeConstants = require("devtools/shared/dom-node-constants.js");
 loader.lazyRequireGetter(this, "CommandUtils",
   "devtools/client/shared/developer-toolbar", true);
 
 const HIDDEN_CLASS = "__fx-devtools-hide-shortcut__";
 
 /**
  * Convenience API for building a list of attribute modifications
@@ -531,17 +530,17 @@ const WalkerFront = FrontClassWithSpec(w
 
   /**
    * Create the root node promise, triggering the "new-root" notification
    * on resolution.
    */
   _createRootNodePromise: function () {
     this._rootNodeDeferred = defer();
     this._rootNodeDeferred.promise.then(() => {
-      events.emit(this, "new-root");
+      this.emit("new-root");
     });
   },
 
   /**
    * When reading an actor form off the wire, we want to hook it up to its
    * parent front.  The protocol guarantees that the parent will be seen
    * by the client in either a previous or the current request.
    * So if we've already seen this parent return it, otherwise create
@@ -873,17 +872,17 @@ const WalkerFront = FrontClassWithSpec(w
       if (options.cleanup) {
         for (let node of this._orphaned) {
           // This will move retained nodes to this._retainedOrphans.
           this._releaseFront(node);
         }
         this._orphaned = new Set();
       }
 
-      events.emit(this, "mutations", emitMutations);
+      this.emit("mutations", emitMutations);
     });
   }, {
     impl: "_getMutations"
   }),
 
   /**
    * Handle the `new-mutations` notification by fetching the
    * available mutation records.
--- a/devtools/shared/fronts/profiler.js
+++ b/devtools/shared/fronts/profiler.js
@@ -6,34 +6,32 @@
 const { Cu } = require("chrome");
 const {
   Front,
   FrontClassWithSpec,
   custom
 } = require("devtools/shared/protocol");
 const { profilerSpec } = require("devtools/shared/specs/profiler");
 
-loader.lazyRequireGetter(this, "events", "devtools/shared/event-emitter");
-
 /**
  * This can be used on older Profiler implementations, but the methods cannot
  * be changed -- you must introduce a new method, and detect the server.
  */
 exports.ProfilerFront = FrontClassWithSpec(profilerSpec, {
   initialize: function (client, form) {
     Front.prototype.initialize.call(this, client, form);
     this.actorID = form.profilerActor;
     this.manage(this);
 
     this._onProfilerEvent = this._onProfilerEvent.bind(this);
-    events.on(this, "*", this._onProfilerEvent);
+    this.on("*", this._onProfilerEvent);
   },
 
   destroy: function () {
-    events.off(this, "*", this._onProfilerEvent);
+    this.off("*", this._onProfilerEvent);
     Front.prototype.destroy.call(this);
   },
 
   /**
    * If using the protocol.js Fronts, then make stringify default,
    * since the read/write mechanisms will expose it as an object anyway, but
    * this lets other consumers who connect directly (xpcshell tests, Gecko Profiler) to
    * have unchanged behaviour.
@@ -53,17 +51,17 @@ exports.ProfilerFront = FrontClassWithSp
       return;
     }
     data.relayed = true;
 
     if (eventName === "eventNotification") {
       // If this is `eventNotification`, this is coming from an older Gecko (<Fx42)
       // that doesn't use protocol.js style events. Massage it to emit a protocol.js
       // style event as well.
-      events.emit(this, data.topic, data);
+      this.emit(data.topic, data);
     } else {
       // Otherwise if a modern protocol.js event, emit it also as `eventNotification`
       // for compatibility reasons on the client (like for any add-ons/Gecko Profiler
       // using this event) and log a deprecation message if there is a listener.
       this.conn.emit("eventNotification", {
         subject: data.subject,
         topic: data.topic,
         data: data.data,
--- a/devtools/shared/fronts/styleeditor.js
+++ b/devtools/shared/fronts/styleeditor.js
@@ -6,31 +6,30 @@
 const { SimpleStringFront } = require("devtools/shared/fronts/string");
 const { Front, FrontClassWithSpec } = require("devtools/shared/protocol");
 const {
   oldStyleSheetSpec,
   styleEditorSpec
 } = require("devtools/shared/specs/styleeditor");
 const promise = require("promise");
 const defer = require("devtools/shared/defer");
-const events = require("devtools/shared/event-emitter");
 
 /**
  * StyleSheetFront is the client-side counterpart to a StyleSheetActor.
  */
 const OldStyleSheetFront = FrontClassWithSpec(oldStyleSheetSpec, {
   initialize: function (conn, form, ctx, detail) {
     Front.prototype.initialize.call(this, conn, form, ctx, detail);
 
     this._onPropertyChange = this._onPropertyChange.bind(this);
-    events.on(this, "property-change", this._onPropertyChange);
+    this.on("property-change", this._onPropertyChange);
   },
 
   destroy: function () {
-    events.off(this, "property-change", this._onPropertyChange);
+    this.off("property-change", this._onPropertyChange);
 
     Front.prototype.destroy.call(this);
   },
 
   _onPropertyChange: function (property, value) {
     this._form[property] = value;
   },
 
@@ -41,17 +40,17 @@ const OldStyleSheetFront = FrontClassWit
     }
     this.actorID = form.actor;
     this._form = form;
   },
 
   getText: function () {
     let deferred = defer();
 
-    events.once(this, "source-load", (source) => {
+    this.once("source-load", (source) => {
       let longStr = new SimpleStringFront(source);
       deferred.resolve(longStr);
     });
     this.fetchSource();
 
     return deferred.promise;
   },
 
@@ -92,17 +91,17 @@ const StyleEditorFront = FrontClassWithS
     Front.prototype.initialize.call(this, client);
     this.actorID = tabForm.styleEditorActor;
     this.manage(this);
   },
 
   getStyleSheets: function () {
     let deferred = defer();
 
-    events.once(this, "document-load", (styleSheets) => {
+    this.once("document-load", (styleSheets) => {
       deferred.resolve(styleSheets);
     });
     this.newDocument();
 
     return deferred.promise;
   },
 
   addStyleSheet: function (text) {
--- a/devtools/shared/fronts/stylesheets.js
+++ b/devtools/shared/fronts/stylesheets.js
@@ -11,17 +11,16 @@ const {
 const {
   originalSourceSpec,
   mediaRuleSpec,
   styleSheetSpec,
   styleSheetsSpec
 } = require("devtools/shared/specs/stylesheets");
 const promise = require("promise");
 const { Task } = require("devtools/shared/task");
-const events = require("devtools/shared/event-emitter");
 
 /**
  * The client-side counterpart for an OriginalSourceActor.
  */
 const OriginalSourceFront = FrontClassWithSpec(originalSourceSpec, {
   initialize: function (client, form) {
     Front.prototype.initialize.call(this, client, form);
 
@@ -50,17 +49,17 @@ exports.OriginalSourceFront = OriginalSo
 /**
  * Corresponding client-side front for a MediaRuleActor.
  */
 const MediaRuleFront = FrontClassWithSpec(mediaRuleSpec, {
   initialize: function (client, form) {
     Front.prototype.initialize.call(this, client, form);
 
     this._onMatchesChange = this._onMatchesChange.bind(this);
-    events.on(this, "matches-change", this._onMatchesChange);
+    this.on("matches-change", this._onMatchesChange);
   },
 
   _onMatchesChange: function (matches) {
     this._form.matches = matches;
   },
 
   form: function (form, detail) {
     if (detail === "actorid") {
@@ -96,21 +95,21 @@ exports.MediaRuleFront = MediaRuleFront;
 /**
  * StyleSheetFront is the client-side counterpart to a StyleSheetActor.
  */
 const StyleSheetFront = FrontClassWithSpec(styleSheetSpec, {
   initialize: function (conn, form) {
     Front.prototype.initialize.call(this, conn, form);
 
     this._onPropertyChange = this._onPropertyChange.bind(this);
-    events.on(this, "property-change", this._onPropertyChange);
+    this.on("property-change", this._onPropertyChange);
   },
 
   destroy: function () {
-    events.off(this, "property-change", this._onPropertyChange);
+    this.off("property-change", this._onPropertyChange);
     Front.prototype.destroy.call(this);
   },
 
   _onPropertyChange: function (property, value) {
     this._form[property] = value;
   },
 
   form: function (form, detail) {
--- a/devtools/shared/gcli/commands/measure.js
+++ b/devtools/shared/gcli/commands/measure.js
@@ -1,15 +1,15 @@
 /* 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 events = require("devtools/shared/event-emitter");
+const EventEmitter = require("devtools/shared/event-emitter");
 
 loader.lazyRequireGetter(this, "CommandState",
   "devtools/shared/gcli/command-state", true);
 
 const l10n = require("gcli/l10n");
 require("devtools/server/actors/inspector");
 const { MeasuringToolHighlighter, HighlighterEnvironment } =
   require("devtools/server/actors/highlighters");
@@ -78,17 +78,17 @@ exports.items = [
       let highlighter = new MeasuringToolHighlighter(environment);
 
       // Store the instance of the measuring tool highlighter for this document
       // so we can hide it later.
       highlighters.set(document, { highlighter, environment });
 
       // Listen to the highlighter's destroy event which may happen if the
       // window is refreshed or closed with the measuring tool shown.
-      events.once(highlighter, "destroy", () => {
+      EventEmitter.once(highlighter, "destroy", () => {
         if (highlighters.has(document)) {
           let { environment: toDestroy } = highlighters.get(document);
           toDestroy.destroy();
           highlighters.delete(document);
         }
       });
 
       highlighter.show();
--- a/devtools/shared/gcli/commands/rulers.js
+++ b/devtools/shared/gcli/commands/rulers.js
@@ -1,15 +1,15 @@
 /* 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 events = require("devtools/shared/event-emitter");
+const EventEmitter = require("devtools/shared/event-emitter");
 
 loader.lazyRequireGetter(this, "CommandState",
   "devtools/shared/gcli/command-state", true);
 
 const l10n = require("gcli/l10n");
 require("devtools/server/actors/inspector");
 const { RulersHighlighter, HighlighterEnvironment } =
   require("devtools/server/actors/highlighters");
@@ -76,17 +76,17 @@ exports.items = [
       let highlighter = new RulersHighlighter(environment);
 
       // Store the instance of the rulers highlighter for this document so we
       // can hide it later.
       highlighters.set(document, { highlighter, environment });
 
       // Listen to the highlighter's destroy event which may happen if the
       // window is refreshed or closed with the rulers shown.
-      events.once(highlighter, "destroy", () => {
+      EventEmitter.once(highlighter, "destroy", () => {
         if (highlighters.has(document)) {
           let { environment: toDestroy } = highlighters.get(document);
           toDestroy.destroy();
           highlighters.delete(document);
         }
       });
 
       highlighter.show();