зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to autoland. a=merge on a CLOSED TREE
--HG-- extra : amend_source : 73ac1169c4dcaf634f1e8df61f319f7bc4f02cd4
This commit is contained in:
Коммит
c180635643
|
@ -2827,6 +2827,7 @@ class StaticAnalysis(MachCommandBase):
|
|||
with open(paths[0], 'r') as fin:
|
||||
process.stdin.write(fin.read())
|
||||
process.stdin.close()
|
||||
process.wait();
|
||||
return 0
|
||||
|
||||
def _run_clang_format_path(self, clang_format, show, paths):
|
||||
|
|
|
@ -47,12 +47,14 @@ const {nsIBlocklistService} = Ci;
|
|||
* BOOTSTRAP_REASONS,
|
||||
* DB_SCHEMA,
|
||||
* XPIStates,
|
||||
* migrateAddonLoader
|
||||
*/
|
||||
|
||||
for (let sym of [
|
||||
"BOOTSTRAP_REASONS",
|
||||
"DB_SCHEMA",
|
||||
"XPIStates",
|
||||
"migrateAddonLoader",
|
||||
]) {
|
||||
XPCOMUtils.defineLazyGetter(this, sym, () => XPIInternal[sym]);
|
||||
}
|
||||
|
@ -1318,37 +1320,7 @@ this.XPIDatabase = {
|
|||
if (inputAddons.schemaVersion == 27) {
|
||||
// Types were translated in bug 857456.
|
||||
for (let addon of inputAddons.addons) {
|
||||
switch (addon.type) {
|
||||
case "extension":
|
||||
case "dictionary":
|
||||
case "locale":
|
||||
case "theme":
|
||||
addon.loader = "bootstrap";
|
||||
break;
|
||||
|
||||
case "webbextension":
|
||||
addon.type = "extension";
|
||||
addon.loader = null;
|
||||
break;
|
||||
|
||||
case "webextension-dictionary":
|
||||
addon.type = "dictionary";
|
||||
addon.loader = null;
|
||||
break;
|
||||
|
||||
case "webextension-langpack":
|
||||
addon.type = "locale";
|
||||
addon.loader = null;
|
||||
break;
|
||||
|
||||
case "webextension-theme":
|
||||
addon.type = "theme";
|
||||
addon.loader = null;
|
||||
break;
|
||||
|
||||
default:
|
||||
logger.warn(`Not converting unknown addon type ${addon.type}`);
|
||||
}
|
||||
migrateAddonLoader(addon);
|
||||
}
|
||||
} else if (inputAddons.schemaVersion != DB_SCHEMA) {
|
||||
// For now, we assume compatibility for JSON data with a
|
||||
|
|
|
@ -353,6 +353,53 @@ function* iterDirectory(aDir) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate data about an addon to match the change made in bug 857456
|
||||
* in which "webextension-foo" types were converted to "foo" and the
|
||||
* "loader" property was added to distinguish different addon types.
|
||||
*
|
||||
* @param {Object} addon The addon info to migrate.
|
||||
* @returns {boolean} True if the addon data was converted, false if not.
|
||||
*/
|
||||
function migrateAddonLoader(addon) {
|
||||
if (addon.hasOwnProperty("loader")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (addon.type) {
|
||||
case "extension":
|
||||
case "dictionary":
|
||||
case "locale":
|
||||
case "theme":
|
||||
addon.loader = "bootstrap";
|
||||
break;
|
||||
|
||||
case "webextension":
|
||||
addon.type = "extension";
|
||||
addon.loader = null;
|
||||
break;
|
||||
|
||||
case "webextension-dictionary":
|
||||
addon.type = "dictionary";
|
||||
addon.loader = null;
|
||||
break;
|
||||
|
||||
case "webextension-langpack":
|
||||
addon.type = "locale";
|
||||
addon.loader = null;
|
||||
break;
|
||||
|
||||
case "webextension-theme":
|
||||
addon.type = "theme";
|
||||
addon.loader = null;
|
||||
break;
|
||||
|
||||
default:
|
||||
logger.warn(`Not converting unknown addon type ${addon.type}`);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* The on-disk state of an individual XPI, created from an Object
|
||||
* as stored in the addonStartup.json file.
|
||||
|
@ -1202,6 +1249,21 @@ var XPIStates = {
|
|||
{error: e});
|
||||
}
|
||||
|
||||
// When upgrading from a build prior to bug 857456, convert startup
|
||||
// metadata.
|
||||
let done = false;
|
||||
for (let location of Object.values(state)) {
|
||||
for (let data of Object.values(location.addons)) {
|
||||
if (!migrateAddonLoader(data)) {
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (done) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
logger.debug("Loaded add-on state: ${}", state);
|
||||
return state || {};
|
||||
},
|
||||
|
@ -2729,6 +2791,7 @@ var XPIInternal = {
|
|||
getURIForResourceInFile,
|
||||
isXPI,
|
||||
iterDirectory,
|
||||
migrateAddonLoader,
|
||||
};
|
||||
|
||||
var addonTypes = [
|
||||
|
|
Загрузка…
Ссылка в новой задаче