mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 968520 - Add mozilla::fallible to Fallible{Auto,}TArray::ReplaceElementsAt calls. r=froydnj
This commit is contained in:
parent
8d7b0dbd81
commit
cacd440dcb
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user