Bug 1307728 - use LineReflowStatusToString to support debugging. r=mats
This is a pre-patch that uses LineReflowStatusToString() function instead of LineReflowStatusNames array to support debugging. With this patch, we could easily regain debugging support from LineReflowStatusToString() while converting LineReflowStatus to an enum class. MozReview-Commit-ID: K2AzZ2zI69p
This commit is contained in:
@@ -228,6 +228,24 @@ const char* nsBlockFrame::kReflowCommandType[] = {
|
|||||||
"Timeout",
|
"Timeout",
|
||||||
"UserDefined",
|
"UserDefined",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const char*
|
||||||
|
nsBlockFrame::LineReflowStatusToString(uint8_t aLineReflowStatus) const
|
||||||
|
{
|
||||||
|
switch (aLineReflowStatus) {
|
||||||
|
case LINE_REFLOW_OK: return "LINE_REFLOW_OK";
|
||||||
|
case LINE_REFLOW_STOP: return "LINE_REFLOW_STOP";
|
||||||
|
case LINE_REFLOW_REDO_NO_PULL: return "LINE_REFLOW_REDO_NO_PULL";
|
||||||
|
case LINE_REFLOW_REDO_MORE_FLOATS: return "LINE_REFLOW_REDO_MORE_FLOATS";
|
||||||
|
case LINE_REFLOW_REDO_NEXT_BAND: return "LINE_REFLOW_REDO_NEXT_BAND";
|
||||||
|
case LINE_REFLOW_TRUNCATED: return "LINE_REFLOW_TRUNCATED";
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
MOZ_ASSERT_UNREACHABLE("Unknown LineReflowStatus!!");
|
||||||
|
return "unknown";
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef REFLOW_STATUS_COVERAGE
|
#ifdef REFLOW_STATUS_COVERAGE
|
||||||
@@ -3800,14 +3818,6 @@ nsBlockFrame::PushTruncatedLine(BlockReflowInput& aState,
|
|||||||
NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
|
NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
static const char* LineReflowStatusNames[] = {
|
|
||||||
"LINE_REFLOW_OK", "LINE_REFLOW_STOP", "LINE_REFLOW_REDO_NO_PULL",
|
|
||||||
"LINE_REFLOW_REDO_MORE_FLOATS",
|
|
||||||
"LINE_REFLOW_REDO_NEXT_BAND", "LINE_REFLOW_TRUNCATED"
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
nsBlockFrame::DoReflowInlineFrames(BlockReflowInput& aState,
|
nsBlockFrame::DoReflowInlineFrames(BlockReflowInput& aState,
|
||||||
nsLineLayout& aLineLayout,
|
nsLineLayout& aLineLayout,
|
||||||
@@ -4028,7 +4038,7 @@ nsBlockFrame::DoReflowInlineFrames(BlockReflowInput& aState,
|
|||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (gNoisyReflow) {
|
if (gNoisyReflow) {
|
||||||
printf("Line reflow status = %s\n", LineReflowStatusNames[lineReflowStatus]);
|
printf("Line reflow status = %s\n", LineReflowStatusToString(lineReflowStatus));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ public:
|
|||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
virtual nsFrameState GetDebugStateBits() const override;
|
virtual nsFrameState GetDebugStateBits() const override;
|
||||||
|
const char* LineReflowStatusToString(uint8_t aLineReflowStatus) const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ACCESSIBILITY
|
#ifdef ACCESSIBILITY
|
||||||
|
|||||||
Reference in New Issue
Block a user