Back out 4 changesets (bug 1276132) for browser_gmpProvider.js failures

CLOSED TREE

Backed out changeset 511a2389ca48 (bug 1276132)
Backed out changeset 91b3cdd0640a (bug 1276132)
Backed out changeset 09b9972e36f9 (bug 1276132)
Backed out changeset 69052d4e3dbb (bug 1276132)
This commit is contained in:
Phil Ringnalda 2016-06-08 20:36:22 -07:00
Родитель 8d1174f9a3
Коммит 7270ed519a
13 изменённых файлов: 85 добавлений и 95 удалений

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

@ -1285,21 +1285,11 @@ pref("media.gmp.decoder.h264", 2);
// decode H.264.
pref("media.gmp.trial-create.enabled", true);
// Note: when media.gmp-*.visible is true, provided we're running on a
// supported platform/OS version, the corresponding CDM appears in the
// plugins list, Firefox will download the GMP/CDM if enabled, and our
// UI to re-enable EME prompts the user to re-enable EME if it's disabled
// and script requests EME. If *.visible is false, we won't show the UI
// to enable the CDM if its disabled; it's as if the keysystem is completely
// unsupported.
#ifdef MOZ_ADOBE_EME
pref("media.gmp-eme-adobe.visible", true);
pref("media.gmp-eme-adobe.enabled", true);
#endif
#ifdef MOZ_WIDEVINE_EME
pref("media.gmp-widevinecdm.visible", true);
pref("media.gmp-widevinecdm.enabled", true);
#endif

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

