Bug 1314452 - Remove IsGMPPresentOnDisk checks from Gecko. r=gerald

These are done in the GMPProvider, so it's unnecessary to do them again inside
Gecko. Plus, they cause main thread synchronous IPC in multi-process Firefox.


MozReview-Commit-ID: EcG38i3b2Oh

--HG--
extra : rebase_source : 37dffa797be13913131efb0019fd2e32c21b1fb6
This commit is contained in:
Chris Pearce 2016-11-02 11:17:50 +13:00
Родитель 73236599be
Коммит e80a3b5b24
5 изменённых файлов: 0 добавлений и 129 удалений

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

@ -50,7 +50,6 @@
#include "mozilla/dom/ExternalHelperAppParent.h"
#include "mozilla/dom/GetFilesHelper.h"
#include "mozilla/dom/GeolocationBinding.h"
#include "mozilla/dom/MediaKeySystemAccess.h"
#include "mozilla/dom/Notification.h"
#include "mozilla/dom/PContentBridgeParent.h"
#include "mozilla/dom/PContentPermissionRequestParent.h"
@ -958,18 +957,6 @@ ContentParent::RecvCreateGMPService()
return PGMPService::Open(this);
}
bool
ContentParent::RecvIsGMPPresentOnDisk(const nsString& aKeySystem,
const nsCString& aVersion,
bool* aIsPresent,
nsCString* aMessage)
{
*aIsPresent = MediaKeySystemAccess::IsGMPPresentOnDisk(aKeySystem,
aVersion,
*aMessage);
return true;
}
bool
ContentParent::RecvLoadPlugin(const uint32_t& aPluginId, nsresult* aRv, uint32_t* aRunID)
{

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

@ -248,11 +248,6 @@ public:
virtual bool RecvCreateGMPService() override;
virtual bool RecvIsGMPPresentOnDisk(const nsString& aKeySystem,
const nsCString& aVersion,
bool* aIsPresent,
nsCString* aMessage) override;
virtual bool RecvLoadPlugin(const uint32_t& aPluginId, nsresult* aRv,
uint32_t* aRunID) override;

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

@ -708,8 +708,6 @@ parent:
sync BridgeToChildProcess(ContentParentId cpId);
async CreateGMPService();
sync IsGMPPresentOnDisk(nsString keySystem, nsCString version)
returns (bool isPresent, nsCString message);
/**
* This call connects the content process to a plugin process. While this

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

@ -4,7 +4,6 @@
* 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/. */
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/MediaKeySystemAccess.h"
#include "mozilla/dom/MediaKeySystemAccessBinding.h"
#include "mozilla/Preferences.h"
@ -121,106 +120,6 @@ HaveGMPFor(mozIGeckoMediaPluginService* aGMPService,
return hasPlugin;
}
#ifdef XP_WIN
static bool
AdobePluginFileExists(const nsACString& aVersionStr,
const nsAString& aFilename)
{
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
nsCOMPtr<nsIFile> path;
nsresult rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(path));
if (NS_WARN_IF(NS_FAILED(rv))) {
return false;
}
rv = path->Append(NS_LITERAL_STRING("gmp-eme-adobe"));
if (NS_WARN_IF(NS_FAILED(rv))) {
return false;
}
rv = path->AppendNative(aVersionStr);
if (NS_WARN_IF(NS_FAILED(rv))) {
return false;
}
rv = path->Append(aFilename);
if (NS_WARN_IF(NS_FAILED(rv))) {
return false;
}
bool exists = false;
return NS_SUCCEEDED(path->Exists(&exists)) && exists;
}
static bool
AdobePluginDLLExists(const nsACString& aVersionStr)
{
return AdobePluginFileExists(aVersionStr, NS_LITERAL_STRING("eme-adobe.dll"));
}
static bool
AdobePluginVoucherExists(const nsACString& aVersionStr)
{
return AdobePluginFileExists(aVersionStr, NS_LITERAL_STRING("eme-adobe.voucher"));
}
#endif
/* static */ bool
MediaKeySystemAccess::IsGMPPresentOnDisk(const nsAString& aKeySystem,
const nsACString& aVersion,
nsACString& aOutMessage)
{
MOZ_ASSERT(NS_IsMainThread());
if (XRE_GetProcessType() != GeckoProcessType_Default) {
// We need to be able to access the filesystem, so call this in the
// main process via ContentChild.
ContentChild* contentChild = ContentChild::GetSingleton();
if (NS_WARN_IF(!contentChild)) {
return false;
}
nsCString message;
bool result = false;
bool ok = contentChild->SendIsGMPPresentOnDisk(nsString(aKeySystem), nsCString(aVersion),
&result, &message);
aOutMessage = message;
return ok && result;
}
bool isPresent = true;
#if XP_WIN
if (IsPrimetimeKeySystem(aKeySystem)) {
if (!AdobePluginDLLExists(aVersion)) {
NS_WARNING("Adobe EME plugin disappeared from disk!");
aOutMessage = NS_LITERAL_CSTRING("Adobe DLL was expected to be on disk but was not");
isPresent = false;
}
if (!AdobePluginVoucherExists(aVersion)) {
NS_WARNING("Adobe EME voucher disappeared from disk!");
aOutMessage = NS_LITERAL_CSTRING("Adobe plugin voucher was expected to be on disk but was not");
isPresent = false;
}
if (!isPresent) {
// Reset the prefs that Firefox's GMP downloader sets, so that
// Firefox will try to download the plugin next time the updater runs.
Preferences::ClearUser("media.gmp-eme-adobe.lastUpdate");
Preferences::ClearUser("media.gmp-eme-adobe.version");
} else if (!EMEVoucherFileExists()) {
// Gecko doesn't have a voucher file for the plugin-container.
// Adobe EME isn't going to work, so don't advertise that it will.
aOutMessage = NS_LITERAL_CSTRING("Plugin-container voucher not present");
isPresent = false;
}
}
#endif
return isPresent;
}
static MediaKeySystemStatus
EnsureMinCDMVersion(mozIGeckoMediaPluginService* aGMPService,
const nsAString& aKeySystem,
@ -247,10 +146,6 @@ EnsureMinCDMVersion(mozIGeckoMediaPluginService* aGMPService,
return MediaKeySystemStatus::Cdm_not_installed;
}
if (!MediaKeySystemAccess::IsGMPPresentOnDisk(aKeySystem, versionStr, aOutMessage)) {
return MediaKeySystemStatus::Cdm_not_installed;
}
nsresult rv;
int32_t version = versionStr.ToInteger(&rv);
if (aMinCdmVersion != NO_CDM_VERSION &&

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

@ -66,10 +66,6 @@ public:
const nsAString& aKeySystem,
MediaKeySystemStatus aStatus);
static bool IsGMPPresentOnDisk(const nsAString& aKeySystem,
const nsACString& aVersion,
nsACString& aOutMessage);
static bool GetSupportedConfig(const nsAString& aKeySystem,
const Sequence<MediaKeySystemConfiguration>& aConfigs,
MediaKeySystemConfiguration& aOutConfig,