Bug 1430077 - Remove global outerWindowID in frame script. r?whimboo draft
authorAndreas Tolfsen <ato@sny.no>
Fri, 12 Jan 2018 13:25:42 +0000
changeset 720394 9b442cc25743b97341b66e9ff97b3a4ff109be13
parent 720393 6dc2b42bd9a6a6bddccfa65fda546681c41cd2f7
child 720395 3f0f5497bf97f63d0fe51bb3109b8742fe7f4dae
push id95535
push userbmo:ato@sny.no
push dateMon, 15 Jan 2018 14:06:36 +0000
reviewerswhimboo
bugs1430077
milestone59.0a1
Bug 1430077 - Remove global outerWindowID in frame script. r?whimboo outerWindowID is no longer used for adding message listeners, which means we do not need to store it globally. MozReview-Commit-ID: HZ0oY7ozwnu
testing/marionette/listener.js
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -41,17 +41,16 @@ const {ContentEventObserverService} = Cu
 Cu.import("chrome://marionette/content/interaction.js");
 Cu.import("chrome://marionette/content/legacyaction.js");
 Cu.import("chrome://marionette/content/navigate.js");
 Cu.import("chrome://marionette/content/proxy.js");
 Cu.import("chrome://marionette/content/session.js");
 
 Cu.importGlobalProperties(["URL"]);
 
-let outerWindowID = null;
 let curContainer = {frame: content, shadowRoot: null};
 
 // Listen for click event to indicate one click has happened, so actions
 // code can send dblclick event, also resetClick and cancelTimer
 // after dblclick has happened.
 addEventListener("click", event.DoubleClickTracker.setClick);
 addEventListener("dblclick", event.DoubleClickTracker.resetClick);
 addEventListener("dblclick", event.DoubleClickTracker.cancelTimer);
@@ -442,17 +441,17 @@ const loadListener = {
 };
 
 /**
  * Called when listener is first started up.  The listener sends its
  * unique window ID and its current URI to the actor.  If the actor returns
  * an ID, we start the listeners. Otherwise, nothing happens.
  */
 function registerSelf() {
-  outerWindowID = winUtil.outerWindowID;
+  let {outerWindowID} = winUtil;
   logger.debug(`Register listener.js for window ${outerWindowID}`);
 
   sandboxes.clear();
   curContainer = {
     frame: content,
     shadowRoot: null,
   };
   legacyactions.mouseEventsOnly = false;