Bug 1245256 - Add support for Widevine to CDM updater. r=spohl

MozReview-Commit-ID: JwB4Q6ZEqoV
This commit is contained in:
Kirk Steuber 2016-02-25 14:24:13 -08:00
Родитель 753e89fc45
Коммит 6b6ea89530
4 изменённых файлов: 28 добавлений и 6 удалений

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

@ -29,3 +29,6 @@ openH264_description2=This plugin is automatically installed by Mozilla to compl
eme-adobe_name=Primetime Content Decryption Module provided by Adobe Systems, Incorporated
eme-adobe_description=Play back protected web video.
widevine_name=WidevineCdm
widevine_description=Widevine Content Decryption Module provided by Google Inc.

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

@ -351,7 +351,7 @@ GMPAddon.prototype = {
GMPPrefs.get(GMPPrefs.KEY_PLUGIN_VERSION, "", this.id) === this.version;
},
get isEME() {
return this.id.indexOf("gmp-eme-") == 0;
return this.id == "gmp-widevinecdm" || this.id.indexOf("gmp-eme-") == 0;
},
};
/**

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

@ -11,7 +11,8 @@ this.EXPORTED_SYMBOLS = [ "EME_ADOBE_ID",
"GMP_PLUGIN_IDS",
"GMPPrefs",
"GMPUtils",
"OPEN_H264_ID" ];
"OPEN_H264_ID",
"WIDEVINE_ID" ];
Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Services.jsm");
@ -20,7 +21,8 @@ Cu.import("resource://gre/modules/AppConstants.jsm");
// GMP IDs
const OPEN_H264_ID = "gmp-gmpopenh264";
const EME_ADOBE_ID = "gmp-eme-adobe";
const GMP_PLUGIN_IDS = [ OPEN_H264_ID, EME_ADOBE_ID ];
const WIDEVINE_ID = "gmp-widevinecdm";
const GMP_PLUGIN_IDS = [ OPEN_H264_ID, EME_ADOBE_ID, WIDEVINE_ID ];
var GMPPluginUnsupportedReason = {
NOT_WINDOWS: 1,

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

@ -72,6 +72,15 @@ const GMP_PLUGINS = [
isEME: true,
missingKey: "VIDEO_ADOBE_GMP_DISAPPEARED",
missingFilesKey: "VIDEO_ADOBE_GMP_MISSING_FILES",
},
{
id: WIDEVINE_ID,
name: "widevine_name",
description: "widevine_description",
licenseURL: "http://www.google.com/policies/terms/",
homepageURL: "http://www.widevine.com/",
optionsURL: "chrome://mozapps/content/extensions/gmpPrefs.xul",
isEME: true
}];
XPCOMUtils.defineConstant(this, "GMP_PLUGINS", GMP_PLUGINS);
@ -477,10 +486,16 @@ GMPWrapper.prototype = {
let id = this._plugin.id.substring(4);
let libName = AppConstants.DLL_PREFIX + id + AppConstants.DLL_SUFFIX;
let infoName;
if (this._plugin.id == WIDEVINE_ID) {
infoName = "manifest.json";
} else {
infoName = id + ".info";
}
return {
libraryMissing: !fileExists(this.gmpPath, libName),
infoMissing: !fileExists(this.gmpPath, id + ".info"),
infoMissing: !fileExists(this.gmpPath, infoName),
voucherMissing: this._plugin.id == EME_ADOBE_ID
&& !fileExists(this.gmpPath, id + ".voucher"),
};
@ -560,13 +575,15 @@ var GMPProvider = {
wrapper.uninstallPlugin();
continue;
}
if (validation.installed) {
if (validation.installed && wrapper.missingFilesKey) {
telemetryService.getHistogramById(wrapper.missingFilesKey).add(validation.telemetry);
}
if (!validation.valid) {
this._log.info("startup - gmp " + plugin.id +
" missing [" + validation.missing + "], uninstalling");
telemetryService.getHistogramById(wrapper.missingKey).add(true);
if (wrapper.missingKey) {
telemetryService.getHistogramById(wrapper.missingKey).add(true);
}
wrapper.uninstallPlugin();
continue;
}