Issue #65 - Remove AppConstants from toolkit/mozapps/extensions

This commit is contained in:
Matt A. Tobin 2020-02-06 06:07:37 -05:00 committed by Roy Tam
commit 905663865e
2 changed files with 16 additions and 9 deletions

View file

@ -16,7 +16,6 @@ this.EXPORTED_SYMBOLS = [ "EME_ADOBE_ID",
Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/AppConstants.jsm");
// GMP IDs
const OPEN_H264_ID = "gmp-gmpopenh264";
@ -73,24 +72,32 @@ this.GMPUtils = {
return true;
}
if (aPlugin.id == EME_ADOBE_ID) {
#if defined(XP_WIN)
// Windows Vista and later only supported by Adobe EME.
return AppConstants.isPlatformAndVersionAtLeast("win", "6");
return true;
#else
return false;
#endif
} else if (aPlugin.id == WIDEVINE_ID) {
#if defined(XP_WIN) || defined(XP_LINUX) || defined(XP_MACOSX)
// The Widevine plugin is available for Windows versions Vista and later,
// Mac OSX, and Linux.
return AppConstants.isPlatformAndVersionAtLeast("win", "6") ||
AppConstants.platform == "macosx" ||
AppConstants.platform == "linux";
return true;
#else
return false;
#endif
}
return true;
},
_is32bitModeMacOS: function() {
if (AppConstants.platform != "macosx") {
return false;
}
#ifdef XP_MACOSX
return Services.appinfo.XPCOMABI.split("-")[0] == "x86";
#else
return false;
#endif
},
/**

View file

@ -29,13 +29,13 @@ EXTRA_PP_COMPONENTS += [
EXTRA_JS_MODULES += [
'ChromeManifestParser.jsm',
'DeferredSave.jsm',
'GMPUtils.jsm',
'LightweightThemeManager.jsm',
]
EXTRA_PP_JS_MODULES += [
'AddonManager.jsm',
'GMPInstallManager.jsm',
'GMPUtils.jsm',
]
# Additional debugging info is exposed in debug builds