Bug 851848 - Remove OOM checks for the result of NewLineBox now that PresArena allocations are infallible. r=bzbarsky

This commit is contained in:
Mats Palmgren 2013-03-23 21:10:33 +01:00
parent cfa63ad101
commit 134413ceb0
2 changed files with 2 additions and 11 deletions

View File

@ -3214,7 +3214,6 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
// Push continuation to a new line, but only if we actually made one.
if (madeContinuation) {
nsLineBox* line = NewLineBox(nextFrame, true);
NS_ENSURE_TRUE(line, NS_ERROR_OUT_OF_MEMORY);
mLines.after_insert(aLine, line);
}
@ -3998,9 +3997,6 @@ nsBlockFrame::SplitLine(nsBlockReflowState& aState,
// Put frames being split out into their own line
nsLineBox* newLine = NewLineBox(aLine, aFrame, pushCount);
if (!newLine) {
return NS_ERROR_OUT_OF_MEMORY;
}
mLines.after_insert(aLine, newLine);
#ifdef DEBUG
if (gReallyNoisyReflow) {
@ -4893,9 +4889,6 @@ nsBlockFrame::AddFrames(nsFrameList& aFrameList, nsIFrame* aPrevSibling)
if (rem) {
// Split the line in two where the frame(s) are being inserted.
nsLineBox* line = NewLineBox(prevSibLine, aPrevSibling->GetNextSibling(), rem);
if (!line) {
return NS_ERROR_OUT_OF_MEMORY;
}
lineList->after_insert(prevSibLine, line);
// Mark prevSibLine dirty and as needing textrun invalidation, since
// we may be breaking up text in the line. Its previous line may also
@ -4938,9 +4931,6 @@ nsBlockFrame::AddFrames(nsFrameList& aFrameList, nsIFrame* aPrevSibling)
// Create a new line for the frame and add its line to the line
// list.
nsLineBox* line = NewLineBox(newFrame, isBlock);
if (!line) {
return NS_ERROR_OUT_OF_MEMORY;
}
if (prevSibLine != lineList->end()) {
// Append new line after prevSibLine
lineList->after_insert(prevSibLine, line);

View File

@ -152,6 +152,7 @@ need to rearrange the mBits bitfield;
/**
* Function to create a line box and initialize it with a single frame.
* The allocation is infallible.
* If the frame was moved from another line then you're responsible
* for notifying that line using NoteFrameRemoved(). Alternatively,
* it's better to use the next function that does that for you in an
@ -161,7 +162,7 @@ nsLineBox* NS_NewLineBox(nsIPresShell* aPresShell, nsIFrame* aFrame,
bool aIsBlock);
/**
* Function to create a line box and initialize it with aCount frames
* that are currently on aFromLine.
* that are currently on aFromLine. The allocation is infallible.
*/
nsLineBox* NS_NewLineBox(nsIPresShell* aPresShell, nsLineBox* aFromLine,
nsIFrame* aFrame, int32_t aCount);