Bug 1303910 - remove superfluous FallibleTArray in Blob.cpp; r=baku
authorNathan Froyd <froydnj@mozilla.com>
Tue, 20 Sep 2016 21:29:28 -0400
changeset 314538 8f87b0ff155b0cc6826b1ef38363e9797a35e4a5
parent 314537 6396e3ab4695af0b3815bd09255c48d182f06540
child 314539 665d28dc815d1c1203bcd10e6f74b7259234b9e8
push id81919
push usernfroyd@mozilla.com
push dateTue, 20 Sep 2016 17:31:42 +0000
treeherdermozilla-inbound@665d28dc815d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1303910
milestone52.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 1303910 - remove superfluous FallibleTArray in Blob.cpp; r=baku This array only exists to be initialized fallibly so we can swap it into the infallible array we actually want to use. But we can fallibly initialize the infallible array directly, so let's do that.
dom/ipc/Blob.cpp
--- a/dom/ipc/Blob.cpp
+++ b/dom/ipc/Blob.cpp
@@ -818,24 +818,21 @@ CreateBlobImpl(const nsTArray<BlobData>&
 
     DebugOnly<bool> isMutable;
     MOZ_ASSERT(NS_SUCCEEDED(blobImpl->GetMutable(&isMutable)));
     MOZ_ASSERT(!isMutable);
 
     return blobImpl.forget();
   }
 
-  FallibleTArray<RefPtr<BlobImpl>> fallibleBlobImpls;
-  if (NS_WARN_IF(!fallibleBlobImpls.SetLength(aBlobDatas.Length(), fallible))) {
+  nsTArray<RefPtr<BlobImpl>> blobImpls;
+  if (NS_WARN_IF(!blobImpls.SetLength(aBlobDatas.Length(), fallible))) {
     return nullptr;
   }
 
-  nsTArray<RefPtr<BlobImpl>> blobImpls;
-  fallibleBlobImpls.SwapElements(blobImpls);
-
   const bool hasRecursed = aMetadata.mHasRecursed;
   aMetadata.mHasRecursed = true;
 
   for (uint32_t count = aBlobDatas.Length(), index = 0;
        index < count;
        index++) {
     const BlobData& blobData = aBlobDatas[index];
     RefPtr<BlobImpl>& blobImpl = blobImpls[index];