Backed out 2 changesets (bug 1788919) for causing failures in browser_noLoginsView.js CLOSED TREE

Backed out changeset 2f03490ec72e (bug 1788919)
Backed out changeset 449aea6fc974 (bug 1788919)
This commit is contained in:
Noemi Erli 2022-10-27 23:45:56 +03:00
Родитель 640cf06c1b
Коммит 01a2d27871
30 изменённых файлов: 249 добавлений и 146 удалений

Просмотреть файл

@ -27,7 +27,6 @@ ChromeUtils.defineESModuleGetters(this, {
LightweightThemeConsumer:
"resource://gre/modules/LightweightThemeConsumer.sys.mjs",
Log: "resource://gre/modules/Log.sys.mjs",
MigrationUtils: "resource:///modules/MigrationUtils.sys.mjs",
NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs",
PictureInPicture: "resource://gre/modules/PictureInPicture.sys.mjs",
PlacesTransactions: "resource://gre/modules/PlacesTransactions.sys.mjs",
@ -71,6 +70,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
HomePage: "resource:///modules/HomePage.jsm",
LoginHelper: "resource://gre/modules/LoginHelper.jsm",
LoginManagerParent: "resource://gre/modules/LoginManagerParent.jsm",
MigrationUtils: "resource:///modules/MigrationUtils.jsm",
NetUtil: "resource://gre/modules/NetUtil.jsm",
OpenInTabsUtils: "resource:///modules/OpenInTabsUtils.jsm",
PageActions: "resource:///modules/PageActions.jsm",

Просмотреть файл

@ -2,9 +2,16 @@
* 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/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
"use strict";
import { MigrationUtils } from "resource:///modules/MigrationUtils.sys.mjs";
var EXPORTED_SYMBOLS = ["Qihoo360seMigrationUtils"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { MigrationUtils } = ChromeUtils.import(
"resource:///modules/MigrationUtils.jsm"
);
const lazy = {};
@ -115,7 +122,7 @@ Bookmarks.prototype = {
},
};
export var Qihoo360seMigrationUtils = {
var Qihoo360seMigrationUtils = {
async getAlternativeBookmarks({ bookmarksPath, localState }) {
let lastModificationDate = new Date(0);
let path = bookmarksPath;

Просмотреть файл

@ -2,12 +2,18 @@
* 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/. */
"use strict";
/**
* Class to handle encryption and decryption of logins stored in Chrome/Chromium
* on macOS.
*/
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
var EXPORTED_SYMBOLS = ["ChromeMacOSLoginCrypto"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {};
@ -65,7 +71,7 @@ const IV = new Uint8Array(kCCBlockSizeAES128).fill(32);
* relies on OS encryption key storage in Keychain. The algorithms here are
* specific to what is needed for Chrome login storage on macOS.
*/
export class ChromeMacOSLoginCrypto {
class ChromeMacOSLoginCrypto {
/**
* @param {string} serviceName of the Keychain Item to use to derive a key.
* @param {string} accountName of the Keychain Item to use to derive a key.

Просмотреть файл

@ -1,26 +1,27 @@
/* 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/. */
"use strict";
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
var EXPORTED_SYMBOLS = ["ChromeMigrationUtils"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
MigrationUtils: "resource:///modules/MigrationUtils.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
LoginHelper: "resource://gre/modules/LoginHelper.jsm",
MigrationUtils: "resource:///modules/MigrationUtils.jsm",
OS: "resource://gre/modules/osfile.jsm",
});
const S100NS_FROM1601TO1970 = 0x19db1ded53e8000;
const S100NS_PER_MS = 10;
export var ChromeMigrationUtils = {
var ChromeMigrationUtils = {
// Supported browsers with importable logins.
CONTEXTUAL_LOGIN_IMPORT_BROWSERS: ["chrome", "chromium-edge", "chromium"],

Просмотреть файл

@ -4,33 +4,36 @@
* 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/. */
"use strict";
const AUTH_TYPE = {
SCHEME_HTML: 0,
SCHEME_BASIC: 1,
SCHEME_DIGEST: 2,
};
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
import {
MigratorPrototype,
MigrationUtils,
} from "resource:///modules/MigrationUtils.sys.mjs";
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
const { MigratorPrototype, MigrationUtils } = ChromeUtils.import(
"resource:///modules/MigrationUtils.jsm"
);
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
ChromeMigrationUtils: "resource:///modules/ChromeMigrationUtils.sys.mjs",
PlacesUIUtils: "resource:///modules/PlacesUIUtils.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
Qihoo360seMigrationUtils: "resource:///modules/360seMigrationUtils.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
ChromeMigrationUtils: "resource:///modules/ChromeMigrationUtils.jsm",
NetUtil: "resource://gre/modules/NetUtil.jsm",
OS: "resource://gre/modules/osfile.jsm",
Qihoo360seMigrationUtils: "resource:///modules/360seMigrationUtils.jsm",
});
/**
@ -74,7 +77,7 @@ function convertBookmarks(items, errorAccumulator) {
return itemsToInsert;
}
export function ChromeProfileMigrator() {
function ChromeProfileMigrator() {
this._chromeUserDataPathSuffix = "Chrome";
}
@ -512,13 +515,13 @@ ChromeProfileMigrator.prototype._GetPasswordsResource = async function(
let crypto;
try {
if (AppConstants.platform == "win") {
let { ChromeWindowsLoginCrypto } = ChromeUtils.importESModule(
"resource:///modules/ChromeWindowsLoginCrypto.sys.mjs"
let { ChromeWindowsLoginCrypto } = ChromeUtils.import(
"resource:///modules/ChromeWindowsLoginCrypto.jsm"
);
crypto = new ChromeWindowsLoginCrypto(_chromeUserDataPathSuffix);
} else if (AppConstants.platform == "macosx") {
let { ChromeMacOSLoginCrypto } = ChromeUtils.importESModule(
"resource:///modules/ChromeMacOSLoginCrypto.sys.mjs"
let { ChromeMacOSLoginCrypto } = ChromeUtils.import(
"resource:///modules/ChromeMacOSLoginCrypto.jsm"
);
crypto = new ChromeMacOSLoginCrypto(
_keychainServiceName,
@ -625,7 +628,7 @@ ChromeProfileMigrator.prototype.classID = Components.ID(
/**
* Chromium migration
**/
export function ChromiumProfileMigrator() {
function ChromiumProfileMigrator() {
this._chromeUserDataPathSuffix = "Chromium";
this._keychainServiceName = "Chromium Safe Storage";
this._keychainAccountName = "Chromium";
@ -642,11 +645,17 @@ ChromiumProfileMigrator.prototype.classID = Components.ID(
"{8cece922-9720-42de-b7db-7cef88cb07ca}"
);
var EXPORTED_SYMBOLS = [
"ChromeProfileMigrator",
"ChromiumProfileMigrator",
"BraveProfileMigrator",
];
/**
* Chrome Canary
* Not available on Linux
**/
export function CanaryProfileMigrator() {
function CanaryProfileMigrator() {
this._chromeUserDataPathSuffix = "Canary";
}
CanaryProfileMigrator.prototype = Object.create(
@ -660,10 +669,14 @@ CanaryProfileMigrator.prototype.classID = Components.ID(
"{4bf85aa5-4e21-46ca-825f-f9c51a5e8c76}"
);
if (AppConstants.platform == "win" || AppConstants.platform == "macosx") {
EXPORTED_SYMBOLS.push("CanaryProfileMigrator");
}
/**
* Chrome Dev - Linux only (not available in Mac and Windows)
*/
export function ChromeDevMigrator() {
function ChromeDevMigrator() {
this._chromeUserDataPathSuffix = "Chrome Dev";
}
ChromeDevMigrator.prototype = Object.create(ChromeProfileMigrator.prototype);
@ -674,6 +687,10 @@ ChromeDevMigrator.prototype.classID = Components.ID(
"{7370a02a-4886-42c3-a4ec-d48c726ec30a}"
);
if (AppConstants.platform != "win" && AppConstants.platform != "macosx") {
EXPORTED_SYMBOLS.push("ChromeDevMigrator");
}
function ChromeBetaMigrator() {
this._chromeUserDataPathSuffix = "Chrome Beta";
}
@ -685,12 +702,15 @@ ChromeBetaMigrator.prototype.classID = Components.ID(
"{47f75963-840b-4950-a1f0-d9c1864f8b8e}"
);
export function BraveProfileMigrator() {
if (AppConstants.platform != "macosx") {
EXPORTED_SYMBOLS.push("ChromeBetaMigrator");
}
function BraveProfileMigrator() {
this._chromeUserDataPathSuffix = "Brave";
this._keychainServiceName = "Brave Browser Safe Storage";
this._keychainAccountName = "Brave Browser";
}
BraveProfileMigrator.prototype = Object.create(ChromeProfileMigrator.prototype);
BraveProfileMigrator.prototype.classDescription = "Brave Browser Migrator";
BraveProfileMigrator.prototype.contractID =
@ -699,7 +719,7 @@ BraveProfileMigrator.prototype.classID = Components.ID(
"{4071880a-69e4-4c83-88b4-6c589a62801d}"
);
export function ChromiumEdgeMigrator() {
function ChromiumEdgeMigrator() {
this._chromeUserDataPathSuffix = "Edge";
this._keychainServiceName = "Microsoft Edge Safe Storage";
this._keychainAccountName = "Microsoft Edge";
@ -713,7 +733,7 @@ ChromiumEdgeMigrator.prototype.classID = Components.ID(
"{3c7f6b7c-baa9-4338-acfa-04bf79f1dcf1}"
);
export function ChromiumEdgeBetaMigrator() {
function ChromiumEdgeBetaMigrator() {
this._chromeUserDataPathSuffix = "Edge Beta";
this._keychainServiceName = "Microsoft Edge Safe Storage";
this._keychainAccountName = "Microsoft Edge";
@ -729,7 +749,11 @@ ChromiumEdgeBetaMigrator.prototype.classID = Components.ID(
"{0fc3d48a-c1c3-4871-b58f-a8b47d1555fb}"
);
export function Chromium360seMigrator() {
if (AppConstants.platform == "macosx" || AppConstants.platform == "win") {
EXPORTED_SYMBOLS.push("ChromiumEdgeMigrator", "ChromiumEdgeBetaMigrator");
}
function Chromium360seMigrator() {
this._chromeUserDataPathSuffix = "360 SE";
}
Chromium360seMigrator.prototype = Object.create(
@ -742,3 +766,7 @@ Chromium360seMigrator.prototype.contractID =
Chromium360seMigrator.prototype.classID = Components.ID(
"{2e1a182e-ce4f-4dc9-a22c-d4125b931552}"
);
if (AppConstants.platform == "win") {
EXPORTED_SYMBOLS.push("Chromium360seMigrator");
}

Просмотреть файл

@ -2,15 +2,22 @@
* 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/. */
"use strict";
/**
* Class to handle encryption and decryption of logins stored in Chrome/Chromium
* on Windows.
*/
import { ChromeMigrationUtils } from "resource:///modules/ChromeMigrationUtils.sys.mjs";
var EXPORTED_SYMBOLS = ["ChromeWindowsLoginCrypto"];
const { ChromeMigrationUtils } = ChromeUtils.import(
"resource:///modules/ChromeMigrationUtils.jsm"
);
const { OSCrypto } = ChromeUtils.import("resource://gre/modules/OSCrypto.jsm");
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
/**
* These constants should match those from Chromium.
@ -30,7 +37,7 @@ const gTextEncoder = new TextEncoder();
* into code which uses that. The algorithms here are
* specific to what is needed for Chrome login storage on Windows.
*/
export class ChromeWindowsLoginCrypto {
class ChromeWindowsLoginCrypto {
/**
* @param {string} userDataPathSuffix
*/

Просмотреть файл

@ -2,9 +2,23 @@
* 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 { ctypes } = ChromeUtils.import("resource://gre/modules/ctypes.jsm");
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
"use strict";
var EXPORTED_SYMBOLS = [
"ESEDBReader",
// The items below are exported for test purposes.
"ESE",
"KERNEL",
"gLibs",
"COLUMN_TYPES",
"declareESEFunction",
"loadLibraries",
];
const { ctypes } = ChromeUtils.import("resource://gre/modules/ctypes.jsm");
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {};
XPCOMUtils.defineLazyGetter(lazy, "log", () => {
let { ConsoleAPI } = ChromeUtils.importESModule(
@ -27,8 +41,7 @@ let gESEInstanceCounter = 0;
const MAX_STR_LENGTH = 64 * 1024;
// Kernel-related types:
export const KERNEL = {};
const KERNEL = {};
KERNEL.FILETIME = new ctypes.StructType("FILETIME", [
{ dwLowDateTime: ctypes.uint32_t },
{ dwHighDateTime: ctypes.uint32_t },
@ -45,7 +58,7 @@ KERNEL.SYSTEMTIME = new ctypes.StructType("SYSTEMTIME", [
]);
// DB column types, cribbed from the ESE header
export var COLUMN_TYPES = {
var COLUMN_TYPES = {
JET_coltypBit: 1 /* True, False, or NULL */,
JET_coltypUnsignedByte: 2 /* 1-byte integer, unsigned */,
JET_coltypShort: 3 /* 2-byte integer, signed */,
@ -73,8 +86,7 @@ function getColTypeName(numericValue) {
}
// All type constants and method wrappers go on this object:
export const ESE = {};
const ESE = {};
ESE.JET_ERR = ctypes.long;
ESE.JET_PCWSTR = ctypes.char16_t.ptr;
// The ESE header calls this JET_API_PTR, but because it isn't ever used as a
@ -107,7 +119,7 @@ ESE.JET_COLUMNDEF = new ctypes.StructType("JET_COLUMNDEF", [
let gOpenDBs = new Map();
// Track open libraries
export let gLibs = {};
let gLibs = {};
function convertESEError(errorCode) {
switch (errorCode) {
@ -167,7 +179,7 @@ function handleESEError(
};
}
export function declareESEFunction(methodName, ...args) {
function declareESEFunction(methodName, ...args) {
let declaration = ["Jet" + methodName, ctypes.winapi_abi, ESE.JET_ERR].concat(
args
);
@ -305,7 +317,7 @@ function unloadLibraries() {
delete gLibs.kernel;
}
export function loadLibraries() {
function loadLibraries() {
Services.obs.addObserver(unloadLibraries, "xpcom-shutdown");
gLibs.ese = ctypes.open("esent.dll");
gLibs.kernel = ctypes.open("kernel32.dll");
@ -766,7 +778,7 @@ ESEDB.prototype = {
},
};
export let ESEDBReader = {
let ESEDBReader = {
openDB(rootDir, dbFile, logDir) {
let dbFilePath = dbFile.path;
if (gOpenDBs.has(dbFilePath)) {

Просмотреть файл

@ -2,23 +2,31 @@
* 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/. */
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
"use strict";
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm");
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import {
MigrationUtils,
MigratorPrototype,
} from "resource:///modules/MigrationUtils.sys.mjs";
import { MSMigrationUtils } from "resource:///modules/MSMigrationUtils.sys.mjs";
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { MigrationUtils, MigratorPrototype } = ChromeUtils.import(
"resource:///modules/MigrationUtils.jsm"
);
const { MSMigrationUtils } = ChromeUtils.import(
"resource:///modules/MSMigrationUtils.jsm"
);
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
ESEDBReader: "resource:///modules/ESEDBReader.sys.mjs",
PlacesUIUtils: "resource:///modules/PlacesUIUtils.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"ESEDBReader",
"resource:///modules/ESEDBReader.jsm"
);
const kEdgeRegistryRoot =
"SOFTWARE\\Classes\\Local Settings\\Software\\" +
@ -469,7 +477,7 @@ EdgeBookmarksMigrator.prototype = {
},
};
export function EdgeProfileMigrator() {
function EdgeProfileMigrator() {
this.wrappedJSObject = this;
}
@ -562,3 +570,5 @@ EdgeProfileMigrator.prototype.contractID =
EdgeProfileMigrator.prototype.classID = Components.ID(
"{62e8834b-2d17-49f5-96ff-56344903a2ae}"
);
var EXPORTED_SYMBOLS = ["EdgeProfileMigrator"];

Просмотреть файл

@ -4,6 +4,8 @@
* 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/. */
"use strict";
/*
* Migrates from a Firefox profile in a lossy manner in order to clean up a
* user's profile. Data is only migrated where the benefits outweigh the
@ -11,10 +13,9 @@
* from the source profile.
*/
import {
MigrationUtils,
MigratorPrototype,
} from "resource:///modules/MigrationUtils.sys.mjs";
const { MigrationUtils, MigratorPrototype } = ChromeUtils.import(
"resource:///modules/MigrationUtils.jsm"
);
const lazy = {};
@ -30,7 +31,7 @@ ChromeUtils.defineModuleGetter(
);
ChromeUtils.defineModuleGetter(lazy, "OS", "resource://gre/modules/osfile.jsm");
export function FirefoxProfileMigrator() {
function FirefoxProfileMigrator() {
this.wrappedJSObject = this; // for testing...
}
@ -375,3 +376,5 @@ FirefoxProfileMigrator.prototype.contractID =
FirefoxProfileMigrator.prototype.classID = Components.ID(
"{91185366-ba97-4438-acba-48deaca63386}"
);
var EXPORTED_SYMBOLS = ["FirefoxProfileMigrator"];

Просмотреть файл

@ -2,17 +2,21 @@
* 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/. */
"use strict";
const kLoginsKey =
"Software\\Microsoft\\Internet Explorer\\IntelliForms\\Storage2";
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm");
import {
MigrationUtils,
MigratorPrototype,
} from "resource:///modules/MigrationUtils.sys.mjs";
import { MSMigrationUtils } from "resource:///modules/MSMigrationUtils.sys.mjs";
const { MigrationUtils, MigratorPrototype } = ChromeUtils.import(
"resource:///modules/MigrationUtils.jsm"
);
const { MSMigrationUtils } = ChromeUtils.import(
"resource:///modules/MSMigrationUtils.jsm"
);
const lazy = {};
@ -349,7 +353,7 @@ IE7FormPasswords.prototype = {
},
};
export function IEProfileMigrator() {
function IEProfileMigrator() {
this.wrappedJSObject = this; // export this to be able to use it in the unittest.
}
@ -404,3 +408,5 @@ IEProfileMigrator.prototype.contractID =
IEProfileMigrator.prototype.classID = Components.ID(
"{3d2532e3-4932-4774-b7ba-968f5899d3a4}"
);
var EXPORTED_SYMBOLS = ["IEProfileMigrator"];

Просмотреть файл

@ -2,9 +2,16 @@
* 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/. */
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
"use strict";
import { MigrationUtils } from "resource:///modules/MigrationUtils.sys.mjs";
var EXPORTED_SYMBOLS = ["MSMigrationUtils"];
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
const { MigrationUtils } = ChromeUtils.import(
"resource:///modules/MigrationUtils.jsm"
);
const lazy = {};
@ -968,7 +975,7 @@ WindowsVaultFormPasswords.prototype = {
},
};
export var MSMigrationUtils = {
var MSMigrationUtils = {
MIGRATION_TYPE_IE: 1,
MIGRATION_TYPE_EDGE: 2,
CtypesKernelHelpers,

Просмотреть файл

@ -2,13 +2,19 @@
* 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/. */
"use strict";
var EXPORTED_SYMBOLS = ["MigrationUtils", "MigratorPrototype"];
const TOPIC_WILL_IMPORT_BOOKMARKS =
"initial-migration-will-import-default-bookmarks";
const TOPIC_DID_IMPORT_BOOKMARKS =
"initial-migration-did-import-default-bookmarks";
const TOPIC_PLACES_DEFAULTS_FINISHED = "places-browser-init-complete";
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
const lazy = {};
@ -98,7 +104,7 @@ function getL10n() {
* 5. Implement getResources(aProfile) (see below).
* 6. For startup-only migrators, override |startupOnlyMigrator|.
*/
export var MigratorPrototype = {
var MigratorPrototype = {
QueryInterface: ChromeUtils.generateQI(["nsIBrowserProfileMigrator"]),
/**
@ -510,7 +516,7 @@ export var MigratorPrototype = {
},
};
export var MigrationUtils = Object.seal({
var MigrationUtils = Object.seal({
resourceTypes: {
COOKIES: Ci.nsIBrowserProfileMigrator.COOKIES,
HISTORY: Ci.nsIBrowserProfileMigrator.HISTORY,

Просмотреть файл

@ -2,9 +2,13 @@
* 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/. */
import { MigrationUtils } from "resource:///modules/MigrationUtils.sys.mjs";
"use strict";
export function ProfileMigrator() {}
const { MigrationUtils } = ChromeUtils.import(
"resource:///modules/MigrationUtils.jsm"
);
function ProfileMigrator() {}
ProfileMigrator.prototype = {
migrate: MigrationUtils.startupMigration.bind(MigrationUtils),
@ -13,3 +17,5 @@ ProfileMigrator.prototype = {
contractID: "@mozilla.org/toolkit/profile-migrator;1",
classID: Components.ID("6F8BB968-C14F-4D6F-9733-6C6737B35DCE"),
};
var EXPORTED_SYMBOLS = ["ProfileMigrator"];

Просмотреть файл

@ -2,13 +2,15 @@
* 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/. */
import { FileUtils } from "resource://gre/modules/FileUtils.sys.mjs";
"use strict";
const { FileUtils } = ChromeUtils.importESModule(
"resource://gre/modules/FileUtils.sys.mjs"
);
const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm");
import {
MigrationUtils,
MigratorPrototype,
} from "resource:///modules/MigrationUtils.sys.mjs";
const { MigrationUtils, MigratorPrototype } = ChromeUtils.import(
"resource:///modules/MigrationUtils.jsm"
);
const lazy = {};
@ -358,7 +360,7 @@ SearchStrings.prototype = {
},
};
export function SafariProfileMigrator() {}
function SafariProfileMigrator() {}
SafariProfileMigrator.prototype = Object.create(MigratorPrototype);
@ -490,3 +492,5 @@ SafariProfileMigrator.prototype.contractID =
SafariProfileMigrator.prototype.classID = Components.ID(
"{4b609ecf-60b2-4655-9df4-dc149e474da1}"
);
var EXPORTED_SYMBOLS = ["SafariProfileMigrator"];

Просмотреть файл

@ -11,31 +11,31 @@ Classes = [
{
'cid': '{6F8BB968-C14F-4D6F-9733-6C6737B35DCE}',
'contract_ids': ['@mozilla.org/toolkit/profile-migrator;1'],
'esModule': 'resource:///modules/ProfileMigrator.sys.mjs',
'jsm': 'resource:///modules/ProfileMigrator.jsm',
'constructor': 'ProfileMigrator',
},
{
'cid': '{4071880a-69e4-4c83-88b4-6c589a62801d}',
'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=brave'],
'esModule': 'resource:///modules/ChromeProfileMigrator.sys.mjs',
'jsm': 'resource:///modules/ChromeProfileMigrator.jsm',
'constructor': 'BraveProfileMigrator',
},
{
'cid': '{4cec1de4-1671-4fc3-a53e-6c539dc77a26}',
'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=chrome'],
'esModule': 'resource:///modules/ChromeProfileMigrator.sys.mjs',
'jsm': 'resource:///modules/ChromeProfileMigrator.jsm',
'constructor': 'ChromeProfileMigrator',
},
{
'cid': '{8cece922-9720-42de-b7db-7cef88cb07ca}',
'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=chromium'],
'esModule': 'resource:///modules/ChromeProfileMigrator.sys.mjs',
'jsm': 'resource:///modules/ChromeProfileMigrator.jsm',
'constructor': 'ChromiumProfileMigrator',
},
{
'cid': '{91185366-ba97-4438-acba-48deaca63386}',
'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=firefox'],
'esModule': 'resource:///modules/FirefoxProfileMigrator.sys.mjs',
'jsm': 'resource:///modules/FirefoxProfileMigrator.jsm',
'constructor': 'FirefoxProfileMigrator',
},
]
@ -45,7 +45,7 @@ if not XP_MACOSX:
{
'cid': '{47f75963-840b-4950-a1f0-d9c1864f8b8e}',
'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=chrome-beta'],
'esModule': 'resource:///modules/ChromeProfileMigrator.sys.mjs',
'jsm': 'resource:///modules/ChromeProfileMigrator.jsm',
'constructor': 'ChromeBetaMigrator',
},
]
@ -55,19 +55,19 @@ if XP_WIN or XP_MACOSX:
{
'cid': '{4bf85aa5-4e21-46ca-825f-f9c51a5e8c76}',
'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=canary'],
'esModule': 'resource:///modules/ChromeProfileMigrator.sys.mjs',
'jsm': 'resource:///modules/ChromeProfileMigrator.jsm',
'constructor': 'CanaryProfileMigrator',
},
{
'cid': '{3c7f6b7c-baa9-4338-acfa-04bf79f1dcf1}',
'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=chromium-edge'],
'esModule': 'resource:///modules/ChromeProfileMigrator.sys.mjs',
'jsm': 'resource:///modules/ChromeProfileMigrator.jsm',
'constructor': 'ChromiumEdgeMigrator',
},
{
'cid': '{0fc3d48a-c1c3-4871-b58f-a8b47d1555fb}',
'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=chromium-edge-beta'],
'esModule': 'resource:///modules/ChromeProfileMigrator.sys.mjs',
'jsm': 'resource:///modules/ChromeProfileMigrator.jsm',
'constructor': 'ChromiumEdgeBetaMigrator',
},
]
@ -76,7 +76,7 @@ else:
{
'cid': '{7370a02a-4886-42c3-a4ec-d48c726ec30a}',
'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=chrome-dev'],
'esModule': 'resource:///modules/ChromeProfileMigrator.sys.mjs',
'jsm': 'resource:///modules/ChromeProfileMigrator.jsm',
'constructor': 'ChromeDevMigrator',
},
]
@ -86,19 +86,19 @@ if XP_WIN:
{
'cid': '{3d2532e3-4932-4774-b7ba-968f5899d3a4}',
'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=ie'],
'esModule': 'resource:///modules/IEProfileMigrator.sys.mjs',
'jsm': 'resource:///modules/IEProfileMigrator.jsm',
'constructor': 'IEProfileMigrator',
},
{
'cid': '{62e8834b-2d17-49f5-96ff-56344903a2ae}',
'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=edge'],
'esModule': 'resource:///modules/EdgeProfileMigrator.sys.mjs',
'jsm': 'resource:///modules/EdgeProfileMigrator.jsm',
'constructor': 'EdgeProfileMigrator',
},
{
'cid': '{2e1a182e-ce4f-4dc9-a22c-d4125b931552}',
'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=chromium-360se'],
'esModule': 'resource:///modules/ChromeProfileMigrator.sys.mjs',
'jsm': 'resource:///modules/ChromeProfileMigrator.jsm',
'constructor': 'Chromium360seMigrator',
},
]
@ -108,7 +108,7 @@ if XP_MACOSX:
{
'cid': '{4b609ecf-60b2-4655-9df4-dc149e474da1}',
'contract_ids': ['@mozilla.org/profile/migrator;1?app=browser&type=safari'],
'esModule': 'resource:///modules/SafariProfileMigrator.sys.mjs',
'jsm': 'resource:///modules/SafariProfileMigrator.jsm',
'constructor': 'SafariProfileMigrator',
},
{

Просмотреть файл

@ -10,8 +10,8 @@ const kIPStartup = Ci.nsIProfileStartup;
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
const { MigrationUtils } = ChromeUtils.importESModule(
"resource:///modules/MigrationUtils.sys.mjs"
const { MigrationUtils } = ChromeUtils.import(
"resource:///modules/MigrationUtils.jsm"
);
/**

Просмотреть файл

@ -17,11 +17,11 @@ XPIDL_SOURCES += [
XPIDL_MODULE = "migration"
EXTRA_JS_MODULES += [
"ChromeMigrationUtils.sys.mjs",
"ChromeProfileMigrator.sys.mjs",
"FirefoxProfileMigrator.sys.mjs",
"MigrationUtils.sys.mjs",
"ProfileMigrator.sys.mjs",
"ChromeMigrationUtils.jsm",
"ChromeProfileMigrator.jsm",
"FirefoxProfileMigrator.jsm",
"MigrationUtils.jsm",
"ProfileMigrator.jsm",
]
if CONFIG["OS_ARCH"] == "WINNT":
@ -33,12 +33,12 @@ if CONFIG["OS_ARCH"] == "WINNT":
"nsIEHistoryEnumerator.cpp",
]
EXTRA_JS_MODULES += [
"360seMigrationUtils.sys.mjs",
"ChromeWindowsLoginCrypto.sys.mjs",
"EdgeProfileMigrator.sys.mjs",
"ESEDBReader.sys.mjs",
"IEProfileMigrator.sys.mjs",
"MSMigrationUtils.sys.mjs",
"360seMigrationUtils.jsm",
"ChromeWindowsLoginCrypto.jsm",
"EdgeProfileMigrator.jsm",
"ESEDBReader.jsm",
"IEProfileMigrator.jsm",
"MSMigrationUtils.jsm",
]
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
@ -46,8 +46,8 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
"nsKeychainMigrationUtils.h",
]
EXTRA_JS_MODULES += [
"ChromeMacOSLoginCrypto.sys.mjs",
"SafariProfileMigrator.sys.mjs",
"ChromeMacOSLoginCrypto.jsm",
"SafariProfileMigrator.jsm",
]
SOURCES += [
"nsKeychainMigrationUtils.mm",

Просмотреть файл

@ -1,7 +1,7 @@
"use strict";
var { MigrationUtils, MigratorPrototype } = ChromeUtils.importESModule(
"resource:///modules/MigrationUtils.sys.mjs"
var { MigrationUtils, MigratorPrototype } = ChromeUtils.import(
"resource:///modules/MigrationUtils.jsm"
);
var { LoginHelper } = ChromeUtils.import(
"resource://gre/modules/LoginHelper.jsm"

Просмотреть файл

@ -1,7 +1,7 @@
"use strict";
const { Qihoo360seMigrationUtils } = ChromeUtils.importESModule(
"resource:///modules/360seMigrationUtils.sys.mjs"
const { Qihoo360seMigrationUtils } = ChromeUtils.import(
"resource:///modules/360seMigrationUtils.jsm"
);
const parentPath = do_get_file("AppData/Roaming/360se6/User Data").path;

Просмотреть файл

@ -1,7 +1,7 @@
"use strict";
const { ChromeMigrationUtils } = ChromeUtils.importESModule(
"resource:///modules/ChromeMigrationUtils.sys.mjs"
const { ChromeMigrationUtils } = ChromeUtils.import(
"resource:///modules/ChromeMigrationUtils.jsm"
);
// Setup chrome user data path for all platforms.

Просмотреть файл

@ -3,8 +3,8 @@
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
const { ChromeMigrationUtils } = ChromeUtils.importESModule(
"resource:///modules/ChromeMigrationUtils.sys.mjs"
const { ChromeMigrationUtils } = ChromeUtils.import(
"resource:///modules/ChromeMigrationUtils.jsm"
);
const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm");

Просмотреть файл

@ -3,8 +3,8 @@
"use strict";
const { ChromeMigrationUtils } = ChromeUtils.importESModule(
"resource:///modules/ChromeMigrationUtils.sys.mjs"
const { ChromeMigrationUtils } = ChromeUtils.import(
"resource:///modules/ChromeMigrationUtils.jsm"
);
const SOURCE_PROFILE_DIR = "Library/Application Support/Google/Chrome/Default/";

Просмотреть файл

@ -216,8 +216,8 @@ add_task(async function setup() {
accountName: "TESTING Chrome",
};
if (AppConstants.platform == "macosx") {
let { ChromeMacOSLoginCrypto } = ChromeUtils.importESModule(
"resource:///modules/ChromeMacOSLoginCrypto.sys.mjs"
let { ChromeMacOSLoginCrypto } = ChromeUtils.import(
"resource:///modules/ChromeMacOSLoginCrypto.jsm"
);
loginCrypto = new ChromeMacOSLoginCrypto(
mockMacOSKeychain.serviceName,
@ -234,8 +234,8 @@ add_task(async function setup() {
"Login Data",
];
} else if (AppConstants.platform == "win") {
let { ChromeWindowsLoginCrypto } = ChromeUtils.importESModule(
"resource:///modules/ChromeWindowsLoginCrypto.sys.mjs"
let { ChromeWindowsLoginCrypto } = ChromeUtils.import(
"resource:///modules/ChromeWindowsLoginCrypto.jsm"
);
loginCrypto = new ChromeWindowsLoginCrypto("Chrome");
dirSvcPath = "AppData/Local/";

Просмотреть файл

@ -8,7 +8,7 @@ const {
COLUMN_TYPES,
declareESEFunction,
loadLibraries,
} = ChromeUtils.importESModule("resource:///modules/ESEDBReader.sys.mjs");
} = ChromeUtils.import("resource:///modules/ESEDBReader.jsm");
let gESEInstanceCounter = 1;

Просмотреть файл

@ -11,7 +11,6 @@ import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
MigrationUtils: "resource:///modules/MigrationUtils.sys.mjs",
PlacesTransactions: "resource://gre/modules/PlacesTransactions.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
@ -21,6 +20,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
XPCOMUtils.defineLazyModuleGetters(lazy, {
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
CustomizableUI: "resource:///modules/CustomizableUI.jsm",
MigrationUtils: "resource:///modules/MigrationUtils.jsm",
OpenInTabsUtils: "resource:///modules/OpenInTabsUtils.jsm",
PluralForm: "resource://gre/modules/PluralForm.jsm",
Weave: "resource://services-sync/main.js",

Просмотреть файл

@ -13,7 +13,6 @@ var { XPCOMUtils } = ChromeUtils.importESModule(
);
ChromeUtils.defineESModuleGetters(this, {
BookmarkJSONUtils: "resource://gre/modules/BookmarkJSONUtils.sys.mjs",
MigrationUtils: "resource:///modules/MigrationUtils.sys.mjs",
PlacesBackups: "resource://gre/modules/PlacesBackups.sys.mjs",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
});
@ -32,7 +31,11 @@ XPCOMUtils.defineLazyScriptGetter(
var { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
ChromeUtils.defineModuleGetter(
this,
"MigrationUtils",
"resource:///modules/MigrationUtils.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"DownloadUtils",

Просмотреть файл

@ -268,7 +268,7 @@ function shouldRetry(response) {
);
}
// Copied from browser/components/migration/MigrationUtils.sys.mjs
// Copied from browser/components/migration/MigrationUtils.jsm
function spinResolve(promise) {
if (!(promise instanceof Promise)) {
return promise;

Просмотреть файл

@ -13,14 +13,11 @@ const NETWORK_TRR_MODE_PREF = "network.trr.mode";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
MigrationUtils: "resource:///modules/MigrationUtils.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
AddonManager: "resource://gre/modules/AddonManager.jsm",
UITour: "resource:///modules/UITour.jsm",
FxAccounts: "resource://gre/modules/FxAccounts.jsm",
MigrationUtils: "resource:///modules/MigrationUtils.jsm",
Spotlight: "resource://activity-stream/lib/Spotlight.jsm",
});

Просмотреть файл

@ -31,14 +31,14 @@ XPCOMUtils.defineLazyGetter(lazy, "PasswordRulesManager", () => {
});
ChromeUtils.defineESModuleGetters(lazy, {
ChromeMigrationUtils: "resource:///modules/ChromeMigrationUtils.sys.mjs",
MigrationUtils: "resource:///modules/MigrationUtils.sys.mjs",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
ChromeMigrationUtils: "resource:///modules/ChromeMigrationUtils.jsm",
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
LoginHelper: "resource://gre/modules/LoginHelper.jsm",
MigrationUtils: "resource:///modules/MigrationUtils.jsm",
PasswordGenerator: "resource://gre/modules/PasswordGenerator.jsm",
});

Просмотреть файл

@ -49,8 +49,8 @@ avoid-blacklist-and-whitelist:
- browser/base/content/test/tabMediaIndicator/browser_mute_webAudio.js
- browser/base/content/test/tabs/browser_new_file_whitelisted_http_tab.js
- browser/components/downloads/content/contentAreaDownloadsView.xhtml
- browser/components/migration/ChromeMigrationUtils.sys.mjs
- browser/components/migration/ChromeProfileMigrator.sys.mjs
- browser/components/migration/ChromeMigrationUtils.jsm
- browser/components/migration/ChromeProfileMigrator.jsm
- browser/components/newtab/data/content/activity-stream.bundle.js
- browser/components/ion/content/ion.js
- browser/components/preferences/privacy.inc.xhtml