зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 9e3064aec4bb (bug 1361900) for crashing Marionette's test_timeouts.py TestTimeouts.test_reset_timeout on Linux debug with e10s. r=backout
This commit is contained in:
Родитель
0bc683dcda
Коммит
7b52c82b67
|
@ -19,16 +19,12 @@ namespace mozilla {
|
|||
class MediaRawData;
|
||||
class ChromiumCDMProxy;
|
||||
|
||||
namespace eme {
|
||||
enum DecryptStatus {
|
||||
Ok = 0,
|
||||
GenericErr = 1,
|
||||
NoKeyErr = 2,
|
||||
AbortedErr = 3,
|
||||
};
|
||||
}
|
||||
|
||||
using eme::DecryptStatus;
|
||||
|
||||
struct DecryptResult {
|
||||
DecryptResult(DecryptStatus aStatus, MediaRawData* aSample)
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
namespace mozilla {
|
||||
namespace gmp {
|
||||
|
||||
using namespace eme;
|
||||
|
||||
ChromiumCDMParent::ChromiumCDMParent(GMPContentParent* aContentParent,
|
||||
uint32_t aPluginId)
|
||||
: mPluginId(aPluginId)
|
||||
|
@ -1086,7 +1084,7 @@ ChromiumCDMParent::Shutdown()
|
|||
mProxy = nullptr;
|
||||
|
||||
for (RefPtr<DecryptJob>& decrypt : mDecrypts) {
|
||||
decrypt->PostResult(eme::AbortedErr);
|
||||
decrypt->PostResult(AbortedErr);
|
||||
}
|
||||
mDecrypts.Clear();
|
||||
|
||||
|
|
|
@ -557,7 +557,7 @@ ChromiumCDMProxy::Decrypt(MediaRawData* aSample)
|
|||
{
|
||||
RefPtr<gmp::ChromiumCDMParent> cdm = GetCDMParent();
|
||||
if (!cdm) {
|
||||
return DecryptPromise::CreateAndReject(DecryptResult(eme::AbortedErr, aSample),
|
||||
return DecryptPromise::CreateAndReject(DecryptResult(AbortedErr, aSample),
|
||||
__func__);
|
||||
}
|
||||
RefPtr<MediaRawData> sample = aSample;
|
||||
|
|
|
@ -36,12 +36,12 @@ DecryptJob::PostResult(DecryptStatus aResult,
|
|||
if (aDecryptedData.Length() != mSample->Size()) {
|
||||
NS_WARNING("CDM returned incorrect number of decrypted bytes");
|
||||
}
|
||||
if (aResult == eme::Ok) {
|
||||
if (aResult == Ok) {
|
||||
UniquePtr<MediaRawDataWriter> writer(mSample->CreateWriter());
|
||||
PodCopy(writer->Data(),
|
||||
aDecryptedData.Elements(),
|
||||
std::min<size_t>(aDecryptedData.Length(), mSample->Size()));
|
||||
} else if (aResult == eme::NoKeyErr) {
|
||||
} else if (aResult == NoKeyErr) {
|
||||
NS_WARNING("CDM returned NoKeyErr");
|
||||
// We still have the encrypted sample, so we can re-enqueue it to be
|
||||
// decrypted again once the key is usable again.
|
||||
|
|
|
@ -500,7 +500,7 @@ GMPCDMProxy::gmp_Shutdown()
|
|||
// Abort any pending decrypt jobs, to awaken any clients waiting on a job.
|
||||
for (size_t i = 0; i < mDecryptionJobs.Length(); i++) {
|
||||
DecryptJob* job = mDecryptionJobs[i];
|
||||
job->PostResult(eme::AbortedErr);
|
||||
job->PostResult(AbortedErr);
|
||||
}
|
||||
mDecryptionJobs.Clear();
|
||||
|
||||
|
@ -696,7 +696,7 @@ GMPCDMProxy::gmp_Decrypt(RefPtr<DecryptJob> aJob)
|
|||
MOZ_ASSERT(IsOnOwnerThread());
|
||||
|
||||
if (!mCDM) {
|
||||
aJob->PostResult(eme::AbortedErr);
|
||||
aJob->PostResult(AbortedErr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -400,10 +400,10 @@ DecryptStatus
|
|||
ToDecryptStatus(GMPErr aError)
|
||||
{
|
||||
switch (aError) {
|
||||
case GMPNoErr: return eme::Ok;
|
||||
case GMPNoKeyErr: return eme::NoKeyErr;
|
||||
case GMPAbortedErr: return eme::AbortedErr;
|
||||
default: return eme::GenericErr;
|
||||
case GMPNoErr: return Ok;
|
||||
case GMPNoKeyErr: return NoKeyErr;
|
||||
case GMPAbortedErr: return AbortedErr;
|
||||
default: return GenericErr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -127,12 +127,12 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
if (aDecrypted.mStatus == eme::NoKeyErr) {
|
||||
if (aDecrypted.mStatus == NoKeyErr) {
|
||||
// Key became unusable after we sent the sample to CDM to decrypt.
|
||||
// Call Decode() again, so that the sample is enqueued for decryption
|
||||
// if the key becomes usable again.
|
||||
AttemptDecode(aDecrypted.mSample);
|
||||
} else if (aDecrypted.mStatus != eme::Ok) {
|
||||
} else if (aDecrypted.mStatus != Ok) {
|
||||
mDecodePromise.RejectIfExists(
|
||||
MediaResult(
|
||||
NS_ERROR_DOM_MEDIA_FATAL_ERR,
|
||||
|
|
Загрузка…
Ссылка в новой задаче