Bug 1351953 - Make DecryptJob::PostResult take a mozilla::Span instead of nsTArray. r=gerald

This means we can pass anything that converts implicitly to a Span to
PostResult, including an nsTArray<uint8_t>. We can also pass a Span
that contains the contents of a Shmem's buffer.

MozReview-Commit-ID: 8AAcRmVCEVy

--HG--
extra : rebase_source : 44dfbc465db14bb689a653e6c0b3cbc626c0a0d1
This commit is contained in:
Chris Pearce 2017-04-05 10:32:19 +12:00
parent fb5a8a3e0d
commit 37ae2a9f5a
2 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ DecryptJob::PostResult(DecryptStatus aResult)
void
DecryptJob::PostResult(DecryptStatus aResult,
const nsTArray<uint8_t>& aDecryptedData)
Span<const uint8_t> aDecryptedData)
{
if (aDecryptedData.Length() != mSample->Size()) {
NS_WARNING("CDM returned incorrect number of decrypted bytes");

View File

@ -8,6 +8,7 @@
#define DecryptJob_h_
#include "mozilla/CDMProxy.h"
#include "mozilla/Span.h"
namespace mozilla {
@ -17,8 +18,7 @@ public:
explicit DecryptJob(MediaRawData* aSample);
void PostResult(DecryptStatus aResult,
const nsTArray<uint8_t>& aDecryptedData);
void PostResult(DecryptStatus aResult, Span<const uint8_t> aDecryptedData);
void PostResult(DecryptStatus aResult);
RefPtr<DecryptPromise> Ensure();