зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1527811 - Ensure we write the ABI of the GMP we expect to have installed. r=Gijs
We write the ABI of the plugin we installed to preferences so that if the ABI stored in the profile of a previously installed plugin differs to the ABI of the Firefox build we're runnning, we can uninstall the plugin and re-install one with the correct ABI. Since we're downloading a plugin of a different ABI than the parent process, we need to modify the ABI written to preferences here. This mechanism was added to handle Firefox profiles transitioning from running in an x86 Firefox to an x64 Firefox on Windows. We can use the same mechanism to handle transitioning from an x86 to aarch64 Widevine here. When we eventually get an aarch64 version of Widevine, we can rollback this changeset, and the ABI mismatch will be detected, and we'll uninstall the x86 CDM, and download the new aarch64 CDM. Differential Revision: https://phabricator.services.mozilla.com/D19901 --HG-- extra : source : b5f5996f7225be2ae56d38f7f8833ca200743acb extra : histedit_source : d831a00887ab8932fd001a511b0559a76fa832b7
This commit is contained in:
Родитель
c5ec94b248
Коммит
e2de194bbf
|
@ -430,7 +430,9 @@ GMPDownloader.prototype = {
|
||||||
// Remember our ABI, so that if the profile is migrated to another
|
// Remember our ABI, so that if the profile is migrated to another
|
||||||
// platform or from 32 -> 64 bit, we notice and don't try to load the
|
// platform or from 32 -> 64 bit, we notice and don't try to load the
|
||||||
// unexecutable plugin library.
|
// unexecutable plugin library.
|
||||||
GMPPrefs.setString(GMPPrefs.KEY_PLUGIN_ABI, UpdateUtils.ABI, gmpAddon.id);
|
let abi = GMPUtils._expectedABI(gmpAddon);
|
||||||
|
log.info("Setting ABI to '" + abi + "' for " + gmpAddon.id);
|
||||||
|
GMPPrefs.setString(GMPPrefs.KEY_PLUGIN_ABI, abi, gmpAddon.id);
|
||||||
// Setting the version pref signals installation completion to consumers,
|
// Setting the version pref signals installation completion to consumers,
|
||||||
// if you need to set other prefs etc. do it before this.
|
// if you need to set other prefs etc. do it before this.
|
||||||
GMPPrefs.setString(GMPPrefs.KEY_PLUGIN_VERSION, gmpAddon.version,
|
GMPPrefs.setString(GMPPrefs.KEY_PLUGIN_VERSION, gmpAddon.version,
|
||||||
|
|
|
@ -100,6 +100,16 @@ var GMPUtils = {
|
||||||
_isWindowsOnARM64() {
|
_isWindowsOnARM64() {
|
||||||
return AppConstants.platform == "win" && UpdateUtils.ABI.match(/aarch64/);
|
return AppConstants.platform == "win" && UpdateUtils.ABI.match(/aarch64/);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_expectedABI(aPlugin) {
|
||||||
|
let defaultABI = UpdateUtils.ABI;
|
||||||
|
if (aPlugin.id == WIDEVINE_ID && this._isWindowsOnARM64()) {
|
||||||
|
// On Windows on aarch64, we need the x86 plugin,
|
||||||
|
// as there's no native aarch64 plugins yet.
|
||||||
|
defaultABI = defaultABI.replace(/aarch64/g, "x86");
|
||||||
|
}
|
||||||
|
return defaultABI;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -16,9 +16,7 @@ const {Log} = ChromeUtils.import("resource://gre/modules/Log.jsm");
|
||||||
// These symbols are, unfortunately, accessed via the module global from
|
// These symbols are, unfortunately, accessed via the module global from
|
||||||
// tests, and therefore cannot be lexical definitions.
|
// tests, and therefore cannot be lexical definitions.
|
||||||
var {GMPPrefs, GMPUtils, OPEN_H264_ID, WIDEVINE_ID} = ChromeUtils.import("resource://gre/modules/GMPUtils.jsm");
|
var {GMPPrefs, GMPUtils, OPEN_H264_ID, WIDEVINE_ID} = ChromeUtils.import("resource://gre/modules/GMPUtils.jsm");
|
||||||
/* globals GMP_PLUGIN_IDS, GMPPrefs, GMPUtils, OPEN_H264_ID, WIDEVINE_ID */
|
|
||||||
const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||||
const {UpdateUtils} = ChromeUtils.import("resource://gre/modules/UpdateUtils.jsm");
|
|
||||||
|
|
||||||
ChromeUtils.defineModuleGetter(
|
ChromeUtils.defineModuleGetter(
|
||||||
this, "GMPInstallManager", "resource://gre/modules/GMPInstallManager.jsm");
|
this, "GMPInstallManager", "resource://gre/modules/GMPInstallManager.jsm");
|
||||||
|
@ -530,9 +528,10 @@ GMPWrapper.prototype = {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let abi = GMPPrefs.getString(GMPPrefs.KEY_PLUGIN_ABI, UpdateUtils.ABI,
|
let expectedABI = GMPUtils._expectedABI(this._plugin);
|
||||||
|
let abi = GMPPrefs.getString(GMPPrefs.KEY_PLUGIN_ABI, expectedABI,
|
||||||
this._plugin.id);
|
this._plugin.id);
|
||||||
if (abi != UpdateUtils.ABI) {
|
if (abi != expectedABI) {
|
||||||
// ABI doesn't match. Possibly this is a profile migrated across platforms
|
// ABI doesn't match. Possibly this is a profile migrated across platforms
|
||||||
// or from 32 -> 64 bit.
|
// or from 32 -> 64 bit.
|
||||||
return {
|
return {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче