Commit 88bfc378 authored by Dorel Luca's avatar Dorel Luca
Browse files

Backed out 5 changesets (bug 1497707) for android mass failures. CLOSED TREE

Backed out changeset bb1b80139e37 (bug 1497707)
Backed out changeset 11c813f192e2 (bug 1497707)
Backed out changeset 32595f9e73d3 (bug 1497707)
Backed out changeset f37f2d39ec9c (bug 1497707)
Backed out changeset 80bf9ddf5bed (bug 1497707)

--HG--
extra : rebase_source : 598b7732d9b994dfeb63c417841a4b9516ecdf19
parent 337c32ba
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -157,6 +157,7 @@ add_task(async function() {
  let startupRecorder = Cc["@mozilla.org/test/startuprecorder;1"].getService().wrappedJSObject;
  await startupRecorder.done;

  let loader = Cc["@mozilla.org/moz/jsloader;1"].getService(Ci.xpcIJSModuleLoader);
  let componentStacks = new Map();
  let data = Cu.cloneInto(startupRecorder.data.code, {});
  // Keep only the file name for components, as the path is an absolute file
@@ -165,14 +166,14 @@ add_task(async function() {
    data[phase].components =
      data[phase].components.map(uri => {
        let fileName = uri.replace(/.*\//, "");
        componentStacks.set(fileName, Cu.getComponentLoadStack(uri));
        componentStacks.set(fileName, loader.getComponentLoadStack(uri));
        return fileName;
      }).filter(c => c != "startupRecorder.js");
  }

  function printStack(scriptType, name) {
    if (scriptType == "modules")
      info(Cu.getModuleImportStack(name));
      info(loader.getModuleImportStack(name));
    else if (scriptType == "components")
      info(componentStacks.get(name));
  }
+5 −4
Original line number Diff line number Diff line
@@ -110,16 +110,17 @@ add_task(async function() {
    Cm.QueryInterface(Ci.nsIServiceManager);
    ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
    let collectStacks = AppConstants.NIGHTLY_BUILD || AppConstants.DEBUG;
    let loader = Cc["@mozilla.org/moz/jsloader;1"].getService(Ci.xpcIJSModuleLoader);
    let components = {};
    for (let component of Cu.loadedComponents()) {
    for (let component of loader.loadedComponents()) {
      /* Keep only the file name for components, as the path is an absolute file
         URL rather than a resource:// URL like for modules. */
      components[component.replace(/.*\//, "")] =
        collectStacks ? Cu.getComponentLoadStack(component) : "";
        collectStacks ? loader.getComponentLoadStack(component) : "";
    }
    let modules = {};
    for (let module of Cu.loadedModules()) {
      modules[module] = collectStacks ? Cu.getModuleImportStack(module) : "";
    for (let module of loader.loadedModules()) {
      modules[module] = collectStacks ? loader.getModuleImportStack(module) : "";
    }
    let services = {};
    for (let contractID of Object.keys(Cc)) {
+3 −2
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ let afterPaintListener = () => {
  */
function startupRecorder() {
  this.wrappedJSObject = this;
  this.loader = Cc["@mozilla.org/moz/jsloader;1"].getService(Ci.xpcIJSModuleLoader);
  this.data = {
    images: {
      "image-drawing": new Set(),
@@ -63,8 +64,8 @@ startupRecorder.prototype = {
      return;

    this.data.code[name] = {
      components: Cu.loadedComponents(),
      modules: Cu.loadedModules(),
      components: this.loader.loadedComponents(),
      modules: this.loader.loadedModules(),
      services: Object.keys(Cc).filter(c => {
        try {
          return Cm.isServiceInstantiatedByContractID(c, Ci.nsISupports);
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ XPIDL_SOURCES += [
    'nsIXPCScriptable.idl',
    'xpccomponents.idl',
    'xpcIJSGetFactory.idl',
    'xpcIJSModuleLoader.idl',
    'xpcIJSWeakReference.idl',
    'xpcjsid.idl',
]
+24 −0
Original line number Diff line number Diff line
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */

#include "nsISupports.idl"

[scriptable, builtinclass, uuid(4f94b21f-2920-4bd9-8251-5fb60fb054b2)]
interface xpcIJSModuleLoader : nsISupports
{
  // These functions are for startup testing purposes. They are not expected
  // to be used for production code.
  void loadedModules([optional] out unsigned long length,
                     [retval, array, size_is(length)] out string aModules);

  void loadedComponents([optional] out unsigned long length,
                        [retval, array, size_is(length)] out string aComponents);

  // These 2 functions will only return useful values if the
  // "browser.startup.record" preference was true at the time the JS file
  // was loaded.
  ACString getModuleImportStack(in AUTF8String aLocation);
  ACString getComponentLoadStack(in AUTF8String aLocation);
};
Loading