Backing out bug 990074 as we have to backout bug 990685
authorDave Townsend <dtownsend@oxymoronical.com>
Thu, 24 Apr 2014 13:04:40 -0700
changeset 198615 a9cddc54b6f4a31ec9bad21125c3cd54247e68ef
parent 198614 542f5fb83cece04982f8beea8f6919b285da3e89
child 198616 6bd6ecc2185c177fdf5f1bb70a921448167366fe
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs990074, 990685
milestone31.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
Backing out bug 990074 as we have to backout bug 990685
browser/devtools/debugger/test/addon-source/browser_dbg_addon4/chrome.manifest
browser/devtools/debugger/test/addon-source/browser_dbg_addon4/test.xul
browser/devtools/debugger/test/addon-source/browser_dbg_addon4/test2.xul
browser/devtools/debugger/test/addon-source/browser_dbg_addon4/testxul.js
browser/devtools/debugger/test/addon-source/browser_dbg_addon4/testxul2.js
browser/devtools/debugger/test/addon-source/browser_dbg_addon5/chrome.manifest
browser/devtools/debugger/test/addon-source/browser_dbg_addon5/test.xul
browser/devtools/debugger/test/addon-source/browser_dbg_addon5/test2.xul
browser/devtools/debugger/test/addon-source/browser_dbg_addon5/testxul.js
browser/devtools/debugger/test/addon-source/browser_dbg_addon5/testxul2.js
browser/devtools/debugger/test/addon4.xpi
browser/devtools/debugger/test/addon5.xpi
browser/devtools/debugger/test/browser_dbg_addon-modules-unpacked.js
browser/devtools/debugger/test/browser_dbg_addon-modules.js
browser/devtools/debugger/test/head.js
toolkit/devtools/server/actors/script.js
deleted file mode 100644
--- a/browser/devtools/debugger/test/addon-source/browser_dbg_addon4/chrome.manifest
+++ /dev/null
@@ -1,1 +0,0 @@
-content browser_dbg_addon4 .
deleted file mode 100644
--- a/browser/devtools/debugger/test/addon-source/browser_dbg_addon4/test.xul
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0"?>
-
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script type="text/javascript" src="testxul.js"/>
-  <label value="test.xul"/>
-</window>
deleted file mode 100644
--- a/browser/devtools/debugger/test/addon-source/browser_dbg_addon4/test2.xul
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0"?>
-
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script type="text/javascript" src="testxul2.js"/>
-  <label value="test2.xul"/>
-</window>
deleted file mode 100644
--- a/browser/devtools/debugger/test/addon-source/browser_dbg_addon4/testxul.js
+++ /dev/null
@@ -1,4 +0,0 @@
-// Define something in here or the script may get collected
-window.addEventListener("unload", function() {
-  window.foo = "bar";
-});
deleted file mode 100644
--- a/browser/devtools/debugger/test/addon-source/browser_dbg_addon4/testxul2.js
+++ /dev/null
@@ -1,4 +0,0 @@
-// Define something in here or the script may get collected
-window.addEventListener("unload", function() {
-  window.foo = "bar";
-});
deleted file mode 100644
--- a/browser/devtools/debugger/test/addon-source/browser_dbg_addon5/chrome.manifest
+++ /dev/null
@@ -1,1 +0,0 @@
-content browser_dbg_addon5 .
deleted file mode 100644
--- a/browser/devtools/debugger/test/addon-source/browser_dbg_addon5/test.xul
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0"?>
-
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script type="text/javascript" src="testxul.js"/>
-  <label value="test.xul"/>
-</window>
deleted file mode 100644
--- a/browser/devtools/debugger/test/addon-source/browser_dbg_addon5/test2.xul
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0"?>
-
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script type="text/javascript" src="testxul2.js"/>
-  <label value="test2.xul"/>
-</window>
deleted file mode 100644
--- a/browser/devtools/debugger/test/addon-source/browser_dbg_addon5/testxul.js
+++ /dev/null
@@ -1,4 +0,0 @@
-// Define something in here or the script may get collected
-window.addEventListener("unload", function() {
-  window.foo = "bar";
-});
deleted file mode 100644
--- a/browser/devtools/debugger/test/addon-source/browser_dbg_addon5/testxul2.js
+++ /dev/null
@@ -1,4 +0,0 @@
-// Define something in here or the script may get collected
-window.addEventListener("unload", function() {
-  window.foo = "bar";
-});
index 31c5331b69dee6d15183647bb598f90195ff1c2a..e0fa24fde45799f3dc25d27eb6da3912637ed461
GIT binary patch
literal 1553
zc$^FHW@Zs#U}E545DS>@65u#xS}G$0LpU=70}q1?LsEWzNpVS0Vu4;(acBr91M}{W
z;lbN~h6k5ca5FHnd;=;4>SkcLI?2&r*^sC8{b%hpmRmVgyN_@lNetyH+1h@o%h*fU
znD^8X<=c#+N9xsOucRJ5#MSpC?dj8>)n#uO|D1{bV3K25Cf%wbVBqpzgju68Pe3en
z?xObMSFvZ7F*fwRDo9$JULy7WLh$`yG3Prs6Ghqsv*jn8l$$9p#+P&X$Ev`JmKmZy
zk5x_)o^jOq!^zH`)^>G^X34M2sb{p7`xXapy6z$ABAYF#miO?+*CLL*PCpI*hZ~jl
z?lW{v781@rYn3V4%2mB)hwS3Fnp0Ym!cUZM6q*tJ^7hNjQjZk@N4Nf;zuRM(bF6`8
zrI)x~d&{4!n||e+E8fpI-Lz-!`(nSeizzep1MgMz_O6~QcqKHl+f8@(hRJ1TOY~1%
zPrMtuTR=m8yXi;olFjTpqRy>$-nv1oZZh|S2iLjcl<JDq{(sxpwdnUoo4<P-d@nkD
z|JlqN(zbd|naFPY&+&amul61KX!~ulx7Xtf^B4o*QRUlT<)Rpt`N04f{z*&>4BWt|
z%FHV+NzBR7D@sWN$JC~B<KPhcK=ha@opd&@*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K}l+H2{5PR;)?*&QwO=497Nn6{<S&U?=61smYObCX{g4{MI9WoB})|c8r@^+zGo{K
zHSe&yqS;-JvwvU2-sQN%klcHDY6NqlM{=Oed;aAU3!-=G1u;lXtaDwmckPkAYo2X;
zn%8mT`jzuH&P=;^%~*FatD?%%FDWc9SDxTMZnAUg^S@^Ir$#&$N;z}T^xx!_%YOen
z_KF?VGmp1g3Bo+X3H6K-8NLy^E$X#RLn&z%nr{q&zB&9?qUJ8gABNX!%%kSC8Z0T)
znE$=q{KU?y`@BUO+?K=(&U~=t$8_U6+wSmkw$J({dHd$2+pNn{Hz^!hGG%5@LbX=+
z;lkPXSADkAE)%`B!(}GlMbp1v-z)?9hLK5*8CO{*!2kk4F2j;W5DT?rV}*DS&2#7`
zqGmZ{6ITN%lnh9mfvD*R*+6}uqY<fzIMYxg5ZSapP}7X?8^_89(!v6S4nV<EEFc~L
DmI+-+
--- a/browser/devtools/debugger/test/browser_dbg_addon-modules-unpacked.js
+++ b/browser/devtools/debugger/test/browser_dbg_addon-modules-unpacked.js
@@ -3,59 +3,46 @@
 
 // Make sure the add-on actor can see loaded JS Modules from an add-on
 
 const ADDON_URL = EXAMPLE_URL + "addon5.xpi";
 
 function test() {
   Task.spawn(function () {
     let addon = yield addAddon(ADDON_URL);
-    let tab1 = yield addTab("chrome://browser_dbg_addon5/content/test.xul");
-
     let addonDebugger = yield initAddonDebugger(ADDON_URL);
 
     is(addonDebugger.title, "Debugger - Test unpacked add-on with JS Modules", "Saw the right toolbox title.");
 
     // Check the inital list of sources is correct
     let groups = yield addonDebugger.getSourceGroups();
     is(groups[0].name, "browser_dbg_addon5@tests.mozilla.org", "Add-on code should be the first group");
-    is(groups[1].name, "chrome://global", "XUL code should be the second group");
-    is(groups.length, 2, "Should be only two groups.");
+    is(groups.length, 1, "Should be only one group.");
 
     let sources = groups[0].sources;
+    is(sources.length, 2, "Should be two sources");
+    ok(sources[0].url.endsWith("/browser_dbg_addon5@tests.mozilla.org/bootstrap.js"), "correct url for bootstrap code")
+    is(sources[0].label, "bootstrap.js", "correct label for bootstrap code")
+    is(sources[1].url, "resource://browser_dbg_addon5/test.jsm", "correct url for addon code")
+    is(sources[1].label, "test.jsm", "correct label for addon code")
+
+    // Load a new module and check it appears in the list of sources
+    Cu.import("resource://browser_dbg_addon5/test2.jsm", {});
+
+    groups = yield addonDebugger.getSourceGroups();
+    is(groups[0].name, "browser_dbg_addon5@tests.mozilla.org", "Add-on code should be the first group");
+    is(groups.length, 1, "Should be only one group.");
+
+    sources = groups[0].sources;
     is(sources.length, 3, "Should be three sources");
     ok(sources[0].url.endsWith("/browser_dbg_addon5@tests.mozilla.org/bootstrap.js"), "correct url for bootstrap code")
     is(sources[0].label, "bootstrap.js", "correct label for bootstrap code")
     is(sources[1].url, "resource://browser_dbg_addon5/test.jsm", "correct url for addon code")
     is(sources[1].label, "test.jsm", "correct label for addon code")
-    is(sources[2].url, "chrome://browser_dbg_addon5/content/testxul.js", "correct url for addon tab code")
-    is(sources[2].label, "testxul.js", "correct label for addon tab code")
-
-    // Load a new module and tab and check they appear in the list of sources
-    Cu.import("resource://browser_dbg_addon5/test2.jsm", {});
-    let tab2 = yield addTab("chrome://browser_dbg_addon5/content/test2.xul");
-
-    groups = yield addonDebugger.getSourceGroups();
-    is(groups[0].name, "browser_dbg_addon5@tests.mozilla.org", "Add-on code should be the first group");
-    is(groups[1].name, "chrome://global", "XUL code should be the second group");
-    is(groups.length, 2, "Should be only two groups.");
-
-    sources = groups[0].sources;
-    is(sources.length, 5, "Should be five sources");
-    ok(sources[0].url.endsWith("/browser_dbg_addon5@tests.mozilla.org/bootstrap.js"), "correct url for bootstrap code")
-    is(sources[0].label, "bootstrap.js", "correct label for bootstrap code")
-    is(sources[1].url, "resource://browser_dbg_addon5/test.jsm", "correct url for addon code")
-    is(sources[1].label, "test.jsm", "correct label for addon code")
-    is(sources[2].url, "chrome://browser_dbg_addon5/content/testxul.js", "correct url for addon tab code")
-    is(sources[2].label, "testxul.js", "correct label for addon tab code")
-    is(sources[3].url, "resource://browser_dbg_addon5/test2.jsm", "correct url for addon code")
-    is(sources[3].label, "test2.jsm", "correct label for addon code")
-    is(sources[4].url, "chrome://browser_dbg_addon5/content/testxul2.js", "correct url for addon tab code")
-    is(sources[4].label, "testxul2.js", "correct label for addon tab code")
+    is(sources[2].url, "resource://browser_dbg_addon5/test2.jsm", "correct url for addon code")
+    is(sources[2].label, "test2.jsm", "correct label for addon code")
 
     Cu.unload("resource://browser_dbg_addon5/test2.jsm");
     yield addonDebugger.destroy();
-    yield removeTab(tab1);
-    yield removeTab(tab2);
     yield removeAddon(addon);
     finish();
   });
 }
--- a/browser/devtools/debugger/test/browser_dbg_addon-modules.js
+++ b/browser/devtools/debugger/test/browser_dbg_addon-modules.js
@@ -3,59 +3,46 @@
 
 // Make sure the add-on actor can see loaded JS Modules from an add-on
 
 const ADDON_URL = EXAMPLE_URL + "addon4.xpi";
 
 function test() {
   Task.spawn(function () {
     let addon = yield addAddon(ADDON_URL);
-    let tab1 = yield addTab("chrome://browser_dbg_addon4/content/test.xul");
-
     let addonDebugger = yield initAddonDebugger(ADDON_URL);
 
     is(addonDebugger.title, "Debugger - Test add-on with JS Modules", "Saw the right toolbox title.");
 
     // Check the inital list of sources is correct
     let groups = yield addonDebugger.getSourceGroups();
     is(groups[0].name, "browser_dbg_addon4@tests.mozilla.org", "Add-on code should be the first group");
-    is(groups[1].name, "chrome://global", "XUL code should be the second group");
-    is(groups.length, 2, "Should be only two groups.");
+    is(groups.length, 1, "Should be only one group.");
 
     let sources = groups[0].sources;
+    is(sources.length, 2, "Should be two sources");
+    ok(sources[0].url.endsWith("/browser_dbg_addon4@tests.mozilla.org.xpi!/bootstrap.js"), "correct url for bootstrap code")
+    is(sources[0].label, "bootstrap.js", "correct label for bootstrap code")
+    is(sources[1].url, "resource://browser_dbg_addon4/test.jsm", "correct url for addon code")
+    is(sources[1].label, "test.jsm", "correct label for addon code")
+
+    // Load a new module and check it appears in the list of sources
+    Cu.import("resource://browser_dbg_addon4/test2.jsm", {});
+
+    groups = yield addonDebugger.getSourceGroups();
+    is(groups[0].name, "browser_dbg_addon4@tests.mozilla.org", "Add-on code should be the first group");
+    is(groups.length, 1, "Should be only one group.");
+
+    sources = groups[0].sources;
     is(sources.length, 3, "Should be three sources");
     ok(sources[0].url.endsWith("/browser_dbg_addon4@tests.mozilla.org.xpi!/bootstrap.js"), "correct url for bootstrap code")
     is(sources[0].label, "bootstrap.js", "correct label for bootstrap code")
     is(sources[1].url, "resource://browser_dbg_addon4/test.jsm", "correct url for addon code")
     is(sources[1].label, "test.jsm", "correct label for addon code")
-    is(sources[2].url, "chrome://browser_dbg_addon4/content/testxul.js", "correct url for addon tab code")
-    is(sources[2].label, "testxul.js", "correct label for addon tab code")
-
-    // Load a new module and tab and check they appear in the list of sources
-    Cu.import("resource://browser_dbg_addon4/test2.jsm", {});
-    let tab2 = yield addTab("chrome://browser_dbg_addon4/content/test2.xul");
-
-    groups = yield addonDebugger.getSourceGroups();
-    is(groups[0].name, "browser_dbg_addon4@tests.mozilla.org", "Add-on code should be the first group");
-    is(groups[1].name, "chrome://global", "XUL code should be the second group");
-    is(groups.length, 2, "Should be only two groups.");
-
-    sources = groups[0].sources;
-    is(sources.length, 5, "Should be five sources");
-    ok(sources[0].url.endsWith("/browser_dbg_addon4@tests.mozilla.org.xpi!/bootstrap.js"), "correct url for bootstrap code")
-    is(sources[0].label, "bootstrap.js", "correct label for bootstrap code")
-    is(sources[1].url, "resource://browser_dbg_addon4/test.jsm", "correct url for addon code")
-    is(sources[1].label, "test.jsm", "correct label for addon code")
-    is(sources[2].url, "chrome://browser_dbg_addon4/content/testxul.js", "correct url for addon tab code")
-    is(sources[2].label, "testxul.js", "correct label for addon tab code")
-    is(sources[3].url, "resource://browser_dbg_addon4/test2.jsm", "correct url for addon code")
-    is(sources[3].label, "test2.jsm", "correct label for addon code")
-    is(sources[4].url, "chrome://browser_dbg_addon4/content/testxul2.js", "correct url for addon tab code")
-    is(sources[4].label, "testxul2.js", "correct label for addon tab code")
+    is(sources[2].url, "resource://browser_dbg_addon4/test2.jsm", "correct url for addon code")
+    is(sources[2].label, "test2.jsm", "correct label for addon code")
 
     Cu.unload("resource://browser_dbg_addon4/test2.jsm");
     yield addonDebugger.destroy();
-    yield removeTab(tab1);
-    yield removeTab(tab2);
     yield removeAddon(addon);
     finish();
   });
 }
--- a/browser/devtools/debugger/test/head.js
+++ b/browser/devtools/debugger/test/head.js
@@ -117,21 +117,17 @@ function addAddon(aUrl) {
 
   let deferred = promise.defer();
 
   AddonManager.getInstallForURL(aUrl, aInstaller => {
     aInstaller.install();
     let listener = {
       onInstallEnded: function(aAddon, aAddonInstall) {
         aInstaller.removeListener(listener);
-
-        // Wait for add-on's startup scripts to execute. See bug 997408
-        executeSoon(function() {
-          deferred.resolve(aAddonInstall);
-        });
+        deferred.resolve(aAddonInstall);
       }
     };
     aInstaller.addListener(listener);
   }, "application/x-xpinstall");
 
   return deferred.promise;
 }
 
--- a/toolkit/devtools/server/actors/script.js
+++ b/toolkit/devtools/server/actors/script.js
@@ -20,19 +20,18 @@ let addonManager = null;
 
 /**
  * This is a wrapper around amIAddonManager.mapURIToAddonID which always returns
  * false on B2G to avoid loading the add-on manager there and reports any
  * exceptions rather than throwing so that the caller doesn't have to worry
  * about them.
  */
 function mapURIToAddonID(uri, id) {
-  if (Services.appinfo.ID == B2G_ID) {
+  if (Services.appinfo.ID == B2G_ID)
     return false;
-  }
 
   if (!addonManager) {
     addonManager = Cc["@mozilla.org/addons/integration;1"].
                    getService(Ci.amIAddonManager);
   }
 
   try {
     return addonManager.mapURIToAddonID(uri, id);
@@ -4774,56 +4773,29 @@ function AddonThreadActor(aConnect, aHoo
 AddonThreadActor.prototype = Object.create(ThreadActor.prototype);
 
 update(AddonThreadActor.prototype, {
   constructor: AddonThreadActor,
 
   // A constant prefix that will be used to form the actor ID by the server.
   actorPrefix: "addonThread",
 
-  onAttach: function(aRequest) {
-    if (!this.attached) {
-      Services.obs.addObserver(this, "document-element-inserted", false);
-    }
-    return ThreadActor.prototype.onAttach.call(this, aRequest);
-  },
-
-  disconnect: function() {
-    if (this.attached) {
-      Services.obs.removeObserver(this, "document-element-inserted");
-    }
-    return ThreadActor.prototype.disconnect.call(this);
-  },
-
-  /**
-   * Called when a new DOM document element is created. Check if the DOM was
-   * laoded from an add-on and if so make the window a debuggee.
-   */
-  observe: function(aSubject, aTopic, aData) {
-    let id = {};
-    if (mapURIToAddonID(aSubject.documentURIObject, id) && id.value === this.addonID) {
-      this.dbg.addDebuggee(aSubject.defaultView);
-    }
-  },
-
   /**
    * Override the eligibility check for scripts and sources to make
    * sure every script and source with a URL is stored when debugging
    * add-ons.
    */
   _allowSource: function(aSourceURL) {
     // Hide eval scripts
-    if (!aSourceURL) {
+    if (!aSourceURL)
       return false;
-    }
 
     // XPIProvider.jsm evals some code in every add-on's bootstrap.js. Hide it
-    if (aSourceURL == "resource://gre/modules/addons/XPIProvider.jsm") {
+    if (aSourceURL == "resource://gre/modules/addons/XPIProvider.jsm")
       return false;
-    }
 
     return true;
   },
 
   /**
    * An object that will be used by ThreadActors to tailor their
    * behaviour depending on the debugging context being required (chrome,
    * addon or content). The methods that this object provides must
@@ -4860,72 +4832,44 @@ update(AddonThreadActor.prototype, {
   },
 
   /**
    * Checks if the provided global belongs to the debugged add-on.
    *
    * @param aGlobal Debugger.Object
    */
   _checkGlobal: function ADA_checkGlobal(aGlobal) {
-    let obj = null;
-    try {
-      obj = aGlobal.unsafeDereference();
-    }
-    catch (e) {
-      // Because of bug 991399 we sometimes get bad objects here. If we can't
-      // dereference them then they won't be useful to us
-      return false;
-    }
-
     try {
       // This will fail for non-Sandbox objects, hence the try-catch block.
-      let metadata = Cu.getSandboxMetadata(obj);
-      if (metadata) {
+      let metadata = Cu.getSandboxMetadata(aGlobal.unsafeDereference());
+      if (metadata)
         return metadata.addonID === this.addonID;
-      }
     } catch (e) {
     }
 
-    if (obj instanceof Ci.nsIDOMWindow) {
-      let id = {};
-      if (mapURIToAddonID(obj.document.documentURIObject, id)) {
-        return id.value === this.addonID;
-      }
-      return false;
-    }
-
     // Check the global for a __URI__ property and then try to map that to an
     // add-on
     let uridescriptor = aGlobal.getOwnPropertyDescriptor("__URI__");
-    if (uridescriptor && "value" in uridescriptor && uridescriptor.value) {
-      let uri;
+    if (uridescriptor && "value" in uridescriptor) {
       try {
-        uri = Services.io.newURI(uridescriptor.value, null, null);
+        let uri = Services.io.newURI(uridescriptor.value, null, null);
+        let id = {};
+        if (mapURIToAddonID(uri, id)) {
+          return id.value === this.addonID;
+        }
       }
       catch (e) {
-        DevToolsUtils.reportException("AddonThreadActor.prototype._checkGlobal",
-                                      new Error("Invalid URI: " + uridescriptor.value));
-        return false;
-      }
-
-      let id = {};
-      if (mapURIToAddonID(uri, id)) {
-        return id.value === this.addonID;
+        DevToolsUtils.reportException("AddonThreadActor.prototype._checkGlobal", e);
       }
     }
 
     return false;
   }
 });
 
-AddonThreadActor.prototype.requestTypes = Object.create(ThreadActor.prototype.requestTypes);
-update(AddonThreadActor.prototype.requestTypes, {
-  "attach": AddonThreadActor.prototype.onAttach
-});
-
 /**
  * Manages the sources for a thread. Handles source maps, locations in the
  * sources, etc for ThreadActors.
  */
 function ThreadSources(aThreadActor, aUseSourceMaps, aAllowPredicate,
                        aOnNewSource) {
   this._thread = aThreadActor;
   this._useSourceMaps = aUseSourceMaps;