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
Родитель 71f1f00db4
Коммит 5ef5f55364
3 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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