@ -31,20 +31,6 @@ var gEMEHandler = {
}
browser.reload();
},
isKeySystemVisible: function(keySystem) {
if (!keySystem) {
return false;
}
if (keySystem.startsWith("com.adobe") &&
Services.prefs.getPrefType("media.gmp-eme-adobe.visible")) {
return Services.prefs.getBoolPref("media.gmp-eme-adobe.visible");
}
if (keySystem == "com.widevine.alpha" &&
Services.prefs.getPrefType("media.gmp-widevinecdm.visible")) {
return Services.prefs.getBoolPref("media.gmp-widevinecdm.visible");
}
return true;
},
getLearnMoreLink: function(msgId) {
let text = gNavigatorBundle.getString("emeNotifications." + msgId + ".learnMoreLabel");
let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
@ -60,8 +46,8 @@ var gEMEHandler = {
return;
}
let {status: status, keySystem: keySystem} = parsedData;
// Don't need to show if disabled or keysystem not visible.
if (!this.uiEnabled || !this.isKeySystemVisible(keySystem)) {
// Don't need to show if disabled
if (!this.uiEnabled) {
return;
}

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

@ -278,51 +278,51 @@ MediaKeySystemAccess::GetKeySystemStatus(const nsAString& aKeySystem,
return EnsureMinCDMVersion(mps, aKeySystem, aMinCdmVersion, aOutMessage, aOutCdmVersion);
}
if (Preferences::GetBool("media.gmp-eme-adobe.visible", false)) {
if (aKeySystem.EqualsLiteral("com.adobe.primetime")) {
if (!Preferences::GetBool("media.gmp-eme-adobe.enabled", false)) {
aOutMessage = NS_LITERAL_CSTRING("Adobe EME disabled");
return MediaKeySystemStatus::Cdm_disabled;
}
#ifdef MOZ_ADOBE_EME
if (aKeySystem.EqualsLiteral("com.adobe.primetime")) {
if (!Preferences::GetBool("media.gmp-eme-adobe.enabled", false)) {
aOutMessage = NS_LITERAL_CSTRING("Adobe EME disabled");
return MediaKeySystemStatus::Cdm_disabled;
}
#ifdef XP_WIN
// Win Vista and later only.
if (!IsVistaOrLater()) {
aOutMessage = NS_LITERAL_CSTRING("Minimum Windows version (Vista) not met for Adobe EME");
return MediaKeySystemStatus::Cdm_not_supported;
}
// Win Vista and later only.
if (!IsVistaOrLater()) {
aOutMessage = NS_LITERAL_CSTRING("Minimum Windows version (Vista) not met for Adobe EME");
return MediaKeySystemStatus::Cdm_not_supported;
}
#endif
#ifdef XP_MACOSX
if (!nsCocoaFeatures::OnLionOrLater()) {
aOutMessage = NS_LITERAL_CSTRING("Minimum MacOSX version (10.7) not met for Adobe EME");
return MediaKeySystemStatus::Cdm_not_supported;
}
#endif
return EnsureMinCDMVersion(mps, aKeySystem, aMinCdmVersion, aOutMessage, aOutCdmVersion);
if (!nsCocoaFeatures::OnLionOrLater()) {
aOutMessage = NS_LITERAL_CSTRING("Minimum MacOSX version (10.7) not met for Adobe EME");
return MediaKeySystemStatus::Cdm_not_supported;
}
#endif
return EnsureMinCDMVersion(mps, aKeySystem, aMinCdmVersion, aOutMessage, aOutCdmVersion);
}
#endif
if (Preferences::GetBool("media.gmp-widevinecdm.visible", false)) {
if (aKeySystem.EqualsLiteral("com.widevine.alpha")) {
#ifdef MOZ_WIDEVINE_EME
if (aKeySystem.EqualsLiteral("com.widevine.alpha")) {
#ifdef XP_WIN
// Win Vista and later only.
if (!IsVistaOrLater()) {
aOutMessage = NS_LITERAL_CSTRING("Minimum Windows version (Vista) not met for Widevine EME");
return MediaKeySystemStatus::Cdm_not_supported;
}
// Win Vista and later only.
if (!IsVistaOrLater()) {
aOutMessage = NS_LITERAL_CSTRING("Minimum Windows version (Vista) not met for Widevine EME");
return MediaKeySystemStatus::Cdm_not_supported;
}
#endif
#ifdef XP_MACOSX
if (!nsCocoaFeatures::OnLionOrLater()) {
aOutMessage = NS_LITERAL_CSTRING("Minimum MacOSX version (10.7) not met for Widevine EME");
return MediaKeySystemStatus::Cdm_not_supported;
}
#endif
if (!Preferences::GetBool("media.gmp-widevinecdm.enabled", false)) {
aOutMessage = NS_LITERAL_CSTRING("Widevine EME disabled");
return MediaKeySystemStatus::Cdm_disabled;
}
return EnsureMinCDMVersion(mps, aKeySystem, aMinCdmVersion, aOutMessage, aOutCdmVersion);
if (!nsCocoaFeatures::OnLionOrLater()) {
aOutMessage = NS_LITERAL_CSTRING("Minimum MacOSX version (10.7) not met for Widevine EME");
return MediaKeySystemStatus::Cdm_not_supported;
}
#endif
if (!Preferences::GetBool("media.gmp-widevinecdm.enabled", false)) {
aOutMessage = NS_LITERAL_CSTRING("Widevine EME disabled");
return MediaKeySystemStatus::Cdm_disabled;
}
return EnsureMinCDMVersion(mps, aKeySystem, aMinCdmVersion, aOutMessage, aOutCdmVersion);
}
#endif
return MediaKeySystemStatus::Cdm_not_supported;
}

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

@ -4,6 +4,9 @@
# 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/.
for cdm in CONFIG['MOZ_EME_MODULES']:
DEFINES['MOZ_%s_EME' % cdm.upper()] = True
EXPORTS.mozilla.dom += [
'MediaEncryptedEvent.h',
'MediaKeyError.h',

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

@ -23,7 +23,9 @@
#include "GMPUtils.h"
#include "prio.h"
#include "base/task.h"
#ifdef MOZ_WIDEVINE_EME
#include "widevine-adapter/WidevineAdapter.h"
#endif
using namespace mozilla::ipc;
using mozilla::dom::CrashReporterChild;
@ -374,12 +376,17 @@ GMPChild::AnswerStartPlugin(const nsString& aAdapter)
return false;
}
#ifdef MOZ_WIDEVINE_EME
bool isWidevine = aAdapter.EqualsLiteral("widevine");
#endif
#if defined(MOZ_GMP_SANDBOX) && defined(XP_MACOSX)
MacSandboxPluginType pluginType = MacSandboxPluginType_GMPlugin_Default;
#ifdef MOZ_WIDEVINE_EME
if (isWidevine) {
pluginType = MacSandboxPluginType_GMPlugin_EME_Widevine;
pluginType = MacSandboxPluginType_GMPlugin_EME_Widevine;
}
#endif
if (!SetMacSandboxInfo(pluginType)) {
NS_WARNING("Failed to set Mac GMP sandbox info");
delete platformAPI;
@ -387,7 +394,12 @@ GMPChild::AnswerStartPlugin(const nsString& aAdapter)
}
#endif
GMPAdapter* adapter = (isWidevine) ? new WidevineAdapter() : nullptr;
GMPAdapter* adapter = nullptr;
#ifdef MOZ_WIDEVINE_EME
if (isWidevine) {
adapter = new WidevineAdapter();
}
#endif
if (!mGMPLoader->Load(libPath.get(),
libPath.Length(),
mNodeId.BeginWriting(),

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

@ -40,8 +40,10 @@ using CrashReporter::GetIDFromMinidump;
#include "WMFDecoderModule.h"
#endif
#ifdef MOZ_WIDEVINE_EME
#include "mozilla/dom/WidevineCDMManifestBinding.h"
#include "widevine-adapter/WidevineAdapter.h"
#endif
namespace mozilla {
@ -807,6 +809,7 @@ GMPParent::ReadGMPMetaData()
return ReadGMPInfoFile(infoFile);
}
#ifdef MOZ_WIDEVINE_EME
// Maybe this is the Widevine adapted plugin?
nsCOMPtr<nsIFile> manifestFile;
rv = mDirectory->Clone(getter_AddRefs(manifestFile));
@ -815,6 +818,9 @@ GMPParent::ReadGMPMetaData()
}
manifestFile->AppendRelativePath(NS_LITERAL_STRING("manifest.json"));
return ReadChromiumManifestFile(manifestFile);
#else
return GenericPromise::CreateAndReject(rv, __func__);
#endif
}
RefPtr<GenericPromise>
@ -909,6 +915,7 @@ GMPParent::ReadGMPInfoFile(nsIFile* aFile)
return GenericPromise::CreateAndResolve(true, __func__);
}
#ifdef MOZ_WIDEVINE_EME
RefPtr<GenericPromise>
GMPParent::ReadChromiumManifestFile(nsIFile* aFile)
{
@ -961,6 +968,7 @@ GMPParent::ParseChromiumManifest(nsString aJSON)
return GenericPromise::CreateAndResolve(true, __func__);
}
#endif
bool
GMPParent::CanBeSharedCrossNodeIds() const

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

@ -167,8 +167,10 @@ private:
bool EnsureProcessLoaded();
RefPtr<GenericPromise> ReadGMPMetaData();
RefPtr<GenericPromise> ReadGMPInfoFile(nsIFile* aFile);
#ifdef MOZ_WIDEVINE_EME
RefPtr<GenericPromise> ParseChromiumManifest(nsString aJSON); // Main thread.
RefPtr<GenericPromise> ReadChromiumManifestFile(nsIFile* aFile); // GMP thread.
#endif
#ifdef MOZ_CRASHREPORTER
void WriteExtraDataForMinidump(CrashReporter::AnnotationTable& notes);
void GetCrashID(nsString& aResult);

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

@ -4,6 +4,9 @@
# 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/.
for cdm in CONFIG['MOZ_EME_MODULES']:
DEFINES['MOZ_%s_EME' % cdm.upper()] = True
XPIDL_MODULE = 'content_geckomediaplugins'
XPIDL_SOURCES += [
@ -117,9 +120,13 @@ UNIFIED_SOURCES += [
DIRS += [
'rlz',
'widevine-adapter',
]
if 'widevine' in CONFIG['MOZ_EME_MODULES']:
DIRS += [
'widevine-adapter',
]
IPDL_SOURCES += [
'GMPTypes.ipdlh',
'PGMP.ipdl',

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

@ -193,7 +193,7 @@ WidevineDecryptor::DecryptingComplete()
class WidevineBuffer : public cdm::Buffer {
public:
explicit WidevineBuffer(size_t aSize) {
WidevineBuffer(size_t aSize) {
Log("WidevineBuffer(size=" PRIuSIZE ") created", aSize);
mBuffer.SetLength(aSize);
}

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

@ -46,7 +46,7 @@ class CDMWrapper {
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CDMWrapper)
explicit CDMWrapper(cdm::ContentDecryptionModule_8* aCDM)
CDMWrapper(cdm::ContentDecryptionModule_8* aCDM)
: mCDM(aCDM)
{
MOZ_ASSERT(mCDM);

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

@ -46,8 +46,8 @@ this.GMPUtils = {
return false;
}
if (!this._isPluginSupported(aPlugin) ||
!this._isPluginVisible(aPlugin)) {
if (!this._isPluginSupported(aPlugin) &&
!this._isPluginForcedVisible(aPlugin)) {
this.maybeReportTelemetry(aPlugin.id,
"VIDEO_EME_ADOBE_HIDDEN_REASON",
GMPPluginHiddenReason.UNSUPPORTED);
@ -70,9 +70,6 @@ this.GMPUtils = {
* The plugin to check.
*/
_isPluginSupported: function(aPlugin) {
if (this._isPluginForceSupported(aPlugin)) {
return true;
}
if (aPlugin.id == EME_ADOBE_ID) {
if (Services.appinfo.OS != "WINNT") {
// Non-Windows OSes currently unsupported by Adobe EME
@ -95,25 +92,13 @@ this.GMPUtils = {
},
/**
* Checks whether or not a given plugin is visible in the addons manager
* UI and the "enable DRM" notification box. This can be used to test
* plugins that aren't yet turned on in the mozconfig.
* Checks whether or not a given plugin is forced visible. This can be used
* to test plugins that aren't yet supported by default on a particular OS.
* @param aPlugin
* The plugin to check.
*/
_isPluginVisible: function(aPlugin) {
return GMPPrefs.get(GMPPrefs.KEY_PLUGIN_VISIBLE, false, aPlugin.id);
},
/**
* Checks whether or not a given plugin is forced-supported. This is used
* in automated tests to override the checks that prevent GMPs running on an
* unsupported platform.
* @param aPlugin
* The plugin to check.
*/
_isPluginForceSupported: function(aPlugin) {
return GMPPrefs.get(GMPPrefs.KEY_PLUGIN_FORCE_SUPPORTED, false, aPlugin.id);
_isPluginForcedVisible: function(aPlugin) {
return GMPPrefs.get(GMPPrefs.KEY_PLUGIN_FORCEVISIBLE, false, aPlugin.id);
},
/**
@ -151,9 +136,8 @@ this.GMPPrefs = {
KEY_PLUGIN_LAST_UPDATE: "media.{0}.lastUpdate",
KEY_PLUGIN_VERSION: "media.{0}.version",
KEY_PLUGIN_AUTOUPDATE: "media.{0}.autoupdate",
KEY_PLUGIN_VISIBLE: "media.{0}.visible",
KEY_PLUGIN_FORCEVISIBLE: "media.{0}.forcevisible",
KEY_PLUGIN_ABI: "media.{0}.abi",
KEY_PLUGIN_FORCE_SUPPORTED: "media.{0}.forceSupported",
KEY_URL: "media.gmp-manager.url",
KEY_URL_OVERRIDE: "media.gmp-manager.url.override",
KEY_CERT_CHECKATTRS: "media.gmp-manager.cert.checkAttributes",

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

@ -102,7 +102,7 @@ add_task(function* initializeState() {
gPrefs.clearUserPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_LAST_UPDATE, addon.id));
gPrefs.clearUserPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_AUTOUPDATE, addon.id));
gPrefs.clearUserPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_VERSION, addon.id));
gPrefs.clearUserPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_VISIBLE, addon.id));
gPrefs.clearUserPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_FORCEVISIBLE, addon.id));
}
gPrefs.clearUserPref(GMPScope.GMPPrefs.KEY_LOGGING_DUMP);
gPrefs.clearUserPref(GMPScope.GMPPrefs.KEY_LOGGING_LEVEL);
@ -125,7 +125,7 @@ add_task(function* initializeState() {
gPrefs.setIntPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_LAST_UPDATE, addon.id), 0);
gPrefs.setBoolPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_AUTOUPDATE, addon.id), false);
gPrefs.setCharPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_VERSION, addon.id), "");
gPrefs.setBoolPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_VISIBLE, addon.id),
gPrefs.setBoolPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_FORCEVISIBLE, addon.id),
true);
}
yield GMPScope.GMPProvider.shutdown();
@ -370,7 +370,7 @@ add_task(function* testUpdateButton() {
add_task(function* testEmeSupport() {
for (let addon of gMockAddons) {
gPrefs.clearUserPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_VISIBLE, addon.id));
gPrefs.clearUserPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_FORCEVISIBLE, addon.id));
}
yield GMPScope.GMPProvider.shutdown();
GMPScope.GMPProvider.startup();
@ -400,7 +400,7 @@ add_task(function* testEmeSupport() {
}
for (let addon of gMockAddons) {
gPrefs.setBoolPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_VISIBLE, addon.id),
gPrefs.setBoolPref(getKey(GMPScope.GMPPrefs.KEY_PLUGIN_FORCEVISIBLE, addon.id),
true);
}
yield GMPScope.GMPProvider.shutdown();

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

@ -59,9 +59,7 @@ function run_test() {
gPrefs.setIntPref(GMPScope.GMPPrefs.KEY_LOGGING_LEVEL, 0);
gPrefs.setBoolPref(GMPScope.GMPPrefs.KEY_EME_ENABLED, true);
for (let addon of gMockAddons.values()) {
gPrefs.setBoolPref(gGetKey(GMPScope.GMPPrefs.KEY_PLUGIN_VISIBLE, addon.id),
true);
gPrefs.setBoolPref(gGetKey(GMPScope.GMPPrefs.KEY_PLUGIN_FORCE_SUPPORTED, addon.id),
gPrefs.setBoolPref(gGetKey(GMPScope.GMPPrefs.KEY_PLUGIN_FORCEVISIBLE, addon.id),
true);
}
GMPScope.GMPProvider.shutdown();