зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1820882 - Convert consumers of toolkit/crashreporter to import ES modules directly r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D172545
This commit is contained in:
Родитель
42ea67067d
Коммит
4a9d4aed87
|
@ -16,11 +16,9 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"CrashSubmit",
|
||||
"resource://gre/modules/CrashSubmit.jsm"
|
||||
);
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
CrashSubmit: "resource://gre/modules/CrashSubmit.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "gNavigatorBundle", function() {
|
||||
const url = "chrome://browser/locale/browser.properties";
|
||||
|
|
|
@ -123,7 +123,7 @@ if (
|
|||
|
||||
if (AppConstants.MOZ_CRASHREPORTER) {
|
||||
startupPhases["before handling user events"].denylist.modules.add(
|
||||
"resource://gre/modules/CrashSubmit.jsm"
|
||||
"resource://gre/modules/CrashSubmit.sys.mjs"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ const { AppConstants } = ChromeUtils.importESModule(
|
|||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
CrashSubmit: "resource://gre/modules/CrashSubmit.sys.mjs",
|
||||
E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs",
|
||||
SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs",
|
||||
clearTimeout: "resource://gre/modules/Timer.sys.mjs",
|
||||
|
@ -24,7 +25,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
|
||||
CrashSubmit: "resource://gre/modules/CrashSubmit.jsm",
|
||||
});
|
||||
|
||||
// We don't process crash reports older than 28 days, so don't bother
|
||||
|
|
|
@ -15,8 +15,8 @@ export async function runBackgroundTask(commandLine) {
|
|||
var curDirURI = Services.io.newFileURI(cwd);
|
||||
protocolHandler.setSubstitution("test", curDirURI);
|
||||
|
||||
const { CrashTestUtils } = ChromeUtils.import(
|
||||
"resource://test/CrashTestUtils.jsm"
|
||||
const { CrashTestUtils } = ChromeUtils.importESModule(
|
||||
"resource://test/CrashTestUtils.sys.mjs"
|
||||
);
|
||||
|
||||
// Get the temp dir.
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
* 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/. */
|
||||
|
||||
var EXPORTED_SYMBOLS = ["CrashReports"];
|
||||
|
||||
var CrashReports = {
|
||||
export var CrashReports = {
|
||||
pendingDir: null,
|
||||
reportsDir: null,
|
||||
submittedDir: null,
|
|
@ -2,11 +2,7 @@
|
|||
* 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/. */
|
||||
|
||||
const { FileUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/FileUtils.sys.mjs"
|
||||
);
|
||||
|
||||
var EXPORTED_SYMBOLS = ["CrashSubmit"];
|
||||
import { FileUtils } from "resource://gre/modules/FileUtils.sys.mjs";
|
||||
|
||||
const SUCCESS = "success";
|
||||
const FAILED = "failed";
|
||||
|
@ -416,7 +412,7 @@ Submitter.prototype = {
|
|||
|
||||
// ===================================
|
||||
// External API goes here
|
||||
var CrashSubmit = {
|
||||
export var CrashSubmit = {
|
||||
// A set of strings representing how a user subnmitted a given crash
|
||||
SUBMITTED_FROM_AUTO: "Auto",
|
||||
SUBMITTED_FROM_INFOBAR: "Infobar",
|
|
@ -4,15 +4,13 @@
|
|||
|
||||
let reportURL;
|
||||
|
||||
const { CrashReports } = ChromeUtils.import(
|
||||
"resource://gre/modules/CrashReports.jsm"
|
||||
const { CrashReports } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/CrashReports.sys.mjs"
|
||||
);
|
||||
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"CrashSubmit",
|
||||
"resource://gre/modules/CrashSubmit.jsm"
|
||||
);
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
CrashSubmit: "resource://gre/modules/CrashSubmit.sys.mjs",
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
populateReportLists();
|
||||
|
|
|
@ -85,8 +85,8 @@ if CONFIG["MOZ_CRASHREPORTER"]:
|
|||
]
|
||||
|
||||
EXTRA_JS_MODULES += [
|
||||
"CrashReports.jsm",
|
||||
"CrashSubmit.jsm",
|
||||
"CrashReports.sys.mjs",
|
||||
"CrashSubmit.sys.mjs",
|
||||
]
|
||||
|
||||
include("/ipc/chromium/chromium-config.mozbuild")
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
var EXPORTED_SYMBOLS = ["CrashTestUtils"];
|
||||
|
||||
var CrashTestUtils = {
|
||||
export var CrashTestUtils = {
|
||||
// These will be defined using ctypes APIs below.
|
||||
crash: null,
|
||||
dumpHasStream: null,
|
|
@ -55,9 +55,11 @@ DEFINES["SHARED_LIBRARY"] = "%s%s%s" % (
|
|||
CONFIG["DLL_SUFFIX"],
|
||||
)
|
||||
|
||||
TEST_HARNESS_FILES.xpcshell.toolkit.crashreporter.test.unit += ["CrashTestUtils.jsm"]
|
||||
TEST_HARNESS_FILES.xpcshell.toolkit.crashreporter.test.unit += [
|
||||
"CrashTestUtils.sys.mjs"
|
||||
]
|
||||
TEST_HARNESS_FILES.xpcshell.toolkit.crashreporter.test.unit_ipc += [
|
||||
"CrashTestUtils.jsm"
|
||||
"CrashTestUtils.sys.mjs"
|
||||
]
|
||||
|
||||
include("/toolkit/crashreporter/crashreporter.mozbuild")
|
||||
|
|
|
@ -22,8 +22,8 @@ var protocolHandler = Services.io
|
|||
.QueryInterface(Ci.nsIResProtocolHandler);
|
||||
var curDirURI = Services.io.newFileURI(cwd);
|
||||
protocolHandler.setSubstitution("test", curDirURI);
|
||||
const { CrashTestUtils } = ChromeUtils.import(
|
||||
"resource://test/CrashTestUtils.jsm"
|
||||
const { CrashTestUtils } = ChromeUtils.importESModule(
|
||||
"resource://test/CrashTestUtils.sys.mjs"
|
||||
);
|
||||
var crashType = CrashTestUtils.CRASH_INVALID_POINTER_DEREF;
|
||||
var shouldDelay = false;
|
||||
|
|
|
@ -346,6 +346,6 @@ async function do_backgroundtask_crash(
|
|||
}
|
||||
|
||||
// Import binary APIs via js-ctypes.
|
||||
var { CrashTestUtils } = ChromeUtils.import(
|
||||
"resource://test/CrashTestUtils.jsm"
|
||||
var { CrashTestUtils } = ChromeUtils.importESModule(
|
||||
"resource://test/CrashTestUtils.sys.mjs"
|
||||
);
|
||||
|
|
|
@ -1008,8 +1008,8 @@ var dataProviders = {
|
|||
|
||||
if (AppConstants.MOZ_CRASHREPORTER) {
|
||||
dataProviders.crashes = function crashes(done) {
|
||||
const { CrashReports } = ChromeUtils.import(
|
||||
"resource://gre/modules/CrashReports.jsm"
|
||||
const { CrashReports } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/CrashReports.sys.mjs"
|
||||
);
|
||||
let reports = CrashReports.getReports();
|
||||
let now = new Date();
|
||||
|
|
Загрузка…
Ссылка в новой задаче