Bug 968520 - Add mozilla::fallible to Fallible{Auto,}TArray::ReplaceElementsAt calls. r=froydnj

This commit is contained in:
Birunthan Mohanathas 2015-05-18 13:50:35 -07:00
parent 8d7b0dbd81
commit cacd440dcb
3 changed files with 7 additions and 7 deletions

View File

@ -17,13 +17,14 @@ CryptoBuffer::Assign(const CryptoBuffer& aData)
{
// Same as in nsTArray_Impl::operator=, but return the value
// returned from ReplaceElementsAt to enable OOM detection
return ReplaceElementsAt(0, Length(), aData.Elements(), aData.Length());
return ReplaceElementsAt(0, Length(), aData.Elements(), aData.Length(),
fallible);
}
uint8_t*
CryptoBuffer::Assign(const uint8_t* aData, uint32_t aLength)
{
return ReplaceElementsAt(0, Length(), aData, aLength);
return ReplaceElementsAt(0, Length(), aData, aLength, fallible);
}
uint8_t*

View File

@ -654,7 +654,7 @@ MediaRawDataWriter::Replace(const uint8_t* aData, size_t aSize)
// We ensure sufficient capacity above so this shouldn't fail.
MOZ_ALWAYS_TRUE(mBuffer->ReplaceElementsAt(mTarget->mPadding, mTarget->mSize,
aData, aSize));
aData, aSize, fallible));
mTarget->mSize = mSize = aSize;
return true;
}

View File

@ -438,10 +438,9 @@ DOMSVGPathSegList::ReplaceItem(DOMSVGPathSeg& aNewItem,
float segAsRaw[1 + NS_SVG_PATH_SEG_MAX_ARGS];
domItem->ToSVGPathSegEncodedData(segAsRaw);
bool ok = !!InternalList().mData.ReplaceElementsAt(
internalIndex, 1 + oldArgCount,
segAsRaw, 1 + newArgCount);
if (!ok) {
if (!InternalList().mData.ReplaceElementsAt(internalIndex, 1 + oldArgCount,
segAsRaw, 1 + newArgCount,
fallible)) {
aError.Throw(NS_ERROR_OUT_OF_MEMORY);
return nullptr;
}