Bug 1174220 - Part 1: Remove capacity constructor of MediaLargeByteBuffer. r=jya

This commit is contained in:
Birunthan Mohanathas 2015-06-14 21:37:13 -07:00
parent a42b09b30a
commit baee045959
2 changed files with 3 additions and 4 deletions

View File

@ -490,9 +490,10 @@ MediaRawData::MediaRawData()
, mData(nullptr) , mData(nullptr)
, mSize(0) , mSize(0)
, mCrypto(mCryptoInternal) , mCrypto(mCryptoInternal)
, mBuffer(new MediaLargeByteBuffer(RAW_DATA_DEFAULT_SIZE)) , mBuffer(new MediaByteBuffer())
, mPadding(0) , mPadding(0)
{ {
unused << mBuffer->SetCapacity(RAW_DATA_DEFAULT_SIZE, fallible);
} }
MediaRawData::MediaRawData(const uint8_t* aData, size_t aSize) MediaRawData::MediaRawData(const uint8_t* aData, size_t aSize)
@ -500,7 +501,7 @@ MediaRawData::MediaRawData(const uint8_t* aData, size_t aSize)
, mData(nullptr) , mData(nullptr)
, mSize(0) , mSize(0)
, mCrypto(mCryptoInternal) , mCrypto(mCryptoInternal)
, mBuffer(new MediaLargeByteBuffer(RAW_DATA_DEFAULT_SIZE)) , mBuffer(new MediaByteBuffer())
, mPadding(0) , mPadding(0)
{ {
if (!EnsureCapacity(aSize)) { if (!EnsureCapacity(aSize)) {

View File

@ -413,8 +413,6 @@ private:
// It is designed to share potentially big byte arrays. // It is designed to share potentially big byte arrays.
class MediaLargeByteBuffer : public FallibleTArray<uint8_t> { class MediaLargeByteBuffer : public FallibleTArray<uint8_t> {
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaLargeByteBuffer); NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaLargeByteBuffer);
MediaLargeByteBuffer() = default;
explicit MediaLargeByteBuffer(size_t aCapacity) : FallibleTArray<uint8_t>(aCapacity) {}
private: private:
~MediaLargeByteBuffer() {} ~MediaLargeByteBuffer() {}