commit a454ba58bb957727194f1c6edd6b6740e15665d2
parent 1080653f7536de83662b7d2e6a96ef6bd8704342
Author: Andrew McCreight <continuation@gmail.com>
Date: Wed, 8 Oct 2025 13:51:21 +0000
Bug 1992886 - Use nsTArray for locals in nsHTMLFramesetFrame::Reflow(). r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D267691
Diffstat:
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/layout/generic/nsFrameSetFrame.cpp b/layout/generic/nsFrameSetFrame.cpp
@@ -818,10 +818,10 @@ void nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
CalculateRowCol(aPresContext, width, colSpecs, mColSizes);
CalculateRowCol(aPresContext, height, rowSpecs, mRowSizes);
- UniquePtr<bool[]> verBordersVis; // vertical borders visibility
- UniquePtr<nscolor[]> verBorderColors;
- UniquePtr<bool[]> horBordersVis; // horizontal borders visibility
- UniquePtr<nscolor[]> horBorderColors;
+ nsTArray<bool> verBordersVis; // vertical borders visibility
+ nsTArray<nscolor> verBorderColors;
+ nsTArray<bool> horBordersVis; // horizontal borders visibility
+ nsTArray<nscolor> horBorderColors;
nscolor borderColor = GetBorderColor();
nsFrameborder frameborder = GetFrameBorder();
@@ -833,15 +833,15 @@ void nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
static_assert(NS_MAX_FRAMESET_SPEC_COUNT < UINT_MAX / sizeof(nscolor),
"Check for overflow");
- verBordersVis = MakeUnique<bool[]>(NumCols());
- verBorderColors = MakeUnique<nscolor[]>(NumCols());
+ verBordersVis.SetLength(NumCols());
+ verBorderColors.SetLength(NumCols());
for (int32_t verX = 0; verX < NumCols(); verX++) {
verBordersVis[verX] = false;
verBorderColors[verX] = NO_COLOR;
}
- horBordersVis = MakeUnique<bool[]>(NumRows());
- horBorderColors = MakeUnique<nscolor[]>(NumRows());
+ horBordersVis.SetLength(NumRows());
+ horBorderColors.SetLength(NumRows());
for (int32_t horX = 0; horX < NumRows(); horX++) {
horBordersVis[horX] = false;
horBorderColors[horX] = NO_COLOR;
diff --git a/layout/generic/nsFrameSetFrame.h b/layout/generic/nsFrameSetFrame.h
@@ -10,7 +10,6 @@
#define nsHTMLFrameset_h___
#include "mozilla/Attributes.h"
-#include "mozilla/UniquePtr.h"
#include "nsColor.h"
#include "nsContainerFrame.h"
#include "nsTArray.h"
@@ -170,9 +169,6 @@ class nsHTMLFramesetFrame final : public nsContainerFrame {
int32_t NumRows() const;
int32_t NumCols() const;
- template <typename T, class D = mozilla::DefaultDelete<T>>
- using UniquePtr = mozilla::UniquePtr<T, D>;
-
nsFramesetDrag mDrag;
nsBorderColor mEdgeColors;
nsHTMLFramesetBorderFrame* mDragger;