Backed out changeset 513192eb7df4 (bug 1148971) for causing bc2 memory leaks

This commit is contained in:
Carsten "Tomcat" Book
2015-03-30 15:04:09 +02:00
parent f50d80e156
commit 1dadb1db1d
15 changed files with 25 additions and 22 deletions

View File

@@ -12,9 +12,11 @@
#include "nsISupports.h"
#include "nsCOMPtr.h"
#include "nsColor.h"
#include "Units.h"
#include "nsSize.h"
struct nsRect;
struct nsIntRect;
class nsIntRegion;
struct nsFont;
struct nsIntMargin;
class nsPresContext;
@@ -114,7 +116,7 @@ public:
NS_IMETHOD GetMinimumWidgetSize(nsPresContext* aPresContext,
nsIFrame* aFrame,
uint8_t aWidgetType,
mozilla::LayoutDeviceIntSize* aResult,
nsIntSize* aResult,
bool* aIsOverridable)=0;

View File

@@ -4567,7 +4567,7 @@ nsLayoutUtils::IntrinsicForContainer(nsRenderingContext *aRenderingContext,
const nsStyleDisplay *disp = aFrame->StyleDisplay();
if (aFrame->IsThemed(disp)) {
LayoutDeviceIntSize size;
nsIntSize size(0, 0);
bool canOverride = true;
nsPresContext *presContext = aFrame->PresContext();
presContext->GetTheme()->

View File

@@ -517,7 +517,7 @@ nsRangeFrame::GetValueAtEventPoint(WidgetGUIEvent* aEvent)
// We need to get the size of the thumb from the theme.
nsPresContext *presContext = PresContext();
bool notUsedCanOverride;
LayoutDeviceIntSize size;
nsIntSize size;
presContext->GetTheme()->
GetMinimumWidgetSize(presContext, this, NS_THEME_RANGE_THUMB, &size,
&notUsedCanOverride);

View File

@@ -169,14 +169,14 @@ public:
nscoord GetMainComponent(const nsSize& aSize) const {
return GET_MAIN_COMPONENT(*this, aSize.width, aSize.height);
}
int32_t GetMainComponent(const LayoutDeviceIntSize& aIntSize) const {
int32_t GetMainComponent(const nsIntSize& aIntSize) const {
return GET_MAIN_COMPONENT(*this, aIntSize.width, aIntSize.height);
}
nscoord GetCrossComponent(const nsSize& aSize) const {
return GET_CROSS_COMPONENT(*this, aSize.width, aSize.height);
}
int32_t GetCrossComponent(const LayoutDeviceIntSize& aIntSize) const {
int32_t GetCrossComponent(const nsIntSize& aIntSize) const {
return GET_CROSS_COMPONENT(*this, aIntSize.width, aIntSize.height);
}
@@ -1045,7 +1045,7 @@ nsFlexContainerFrame::GenerateFlexItemForChild(
bool isFixedSizeWidget = false;
const nsStyleDisplay* disp = aChildFrame->StyleDisplay();
if (aChildFrame->IsThemed(disp)) {
LayoutDeviceIntSize widgetMinSize;
nsIntSize widgetMinSize(0, 0);
bool canOverride = true;
aPresContext->GetTheme()->
GetMinimumWidgetSize(aPresContext, aChildFrame,

View File

@@ -4295,7 +4295,7 @@ nsFrame::ComputeSize(nsRenderingContext *aRenderingContext,
const nsStyleDisplay *disp = StyleDisplay();
if (IsThemed(disp)) {
LayoutDeviceIntSize widget;
nsIntSize widget(0, 0);
bool canOverride = true;
nsPresContext *presContext = PresContext();
presContext->GetTheme()->

View File

@@ -1039,7 +1039,7 @@ ScrollFrameHelper::GetNondisappearingScrollbarWidth(nsBoxLayoutState* aState)
theme->ThemeSupportsWidget(aState->PresContext(),
mVScrollbarBox,
NS_THEME_SCROLLBAR_NON_DISAPPEARING)) {
LayoutDeviceIntSize size;
nsIntSize size;
bool canOverride = true;
theme->GetMinimumWidgetSize(aState->PresContext(),
mVScrollbarBox,

View File

@@ -681,7 +681,7 @@ nsIFrame::AddCSSMinSize(nsBoxLayoutState& aState, nsIFrame* aBox, nsSize& aSize,
if (display->mAppearance) {
nsITheme *theme = aState.PresContext()->GetTheme();
if (theme && theme->ThemeSupportsWidget(aState.PresContext(), aBox, display->mAppearance)) {
LayoutDeviceIntSize size;
nsIntSize size;
theme->GetMinimumWidgetSize(aState.PresContext(), aBox,
display->mAppearance, &size, &canOverride);
if (size.width) {

View File

@@ -175,7 +175,7 @@ nsScrollbarFrame::GetMargin(nsMargin& aMargin)
nsPresContext* presContext = PresContext();
nsITheme* theme = presContext->GetTheme();
if (theme) {
LayoutDeviceIntSize size;
nsIntSize size;
bool isOverridable;
theme->GetMinimumWidgetSize(presContext, this, NS_THEME_SCROLLBAR, &size,
&isOverridable);

View File

@@ -2087,7 +2087,7 @@ nsTreeBodyFrame::GetTwistyRect(int32_t aRowIndex,
}
if (useTheme) {
LayoutDeviceIntSize minTwistySizePx;
nsIntSize minTwistySizePx(0,0);
bool canOverride = true;
theme->GetMinimumWidgetSize(aPresContext, this, twistyDisplayData->mAppearance,
&minTwistySizePx, &canOverride);

View File

@@ -66,7 +66,7 @@ public:
NS_IMETHOD GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aFrame,
uint8_t aWidgetType,
mozilla::LayoutDeviceIntSize* aResult, bool* aIsOverridable) override;
nsIntSize* aResult, bool* aIsOverridable) override;
NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType,
nsIAtom* aAttribute, bool* aShouldRepaint) override;
NS_IMETHOD ThemeChanged() override;

View File

@@ -3163,7 +3163,7 @@ NS_IMETHODIMP
nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext,
nsIFrame* aFrame,
uint8_t aWidgetType,
LayoutDeviceIntSize* aResult,
nsIntSize* aResult,
bool* aIsOverridable)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;

View File

@@ -1065,8 +1065,7 @@ nsNativeThemeGTK::GetWidgetOverflow(nsDeviceContext* aContext,
NS_IMETHODIMP
nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
nsIFrame* aFrame, uint8_t aWidgetType,
LayoutDeviceIntSize* aResult,
bool* aIsOverridable)
nsIntSize* aResult, bool* aIsOverridable)
{
aResult->width = aResult->height = 0;
*aIsOverridable = true;

View File

@@ -45,7 +45,7 @@ public:
NS_IMETHOD GetMinimumWidgetSize(nsPresContext* aPresContext,
nsIFrame* aFrame, uint8_t aWidgetType,
mozilla::LayoutDeviceIntSize* aResult,
nsIntSize* aResult,
bool* aIsOverridable) override;
NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType,

View File

@@ -353,7 +353,7 @@ static CaptionButtonPadding buttonData[3] = {
// Adds "hot" caption button padding to minimum widget size.
static void
AddPaddingRect(LayoutDeviceIntSize* aSize, CaptionButton button) {
AddPaddingRect(nsIntSize* aSize, CaptionButton button) {
if (!aSize)
return;
RECT offset;
@@ -2254,7 +2254,7 @@ nsNativeThemeWin::GetWidgetOverflow(nsDeviceContext* aContext,
NS_IMETHODIMP
nsNativeThemeWin::GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aFrame,
uint8_t aWidgetType,
LayoutDeviceIntSize* aResult, bool* aIsOverridable)
nsIntSize* aResult, bool* aIsOverridable)
{
(*aResult).width = (*aResult).height = 0;
*aIsOverridable = true;
@@ -2918,7 +2918,7 @@ nsNativeThemeWin::ClassicGetWidgetPadding(nsDeviceContext* aContext,
nsresult
nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aFrame,
uint8_t aWidgetType,
LayoutDeviceIntSize* aResult, bool* aIsOverridable)
nsIntSize* aResult, bool* aIsOverridable)
{
(*aResult).width = (*aResult).height = 0;
*aIsOverridable = true;

View File

@@ -16,6 +16,8 @@
#include "mozilla/TimeStamp.h"
#include "nsSize.h"
struct nsIntRect;
class nsNativeThemeWin : private nsNativeTheme,
public nsITheme {
virtual ~nsNativeThemeWin();
@@ -50,7 +52,7 @@ public:
NS_IMETHOD GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aFrame,
uint8_t aWidgetType,
mozilla::LayoutDeviceIntSize* aResult,
nsIntSize* aResult,
bool* aIsOverridable);
virtual Transparency GetWidgetTransparency(nsIFrame* aFrame, uint8_t aWidgetType);
@@ -103,7 +105,7 @@ protected:
nsIntMargin* aResult);
nsresult ClassicGetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aFrame,
uint8_t aWidgetType,
mozilla::LayoutDeviceIntSize* aResult,
nsIntSize* aResult,
bool* aIsOverridable);
bool ClassicThemeSupportsWidget(nsPresContext* aPresContext,
nsIFrame* aFrame,