Bug 1546736 Part 2 - Set flag on docshell when devtools are watching it, r=ochameau.
authorBrian Hackett <bhackett1024@gmail.com>
Wed, 08 May 2019 09:28:53 -1000
changeset 536100 a2f8435fe7ed425c770d4ee59143dada8aab143b
parent 536099 4d7e10772f554bda346bc5f256ea2bbc9f0cd618
child 536101 134b0641a7aabf9f41a42678d74c497592b0fc49
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1546736
milestone68.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 1546736 Part 2 - Set flag on docshell when devtools are watching it, r=ochameau.
devtools/server/actors/targets/browsing-context.js
--- a/devtools/server/actors/targets/browsing-context.js
+++ b/devtools/server/actors/targets/browsing-context.js
@@ -1517,16 +1517,18 @@ DebuggerProgressListener.prototype = {
     handler.addEventListener("pageshow", this._onWindowCreated, true);
     handler.addEventListener("pagehide", this._onWindowHidden, true);
 
     // Dispatch the _windowReady event on the targetActor for pre-existing windows
     for (const win of this._getWindowsInDocShell(docShell)) {
       this._targetActor._windowReady(win);
       this._knownWindowIDs.set(getWindowID(win), win);
     }
+
+    docShell.watchedByDevtools = true;
   },
 
   unwatch(docShell) {
     const docShellWindow = docShell.domWindow;
     if (!this._watchedDocShells.has(docShellWindow)) {
       return;
     }
 
@@ -1543,16 +1545,18 @@ DebuggerProgressListener.prototype = {
     handler.removeEventListener("DOMWindowCreated",
       this._onWindowCreated, true);
     handler.removeEventListener("pageshow", this._onWindowCreated, true);
     handler.removeEventListener("pagehide", this._onWindowHidden, true);
 
     for (const win of this._getWindowsInDocShell(docShell)) {
       this._knownWindowIDs.delete(getWindowID(win));
     }
+
+    docShell.watchedByDevtools = false;
   },
 
   _getWindowsInDocShell(docShell) {
     return getChildDocShells(docShell).map(d => {
       return d.domWindow;
     });
   },