Bug 1174220 - Part 1: Remove capacity constructor of MediaLargeByteBuffer. r=jya
authorBirunthan Mohanathas <birunthan@mohanathas.com>
Sun, 14 Jun 2015 21:37:13 -0700
changeset 248793 8651c422edfb3400d7aeb78f424ef763b655d92f
parent 248792 4c59a5c5da0204e1528ef2120fe25691e042bfdb
child 248794 9cbc7259a36865e02e3098f668c996b016f70966
push id61059
push userbirunthan@mohanathas.com
push dateMon, 15 Jun 2015 04:37:51 +0000
treeherdermozilla-inbound@a493653ebbed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1174220
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1174220 - Part 1: Remove capacity constructor of MediaLargeByteBuffer. r=jya
dom/media/MediaData.cpp
dom/media/MediaData.h
--- a/dom/media/MediaData.cpp
+++ b/dom/media/MediaData.cpp
@@ -485,27 +485,28 @@ VideoData::Create(const VideoInfo& aInfo
 
 #define RAW_DATA_DEFAULT_SIZE 4096
 
 MediaRawData::MediaRawData()
   : MediaData(RAW_DATA)
   , mData(nullptr)
   , mSize(0)
   , mCrypto(mCryptoInternal)
-  , mBuffer(new MediaLargeByteBuffer(RAW_DATA_DEFAULT_SIZE))
+  , mBuffer(new MediaByteBuffer())
   , mPadding(0)
 {
+  unused << mBuffer->SetCapacity(RAW_DATA_DEFAULT_SIZE, fallible);
 }
 
 MediaRawData::MediaRawData(const uint8_t* aData, size_t aSize)
   : MediaData(RAW_DATA)
   , mData(nullptr)
   , mSize(0)
   , mCrypto(mCryptoInternal)
-  , mBuffer(new MediaLargeByteBuffer(RAW_DATA_DEFAULT_SIZE))
+  , mBuffer(new MediaByteBuffer())
   , mPadding(0)
 {
   if (!EnsureCapacity(aSize)) {
     return;
   }
 
   // We ensure sufficient capacity above so this shouldn't fail.
   MOZ_ALWAYS_TRUE(mBuffer->AppendElements(aData, aSize, fallible));
--- a/dom/media/MediaData.h
+++ b/dom/media/MediaData.h
@@ -408,18 +408,16 @@ private:
   uint32_t mPadding;
   MediaRawData(const MediaRawData&); // Not implemented
 };
 
   // MediaLargeByteBuffer is a ref counted fallible TArray.
   // It is designed to share potentially big byte arrays.
 class MediaLargeByteBuffer : public FallibleTArray<uint8_t> {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaLargeByteBuffer);
-  MediaLargeByteBuffer() = default;
-  explicit MediaLargeByteBuffer(size_t aCapacity) : FallibleTArray<uint8_t>(aCapacity) {}
 
 private:
   ~MediaLargeByteBuffer() {}
 };
 
   // MediaByteBuffer is a ref counted infallible TArray.
 class MediaByteBuffer : public nsTArray<uint8_t> {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaByteBuffer);