Back out c451a7f1de44 (bug 1050691) for OS X timeouts in browser_webconsole_closure_inspection.js
authorPhil Ringnalda <philringnalda@gmail.com>
Tue, 16 Jun 2015 19:37:12 -0700
changeset 279948 f8d73c4249c4c792dc6e55c5c04083d10f529331
parent 279947 cc46990bc18983b144fc25533c62b4fad6336bc7
child 279949 7fd6b4b97f4dfa56644bcda9a9f578c7af9a60a6
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1050691
milestone41.0a1
backs outc451a7f1de44f4c633253c5653d17a0ce8c8a112
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
Back out c451a7f1de44 (bug 1050691) for OS X timeouts in browser_webconsole_closure_inspection.js
browser/devtools/shared/widgets/VariablesView.jsm
browser/devtools/webconsole/console-output.js
browser/devtools/webconsole/test/browser.ini
browser/devtools/webconsole/test/browser_webconsole_bug_1050691_click_function_to_source.js
browser/devtools/webconsole/test/browser_webconsole_closure_inspection.js
browser/devtools/webconsole/test/browser_webconsole_context_menu_open_in_var_view.js
browser/devtools/webconsole/test/head.js
browser/devtools/webconsole/test/test-bug_1050691_click_function_to_source.html
browser/devtools/webconsole/test/test-bug_1050691_click_function_to_source.js
browser/devtools/webconsole/webconsole.xul
browser/locales/en-US/chrome/browser/devtools/webConsole.dtd
toolkit/devtools/server/actors/addon.js
toolkit/devtools/server/actors/child-process.js
toolkit/devtools/server/actors/object.js
toolkit/devtools/server/actors/promises.js
toolkit/devtools/server/actors/script.js
toolkit/devtools/server/actors/webconsole.js
toolkit/devtools/server/tests/unit/testactors.js
--- a/browser/devtools/shared/widgets/VariablesView.jsm
+++ b/browser/devtools/shared/widgets/VariablesView.jsm
@@ -1538,17 +1538,17 @@ Scope.prototype = {
 
   /**
    * Sort in ascending order
    * This only needs to compare non-numbers since it is dealing with an array
    * which numeric-based indices are placed in order.
    *
    * @param string a
    * @param string b
-   * @return number
+   * @return number 
    *         -1 if a is less than b, 0 if no change in order, +1 if a is greater than 0
    */
   _naturalSort: function(a,b) {
     if (isNaN(parseFloat(a)) && isNaN(parseFloat(b))) {
       return a < b ? -1 : 1;
     }
    },
 
--- a/browser/devtools/webconsole/console-output.js
+++ b/browser/devtools/webconsole/console-output.js
@@ -337,20 +337,16 @@ ConsoleOutput.prototype = {
    * Open an URL in a new tab.
    * @see WebConsole.openLink() in hudservice.js
    */
   openLink: function()
   {
     this.owner.owner.openLink.apply(this.owner.owner, arguments);
   },
 
-  openLocationInDebugger: function ({url, line}) {
-    return this.owner.owner.viewSourceInDebugger(url, line);
-  },
-
   /**
    * Open the variables view to inspect an object actor.
    * @see JSTerm.openVariablesView() in webconsole.js
    */
   openVariablesView: function()
   {
     this.owner.jsterm.openVariablesView.apply(this.owner.jsterm, arguments);
   },
@@ -2495,69 +2491,43 @@ Widgets.JSObject.prototype = Heritage.ex
   _anchor: function(text, options = {})
   {
     if (!options.onClick) {
       // If the anchor has an URL, open it in a new tab. If not, show the
       // current object actor.
       options.onClick = options.href ? this._onClickAnchor : this._onClick;
     }
 
-    options.onContextMenu = options.onContextMenu || this._onContextMenu;
-
     let anchor = this.el("a", {
       class: options.className,
       draggable: false,
       href: options.href || "#",
     }, text);
 
     this.message._addLinkCallback(anchor, options.onClick);
 
-    anchor.addEventListener("contextmenu", options.onContextMenu.bind(this));
-
     if (options.appendTo) {
       options.appendTo.appendChild(anchor);
     } else if (!("appendTo" in options) && this.element) {
       this.element.appendChild(anchor);
     }
 
     return anchor;
   },
 
-  openObjectInVariablesView: function()
-  {
-    this.output.openVariablesView({
-      label: VariablesView.getString(this.objectActor, { concise: true }),
-      objectActor: this.objectActor,
-      autofocus: true,
-    });
-  },
-
   /**
    * The click event handler for objects shown inline.
    * @private
    */
   _onClick: function()
   {
-    this.openObjectInVariablesView();
-  },
-
-  _onContextMenu: function(ev) {
-    // TODO offer a nice API for the context menu.
-    // Probably worth to take a look at Firebug's way
-    // https://github.com/firebug/firebug/blob/master/extension/content/firebug/chrome/menu.js
-    let doc = ev.target.ownerDocument;
-    let cmPopup = doc.getElementById("output-contextmenu");
-    let openInVarViewCmd = doc.getElementById("menu_openInVarView");
-    let openVarView = this.openObjectInVariablesView.bind(this);
-    openInVarViewCmd.addEventListener("command", openVarView);
-    openInVarViewCmd.removeAttribute("disabled");
-    cmPopup.addEventListener("popuphiding", function onPopupHiding() {
-      cmPopup.removeEventListener("popuphiding", onPopupHiding);
-      openInVarViewCmd.removeEventListener("command", openVarView);
-      openInVarViewCmd.setAttribute("disabled", "true");
+    this.output.openVariablesView({
+      label: VariablesView.getString(this.objectActor, { concise: true }),
+      objectActor: this.objectActor,
+      autofocus: true,
     });
   },
 
   /**
    * Add a string to the message.
    *
    * @private
    * @param string str
@@ -2715,26 +2685,16 @@ Widgets.ObjectRenderers.add({
         this._text(", ");
       }
       this.element.appendChild(this.el("span.cm-def", param));
       shown++;
     }
 
     this._text(")");
   },
-
-  _onClick: function () {
-    let location = this.objectActor.location;
-    if (location) {
-      this.output.openLocationInDebugger(location);
-    }
-    else {
-      this.openObjectInVariablesView();
-    }
-  }
 }); // Widgets.ObjectRenderers.byClass.Function
 
 /**
  * The widget used for displaying ArrayLike objects.
  */
 Widgets.ObjectRenderers.add({
   byKind: "ArrayLike",
 
--- a/browser/devtools/webconsole/test/browser.ini
+++ b/browser/devtools/webconsole/test/browser.ini
@@ -119,18 +119,16 @@ support-files =
   test-bug_923281_console_log_filter.html
   test-bug_923281_test1.js
   test-bug_923281_test2.js
   test-bug_939783_console_trace_duplicates.html
   test-bug-952277-highlight-nodes-in-vview.html
   test-bug-609872-cd-iframe-parent.html
   test-bug-609872-cd-iframe-child.html
   test-bug-989025-iframe-parent.html
-  test-bug_1050691_click_function_to_source.html
-  test-bug_1050691_click_function_to_source.js
   test-console-api-stackframe.html
   test_bug_1010953_cspro.html^headers^
   test_bug_1010953_cspro.html
   test_bug1045902_console_csp_ignore_reflected_xss_message.html^headers^
   test_bug1045902_console_csp_ignore_reflected_xss_message.html
   test_bug1092055_shouldwarn.js^headers^
   test_bug1092055_shouldwarn.js
   test_bug1092055_shouldwarn.html
@@ -384,10 +382,8 @@ skip-if = e10s # Bug 1042253 - webconsol
 [browser_webconsole_autocomplete_crossdomain_iframe.js]
 [browser_webconsole_console_custom_styles.js]
 [browser_webconsole_console_api_stackframe.js]
 [browser_webconsole_column_numbers.js]
 [browser_console_open_or_focus.js]
 [browser_webconsole_bug_922212_console_dirxml.js]
 [browser_webconsole_shows_reqs_in_netmonitor.js]
 [browser_netmonitor_shows_reqs_in_webconsole.js]
-[browser_webconsole_bug_1050691_click_function_to_source.js]
-[browser_webconsole_context_menu_open_in_var_view.js]
deleted file mode 100644
--- a/browser/devtools/webconsole/test/browser_webconsole_bug_1050691_click_function_to_source.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* 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/. */
-
-// Tests that clicking on a function displays its source in the debugger.
-
-"use strict";
-
-const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-bug_1050691_click_function_to_source.html";
-
-let test = asyncTest(function*() {
-  yield loadTab(TEST_URI);
-  let hud = yield openConsole();
-
-  yield testWithoutDebuggerOpen(hud);
-
-  // Open the Debugger panel.
-  let debuggerPanel = yield openDebugger();
-  // And right after come back to the Console panel.
-  yield openConsole();
-  yield testWithDebuggerOpen(hud, debuggerPanel);
-});
-
-function* testWithoutDebuggerOpen(hud) {
-  let clickable = yield printFunction(hud);
-  let onVariablesViewOpen = hud.jsterm.once("variablesview-fetched");
-  synthesizeClick(clickable, hud);
-  return onVariablesViewOpen;
-}
-
-function* testWithDebuggerOpen(hud, debuggerPanel) {
-  let clickable = yield printFunction(hud);
-  let panelWin = debuggerPanel.panelWin;
-  let onEditorLocationSet = panelWin.once(panelWin.EVENTS.EDITOR_LOCATION_SET);
-  synthesizeClick(clickable, hud);
-  yield onEditorLocationSet;
-  ok(isDebuggerCaretPos(debuggerPanel, 7),
-    "Clicking on a function should go to its source in the debugger view");
-}
-
-function synthesizeClick(clickable, hud) {
-  EventUtils.synthesizeMouse(clickable, 2, 2, {}, hud.iframeWindow);
-}
-
-let printFunction = Task.async(function* (hud) {
-  hud.jsterm.clearOutput();
-  content.wrappedJSObject.foo();
-  let [result] = yield waitForMessages({
-    webconsole: hud,
-    messages: [{
-      category: CATEGORY_WEBDEV,
-      severity: SEVERITY_LOG,
-    }],
-  });
-  let msg = [...result.matched][0];
-  let clickable = msg.querySelector("a");
-  ok(clickable, "clickable item for object should exist");
-  return clickable;
-});
--- a/browser/devtools/webconsole/test/browser_webconsole_closure_inspection.js
+++ b/browser/devtools/webconsole/test/browser_webconsole_closure_inspection.js
@@ -34,17 +34,17 @@ function test()
         });
 
         let button = content.document.querySelector("button");
         ok(button, "button element found");
         EventUtils.synthesizeMouseAtCenter(button, {}, content);
 
         return deferred.promise;
       });
-    });
+    })
   });
 }
 
 function consoleOpened(hud)
 {
   gWebConsole = hud;
   gJSTerm = hud.jsterm;
   gJSTerm.execute("window.george.getName");
@@ -60,25 +60,17 @@ function consoleOpened(hud)
 }
 
 function onExecuteGetName(aResults)
 {
   let clickable = aResults[0].clickableElements[0];
   ok(clickable, "clickable object found");
 
   gJSTerm.once("variablesview-fetched", onGetNameFetch);
-  let contextMenu =
-      gWebConsole.iframeWindow.document.getElementById("output-contextmenu");
-  waitForContextMenu(contextMenu, clickable, () => {
-    let openInVarView = contextMenu.querySelector("#menu_openInVarView");
-    ok(openInVarView.disabled === false,
-       "the \"Open In Variables View\" context menu item should be clickable");
-    EventUtils.synthesizeMouseAtCenter(openInVarView, {},
-                                       gWebConsole.iframeWindow);
-  });
+  EventUtils.synthesizeMouse(clickable, 2, 2, {}, gWebConsole.iframeWindow);
 }
 
 function onGetNameFetch(aEvent, aVar)
 {
   gVariablesView = aVar._variablesView;
   ok(gVariablesView, "variables view object");
 
   findVariableViewProperties(aVar, [
deleted file mode 100644
--- a/browser/devtools/webconsole/test/browser_webconsole_context_menu_open_in_var_view.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* 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/. */
-
-// Tests that the "Open in Variables View" context menu item is enabled
-// only for objects.
-
-"use strict";
-
-const TEST_URI = `data:text/html,<script>
-  console.log("foo");
-  console.log("foo", window);
-</script>`;
-
-let test = asyncTest(function*() {
-  yield loadTab(TEST_URI);
-  let hud = yield openConsole();
-
-  let [result] = yield waitForMessages({
-    webconsole: hud,
-    messages: [{
-      category: CATEGORY_WEBDEV,
-      severity: SEVERITY_LOG,
-      count: 2,
-      text: /foo/
-    }],
-  });
-
-  let [msgWithText, msgWithObj] = [...result.matched];
-  ok(msgWithText && msgWithObj, "Two messages should have appeared");
-
-  let contextMenu = hud.iframeWindow.
-    document.getElementById("output-contextmenu");
-  let openInVarViewItem = contextMenu.querySelector("#menu_openInVarView");
-  let obj = msgWithObj.querySelector(".cm-variable");
-  let text = msgWithText.querySelector(".console-string");
-
-  yield waitForContextMenu(contextMenu, obj, () => {
-    ok(openInVarViewItem.disabled === false, "The \"Open In Variables View\" " +
-      "context menu item should be available for objects");
-  }, () => {
-    ok(openInVarViewItem.disabled === true, "The \"Open In Variables View\" " +
-      "context menu item should be disabled on popup hiding");
-  });
-
-  yield waitForContextMenu(contextMenu, text, () => {
-    ok(openInVarViewItem.disabled === true, "The \"Open In Variables View\" " +
-      "context menu item should be disabled for texts");
-  });
-});
--- a/browser/devtools/webconsole/test/head.js
+++ b/browser/devtools/webconsole/test/head.js
@@ -221,18 +221,16 @@ let closeConsole = Task.async(function* 
  * @param function aOnHidden
  *        Function to invoke on popuphidden event.
  * @return object
  *         A Promise object that is resolved after the popuphidden event
  *         callback is invoked.
  */
 function waitForContextMenu(aPopup, aButton, aOnShown, aOnHidden)
 {
-  let deferred = promise.defer();
-
   function onPopupShown() {
     info("onPopupShown");
     aPopup.removeEventListener("popupshown", onPopupShown);
 
     aOnShown && aOnShown();
 
     // Use executeSoon() to get out of the popupshown event.
     aPopup.addEventListener("popuphidden", onPopupHidden);
@@ -242,20 +240,21 @@ function waitForContextMenu(aPopup, aBut
     info("onPopupHidden");
     aPopup.removeEventListener("popuphidden", onPopupHidden);
 
     aOnHidden && aOnHidden();
 
     deferred.resolve(aPopup);
   }
 
+  let deferred = promise.defer();
   aPopup.addEventListener("popupshown", onPopupShown);
 
   info("wait for the context menu to open");
-  let eventDetails = {type: "contextmenu", button: 2};
+  let eventDetails = { type: "contextmenu", button: 2};
   EventUtils.synthesizeMouse(aButton, 2, 2, eventDetails,
                              aButton.ownerDocument.defaultView);
   return deferred.promise;
 }
 
 /**
  * Listen for a new tab to open and return a promise that resolves when one
  * does and completes the load event.
@@ -821,17 +820,17 @@ function openDebugger(aOptions = {})
   if (!aOptions.tab) {
     aOptions.tab = gBrowser.selectedTab;
   }
 
   let deferred = promise.defer();
 
   let target = TargetFactory.forTab(aOptions.tab);
   let toolbox = gDevTools.getToolbox(target);
-  let dbgPanelAlreadyOpen = toolbox && toolbox.getPanel("jsdebugger");
+  let dbgPanelAlreadyOpen = toolbox.getPanel("jsdebugger");
 
   gDevTools.showToolbox(target, "jsdebugger").then(function onSuccess(aToolbox) {
     let panel = aToolbox.getCurrentPanel();
     let panelWin = panel.panelWin;
 
     panel._view.Variables.lazyEmpty = false;
 
     let resolveObject = {
@@ -853,34 +852,16 @@ function openDebugger(aOptions = {})
     console.debug("failed to open the toolbox for 'jsdebugger'", aReason);
     deferred.reject(aReason);
   });
 
   return deferred.promise;
 }
 
 /**
- * Returns true if the caret in the debugger editor is placed at the specified
- * position.
- * @param  aPanel The debugger panel.
- * @param {number} aLine The line number.
- * @param {number} [aCol] The column number.
- * @returns {boolean}
- */
-function isDebuggerCaretPos(aPanel, aLine, aCol = 1) {
-  let editor = aPanel.panelWin.DebuggerView.editor;
-  let cursor = editor.getCursor();
-
-  // Source editor starts counting line and column numbers from 0.
-  info("Current editor caret position: " + (cursor.line + 1) + ", " +
-    (cursor.ch + 1));
-  return cursor.line == (aLine - 1) && cursor.ch == (aCol - 1);
-}
-
-/**
  * Wait for messages in the Web Console output.
  *
  * @param object aOptions
  *        Options for what you want to wait for:
  *        - webconsole: the webconsole instance you work with.
  *        - matchCondition: "any" or "all". Default: "all". The promise
  *        returned by this function resolves when all of the messages are
  *        matched, if the |matchCondition| is "all". If you set the condition to
deleted file mode 100644
--- a/browser/devtools/webconsole/test/test-bug_1050691_click_function_to_source.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE HTML>
-<html dir="ltr" xml:lang="en-US" lang="en-US">
-  <head>
-    <meta charset="utf-8">
-    <title>Click on function should point to source</title>
-    <!-- Any copyright is dedicated to the Public Domain.
-       - http://creativecommons.org/publicdomain/zero/1.0/ -->
-    <script type="text/javascript" src="test-bug_1050691_click_function_to_source.js"></script>
-  </head>
-  <body></body>
-</html>
deleted file mode 100644
--- a/browser/devtools/webconsole/test/test-bug_1050691_click_function_to_source.js
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * this
- * is
- * a
- * function
- */
-function foo() {
-  console.log(foo);
-}
-
--- a/browser/devtools/webconsole/webconsole.xul
+++ b/browser/devtools/webconsole/webconsole.xul
@@ -71,18 +71,16 @@ function goUpdateConsoleCommands() {
       <menuitem id="saveBodiesContextMenu" type="checkbox" label="&saveBodies.label;"
                 accesskey="&saveBodies.accesskey;"/>
       <menuitem id="menu_openURL" label="&openURL.label;"
                 accesskey="&openURL.accesskey;" command="consoleCmd_openURL"
                 selection="network" selectionType="single"/>
       <menuitem id="menu_copyURL" label="&copyURLCmd.label;"
                 accesskey="&copyURLCmd.accesskey;" command="consoleCmd_copyURL"
                 selection="network" selectionType="single"/>
-      <menuitem id="menu_openInVarView" label="&openInVarViewCmd.label;"
-        accesskey="&openInVarViewCmd.accesskey;" disabled="true"/>
       <menuitem id="cMenu_copy"/>
       <menuitem id="cMenu_selectAll"/>
     </menupopup>
   </popupset>
 
   <tooltip id="aHTMLTooltip" page="true"/>
 
   <box class="hud-outer-wrapper devtools-responsive-container theme-body" flex="1">
--- a/browser/locales/en-US/chrome/browser/devtools/webConsole.dtd
+++ b/browser/locales/en-US/chrome/browser/devtools/webConsole.dtd
@@ -102,10 +102,8 @@
 <!ENTITY fullZoomResetCmd.commandkey2   "">
 
 <!ENTITY copyURLCmd.label     "Copy Link Location">
 <!ENTITY copyURLCmd.accesskey "a">
 
 <!ENTITY closeCmd.key         "W">
 <!ENTITY findCmd.key          "F">
 <!ENTITY clearOutputCtrl.key  "L">
-<!ENTITY openInVarViewCmd.label "Open in Variables View">
-<!ENTITY openInVarViewCmd.accesskey "V">
--- a/toolkit/devtools/server/actors/addon.js
+++ b/toolkit/devtools/server/actors/addon.js
@@ -20,17 +20,17 @@ loader.lazyRequireGetter(this, "WebConso
 
 loader.lazyImporter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm");
 
 function BrowserAddonActor(aConnection, aAddon) {
   this.conn = aConnection;
   this._addon = aAddon;
   this._contextPool = new ActorPool(this.conn);
   this.conn.addActorPool(this._contextPool);
-  this.threadActor = null;
+  this._threadActor = null;
   this._global = null;
 
   this._shouldAddNewGlobalAsDebuggee = this._shouldAddNewGlobalAsDebuggee.bind(this);
 
   this.makeDebugger = makeDebugger.bind(null, {
     findDebuggees: this._findDebuggees.bind(this),
     shouldAddNewGlobalAsDebuggee: this._shouldAddNewGlobalAsDebuggee
   });
@@ -50,27 +50,27 @@ BrowserAddonActor.prototype = {
     return this._addon.id;
   },
 
   get url() {
     return this._addon.sourceURI ? this._addon.sourceURI.spec : undefined;
   },
 
   get attached() {
-    return this.threadActor;
+    return this._threadActor;
   },
 
   get global() {
     return this._global;
   },
 
   get sources() {
     if (!this._sources) {
       dbg_assert(this.threadActor, "threadActor should exist when creating sources.");
-      this._sources = new TabSources(this.threadActor, this._allowSource);
+      this._sources = new TabSources(this._threadActor, this._allowSource);
     }
     return this._sources;
   },
 
 
   form: function BAA_form() {
     dbg_assert(this.actorID, "addon should have an actorID.");
     if (!this._consoleActor) {
@@ -130,31 +130,31 @@ BrowserAddonActor.prototype = {
   },
 
   onAttach: function BAA_onAttach() {
     if (this.exited) {
       return { type: "exited" };
     }
 
     if (!this.attached) {
-      this.threadActor = new AddonThreadActor(this.conn, this);
-      this._contextPool.addActor(this.threadActor);
+      this._threadActor = new AddonThreadActor(this.conn, this);
+      this._contextPool.addActor(this._threadActor);
     }
 
-    return { type: "tabAttached", threadActor: this.threadActor.actorID };
+    return { type: "tabAttached", threadActor: this._threadActor.actorID };
   },
 
   onDetach: function BAA_onDetach() {
     if (!this.attached) {
       return { error: "wrongState" };
     }
 
-    this._contextPool.removeActor(this.threadActor);
+    this._contextPool.removeActor(this._threadActor);
 
-    this.threadActor = null;
+    this._threadActor = null;
     this._sources = null;
 
     return { type: "detached" };
   },
 
   preNest: function() {
     let e = Services.wm.getEnumerator(null);
     while (e.hasMoreElements()) {
--- a/toolkit/devtools/server/actors/child-process.js
+++ b/toolkit/devtools/server/actors/child-process.js
@@ -13,17 +13,17 @@ const { ActorPool } = require("devtools/
 const Services = require("Services");
 const { dbg_assert } = require("devtools/toolkit/DevToolsUtils");
 const { TabSources } = require("./utils/TabSources");
 
 function ChildProcessActor(aConnection) {
   this.conn = aConnection;
   this._contextPool = new ActorPool(this.conn);
   this.conn.addActorPool(this._contextPool);
-  this.threadActor = null;
+  this._threadActor = null;
 
   // Use a see-everything debugger
   this.makeDebugger = makeDebugger.bind(null, {
     findDebuggees: dbg => dbg.findAllGlobals(),
     shouldAddNewGlobalAsDebuggee: global => true
   });
 
   // Scope into which the webconsole executes:
@@ -51,39 +51,39 @@ ChildProcessActor.prototype = {
   },
 
   get window() {
     return this._consoleScope;
   },
 
   get sources() {
     if (!this._sources) {
-      dbg_assert(this.threadActor, "threadActor should exist when creating sources.");
-      this._sources = new TabSources(this.threadActor);
+      dbg_assert(this._threadActor, "threadActor should exist when creating sources.");
+      this._sources = new TabSources(this._threadActor);
     }
     return this._sources;
   },
 
   form: function() {
     if (!this._consoleActor) {
       this._consoleActor = new WebConsoleActor(this.conn, this);
       this._contextPool.addActor(this._consoleActor);
     }
 
-    if (!this.threadActor) {
-      this.threadActor = new ChromeDebuggerActor(this.conn, this);
-      this._contextPool.addActor(this.threadActor);
+    if (!this._threadActor) {
+      this._threadActor = new ChromeDebuggerActor(this.conn, this);
+      this._contextPool.addActor(this._threadActor);
     }
 
     return {
       actor: this.actorID,
       name: "Content process",
 
       consoleActor: this._consoleActor.actorID,
-      chromeDebugger: this.threadActor.actorID,
+      chromeDebugger: this._threadActor.actorID,
 
       traits: {
         highlightable: false,
         networkMonitor: false,
       },
     };
   },
 
--- a/toolkit/devtools/server/actors/object.js
+++ b/toolkit/devtools/server/actors/object.js
@@ -37,41 +37,35 @@ const OBJECT_PREVIEW_MAX_ITEMS = 10;
  *          - createEnvironmentActor
  *              Creates and return an environment actor
  *          - getGripDepth
  *              An actor's grip depth getter
  *          - incrementGripDepth
  *              Increment the actor's grip depth
  *          - decrementGripDepth
  *              Decrement the actor's grip depth
- *          - getGlobalDebugObject
- *              Getter for the Debuggee Global Object as given by
- *              the ThreadActor. This global corresponds to the frame selected
- *              by the frame selector.
  */
 function ObjectActor(obj, {
   createValueGrip,
   sources,
   createEnvironmentActor,
   getGripDepth,
   incrementGripDepth,
-  decrementGripDepth,
-  getGlobalDebugObject
+  decrementGripDepth
 }) {
   dbg_assert(!obj.optimizedOut,
     "Should not create object actors for optimized out values!");
   this.obj = obj;
   this.hooks = {
     createValueGrip,
     sources,
     createEnvironmentActor,
     getGripDepth,
     incrementGripDepth,
-    decrementGripDepth,
-    getGlobalDebugObject
+    decrementGripDepth
   };
   this.iterators = new Set();
 }
 
 ObjectActor.prototype = {
   actorPrefix: "obj",
 
   /**
@@ -805,27 +799,16 @@ DebuggerServer.ObjectActorPreviewers = {
       dumpn(e);
     }
 
     if (userDisplayName && typeof userDisplayName.value == "string" &&
         userDisplayName.value) {
       grip.userDisplayName = hooks.createValueGrip(userDisplayName.value);
     }
 
-    let dbgGlobal = hooks.getGlobalDebugObject();
-    if (dbgGlobal) {
-      let script = dbgGlobal.makeDebuggeeValue(obj.unsafeDereference()).script;
-      if (script) {
-        grip.location = {
-          url: script.url,
-          line: script.startLine
-        };
-      }
-    }
-
     return true;
   }],
 
   RegExp: [function({obj, hooks}, grip) {
     // Avoid having any special preview for the RegExp.prototype itself.
     if (!obj.proto || obj.proto.class != "RegExp") {
       return false;
     }
--- a/toolkit/devtools/server/actors/promises.js
+++ b/toolkit/devtools/server/actors/promises.js
@@ -140,19 +140,17 @@ let PromisesActor = protocol.ActorClass(
       getGripDepth: () => this._gripDepth,
       incrementGripDepth: () => this._gripDepth++,
       decrementGripDepth: () => this._gripDepth--,
       createValueGrip: v =>
         createValueGrip(v, this._navigationLifetimePool, this.objectGrip),
       sources: () => DevToolsUtils.reportException("PromisesActor",
         Error("sources not yet implemented")),
       createEnvironmentActor: () => DevToolsUtils.reportException(
-        "PromisesActor", Error("createEnvironmentActor not yet implemented")),
-      getGlobalDebugObject: () => DevToolsUtils.reportException(
-        "PromisesActor", Error("getGlobalDebugObject not yet implemented")),
+        "PromisesActor", Error("createEnvironmentActor not yet implemented"))
     });
 
     this._navigationLifetimePool.addActor(actor);
     this._navigationLifetimePool.objectActors.set(promise, actor);
 
     return actor;
   },
 
--- a/toolkit/devtools/server/actors/script.js
+++ b/toolkit/devtools/server/actors/script.js
@@ -1670,18 +1670,17 @@ ThreadActor.prototype = {
       decrementGripDepth: () => this._gripDepth--,
       createValueGrip: v => createValueGrip(v, this._pausePool,
         this.pauseObjectGrip),
       sources: () => this.sources,
       createEnvironmentActor: (env, pool) =>
         this.createEnvironmentActor(env, pool),
       promote: () => this.threadObjectGrip(actor),
       isThreadLifetimePool: () =>
-        actor.registeredPool !== this.threadLifetimePool,
-      getGlobalDebugObject: () => this.globalDebugObject
+        actor.registeredPool !== this.threadLifetimePool
     });
     aPool.addActor(actor);
     aPool.objectActors.set(aValue, actor);
     return actor.grip();
   },
 
   /**
    * Create a grip for the given debuggee object with a pause lifetime.
--- a/toolkit/devtools/server/actors/webconsole.js
+++ b/toolkit/devtools/server/actors/webconsole.js
@@ -300,20 +300,16 @@ WebConsoleActor.prototype =
    * The Web Console Commands names cache.
    * @private
    * @type array
    */
   _webConsoleCommandsCache: null,
 
   actorPrefix: "console",
 
-  get globalDebugObject() {
-    return this.parentActor.threadActor.globalDebugObject;
-  },
-
   grip: function WCA_grip()
   {
     return { actor: this.actorID };
   },
 
   hasNativeConsoleAPI: function WCA_hasNativeConsoleAPI(aWindow) {
     let isNative = false;
     try {
@@ -449,18 +445,17 @@ WebConsoleActor.prototype =
   {
     let actor = new ObjectActor(aObject, {
       getGripDepth: () => this._gripDepth,
       incrementGripDepth: () => this._gripDepth++,
       decrementGripDepth: () => this._gripDepth--,
       createValueGrip: v => this.createValueGrip(v),
       sources: () => DevToolsUtils.reportException("WebConsoleActor",
         Error("sources not yet implemented")),
-      createEnvironmentActor: (env) => this.createEnvironmentActor(env),
-      getGlobalDebugObject: () => this.globalDebugObject
+      createEnvironmentActor: (env) => this.createEnvironmentActor(env)
     });
     aPool.addActor(actor);
     return actor.grip();
   },
 
   /**
    * Create a grip for the given string.
    *
--- a/toolkit/devtools/server/tests/unit/testactors.js
+++ b/toolkit/devtools/server/tests/unit/testactors.js
@@ -90,17 +90,17 @@ function TestTabActor(aConnection, aGlob
   });
 }
 
 TestTabActor.prototype = {
   constructor: TestTabActor,
   actorPrefix: "TestTabActor",
 
   get window() {
-    return this._global;
+    return { wrappedJSObject: this._global };
   },
 
   get url() {
     return this._global.__name;
   },
 
   get sources() {
     if (!this._sources) {