зеркало из https://github.com/mozilla/gecko-dev.git
Bug 968520 - Add mozilla::fallible to Fallible{Auto,}TArray::ReplaceElementsAt calls. r=froydnj
This commit is contained in:
Родитель
71f1f00db4
Коммит
5ef5f55364
|
@ -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*
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче