Bug 792180 - Replace NS_{UN,}LIKELY with MOZ_{UN,}LIKELY; r=ehsan

This commit is contained in:
Jacek Szpot
2012-10-26 15:32:10 +02:00
parent a710077c4c
commit 09f9b9a1c3
102 changed files with 534 additions and 452 deletions

View File

@@ -10,6 +10,7 @@
*/
#include "mozilla/Util.h"
#include "mozilla/Likely.h"
#include "nsCSSFrameConstructor.h"
#include "nsCRT.h"
@@ -1122,7 +1123,7 @@ nsFrameConstructorState::AddChild(nsIFrame* aNewFrame,
nsFrameState placeholderType;
nsFrameItems* frameItems = &aFrameItems;
#ifdef MOZ_XUL
if (NS_UNLIKELY(aIsOutOfFlowPopup)) {
if (MOZ_UNLIKELY(aIsOutOfFlowPopup)) {
NS_ASSERTION(aNewFrame->GetParent() == mPopupItems.containingBlock,
"Popup whose parent is not the popup containing block?");
NS_ASSERTION(mPopupItems.containingBlock, "Must have a popup set frame!");
@@ -1989,7 +1990,7 @@ nsCSSFrameConstructor::ConstructTableRow(nsFrameConstructorState& aState,
else
newFrame = NS_NewTableRowFrame(mPresShell, styleContext);
if (NS_UNLIKELY(!newFrame)) {
if (MOZ_UNLIKELY(!newFrame)) {
return NS_ERROR_OUT_OF_MEMORY;
}
InitAndRestoreFrame(aState, content, aParentFrame, nullptr, newFrame);
@@ -2024,7 +2025,7 @@ nsCSSFrameConstructor::ConstructTableCol(nsFrameConstructorState& aState,
nsStyleContext* const styleContext = aItem.mStyleContext;
nsTableColFrame* colFrame = NS_NewTableColFrame(mPresShell, styleContext);
if (NS_UNLIKELY(!colFrame)) {
if (MOZ_UNLIKELY(!colFrame)) {
return NS_ERROR_OUT_OF_MEMORY;
}
InitAndRestoreFrame(aState, content, aParentFrame, nullptr, colFrame);
@@ -2039,7 +2040,7 @@ nsCSSFrameConstructor::ConstructTableCol(nsFrameConstructorState& aState,
int32_t span = colFrame->GetSpan();
for (int32_t spanX = 1; spanX < span; spanX++) {
nsTableColFrame* newCol = NS_NewTableColFrame(mPresShell, styleContext);
if (NS_UNLIKELY(!newCol)) {
if (MOZ_UNLIKELY(!newCol)) {
return NS_ERROR_OUT_OF_MEMORY;
}
InitAndRestoreFrame(aState, content, aParentFrame, nullptr, newCol,
@@ -2085,7 +2086,7 @@ nsCSSFrameConstructor::ConstructTableCell(nsFrameConstructorState& aState,
// See IsInAutoWidthTableCellForQuirk() in nsImageFrame.cpp.
newFrame = NS_NewTableCellFrame(mPresShell, styleContext, borderCollapse);
if (NS_UNLIKELY(!newFrame)) {
if (MOZ_UNLIKELY(!newFrame)) {
return NS_ERROR_OUT_OF_MEMORY;
}
@@ -2108,7 +2109,7 @@ nsCSSFrameConstructor::ConstructTableCell(nsFrameConstructorState& aState,
isBlock = true;
}
if (NS_UNLIKELY(!cellInnerFrame)) {
if (MOZ_UNLIKELY(!cellInnerFrame)) {
newFrame->Destroy();
return NS_ERROR_OUT_OF_MEMORY;
}
@@ -2371,7 +2372,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle
"Scrollbars should have been propagated to the viewport");
#endif
if (NS_UNLIKELY(display->mDisplay == NS_STYLE_DISPLAY_NONE)) {
if (MOZ_UNLIKELY(display->mDisplay == NS_STYLE_DISPLAY_NONE)) {
SetUndisplayedContent(aDocElement, styleContext);
return NS_OK;
}
@@ -2409,7 +2410,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle
#ifdef MOZ_XUL
if (aDocElement->IsXUL()) {
contentFrame = NS_NewDocElementBoxFrame(mPresShell, styleContext);
if (NS_UNLIKELY(!contentFrame)) {
if (MOZ_UNLIKELY(!contentFrame)) {
return NS_ERROR_OUT_OF_MEMORY;
}
InitAndRestoreFrame(state, aDocElement, mDocElementContainingBlock, nullptr,
@@ -2816,7 +2817,7 @@ nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell,
parentStyleContext);
aPageFrame = NS_NewPageFrame(aPresShell, pagePseudoStyle);
if (NS_UNLIKELY(!aPageFrame))
if (MOZ_UNLIKELY(!aPageFrame))
return NS_ERROR_OUT_OF_MEMORY;
// Initialize the page frame and force it to have a view. This makes printing of
@@ -2829,7 +2830,7 @@ nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell,
pagePseudoStyle);
nsIFrame* pageContentFrame = NS_NewPageContentFrame(aPresShell, pageContentPseudoStyle);
if (NS_UNLIKELY(!pageContentFrame))
if (MOZ_UNLIKELY(!pageContentFrame))
return NS_ERROR_OUT_OF_MEMORY;
// Initialize the page content frame and force it to have a view. Also make it the
@@ -2850,7 +2851,7 @@ nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell,
pageContentPseudoStyle);
aCanvasFrame = NS_NewCanvasFrame(aPresShell, canvasPseudoStyle);
if (NS_UNLIKELY(!aCanvasFrame))
if (MOZ_UNLIKELY(!aCanvasFrame))
return NS_ERROR_OUT_OF_MEMORY;
nsIFrame* prevCanvasFrame = nullptr;
@@ -3120,7 +3121,7 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState,
nsStyleContext* const styleContext = aItem.mStyleContext;
nsIFrame* newFrame = NS_NewFieldSetFrame(mPresShell, styleContext);
if (NS_UNLIKELY(!newFrame)) {
if (MOZ_UNLIKELY(!newFrame)) {
return NS_ERROR_OUT_OF_MEMORY;
}
@@ -3241,7 +3242,7 @@ nsCSSFrameConstructor::ConstructTextFrame(const FrameConstructionData* aData,
nsIFrame* newFrame = (*aData->mFunc.mCreationFunc)(mPresShell, aStyleContext);
if (NS_UNLIKELY(!newFrame))
if (MOZ_UNLIKELY(!newFrame))
return NS_ERROR_OUT_OF_MEMORY;
nsresult rv = InitAndRestoreFrame(aState, aContent, aParentFrame,
@@ -3673,7 +3674,7 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt
styleContext);
nsIFrame* blockFrame =
NS_NewBlockFormattingContext(mPresShell, blockContext);
if (NS_UNLIKELY(!blockFrame)) {
if (MOZ_UNLIKELY(!blockFrame)) {
primaryFrame->Destroy();
return NS_ERROR_OUT_OF_MEMORY;
}
@@ -4475,7 +4476,7 @@ nsCSSFrameConstructor::ConstructScrollableBlock(nsFrameConstructorState& aState,
&scrolledFrame, blockItem,
aDisplay->IsPositioned(scrolledFrame),
aItem.mPendingBinding);
if (NS_UNLIKELY(NS_FAILED(rv))) {
if (MOZ_UNLIKELY(NS_FAILED(rv))) {
// XXXbz any cleanup needed here?
return rv;
}
@@ -4640,7 +4641,7 @@ nsCSSFrameConstructor::FlushAccumulatedBlock(nsFrameConstructorState& aState,
nsIFrame* blockFrame =
NS_NewMathMLmathBlockFrame(mPresShell, blockContext,
NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT);
if (NS_UNLIKELY(!blockFrame))
if (MOZ_UNLIKELY(!blockFrame))
return NS_ERROR_OUT_OF_MEMORY;
InitAndRestoreFrame(aState, aContent, aParentFrame, nullptr, blockFrame);
@@ -10804,7 +10805,7 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
return NS_OK;
}
nsIFrame* newTextFrame = NS_NewTextFrame(aPresShell, newSC);
if (NS_UNLIKELY(!newTextFrame)) {
if (MOZ_UNLIKELY(!newTextFrame)) {
return NS_ERROR_OUT_OF_MEMORY;;
}
newTextFrame->Init(textContent, parentFrame, nullptr);
@@ -12219,7 +12220,7 @@ nsCSSFrameConstructor::PostRestyleEventCommon(Element* aElement,
nsChangeHint aMinChangeHint,
bool aForAnimation)
{
if (NS_UNLIKELY(mPresShell->IsDestroying())) {
if (MOZ_UNLIKELY(mPresShell->IsDestroying())) {
return;
}