bug 1523104: remote: fix WindowManager docs; r=me a=docs
authorAndreas Tolfsen <ato@sny.no>
Fri, 08 Mar 2019 14:03:51 +0000
changeset 524143 25dd3f1e01c9531f272a1c5a51f5a027523dcd23
parent 524142 56727ea2555c86a3b4f1aa60cfd0cc41caec5d8f
child 524144 2932c11d19a575880474f01a6862813708697d25
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme, docs
bugs1523104
milestone67.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 1523104: remote: fix WindowManager docs; r=me a=docs
remote/WindowManager.jsm
--- a/remote/WindowManager.jsm
+++ b/remote/WindowManager.jsm
@@ -9,33 +9,34 @@ var EXPORTED_SYMBOLS = [
   "WindowObserver",
 ];
 
 const {DOMContentLoadedPromise} = ChromeUtils.import("chrome://remote/content/Sync.jsm");
 const {EventEmitter} = ChromeUtils.import("resource://gre/modules/EventEmitter.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 /**
- * The WindowManager provides tooling for application-agnostic observation
- * of windows, tabs, and content browsers as they are created and destroyed.
+ * The WindowManager provides tooling for application-agnostic
+ * observation of windows, tabs, and content browsers as they are
+ * created and destroyed.
  */
 
 // TODO(ato):
 //
 // The DOM team is working on pulling browsing context related behaviour,
 // such as window and tab handling, out of product code and into the platform.
 // This will have implication for the remote agent,
 // and as the platform gains support for product-independent events
 // we can likely get rid of this entire module.
 
 /**
  * Observes DOMWindows as they open and close.
  *
- * The WindowObserver.Event.Open event fires when a window opens.
- * The WindowObserver.Event.Close event fires when a window closes.
+ * "open" fires when a window opens.
+ * "close" fires when a window closes.
  */
 class WindowObserver {
   /**
    * @param {boolean?} [false] registerExisting
    *     Events will be despatched for the ChromeWindows that exist
    *     at the time the observer is started.
    */
   constructor({registerExisting = false} = {}) {
@@ -121,18 +122,18 @@ class TabObserver {
   // WindowObserver
 
   async onWindowOpen(eventName, window) {
     if (!window.gBrowser) {
       return;
     }
 
     for (const tab of window.gBrowser.tabs) {
-      // If `linkedBrowser` isn't set, it means that the tab is still initializing
-      // and a `TabOpen` event will be fired once it is all set.
+      // a missing linkedBrowser means the tab is still initialising,
+      // and a TabOpen event will fire once it is ready
       if (!tab.linkedBrowser) {
         continue;
       }
       this.onTabOpen(tab);
     }
 
     window.addEventListener("TabOpen", ({target}) => this.onTabOpen(target));
     window.addEventListener("TabClose", ({target}) => this.onTabClose(target));