Bug 1036052 - Privatize public destructor of DOMRect. r=baku

This commit is contained in:
Anuj Agarwal 2014-09-02 11:47:00 -04:00
parent d627e909c1
commit c197954a8c
3 changed files with 12 additions and 15 deletions

View File

@ -142,6 +142,9 @@ public:
protected:
double mX, mY, mWidth, mHeight;
private:
~DOMRect() {};
};
class DOMRectList MOZ_FINAL : public nsIDOMClientRectList,
@ -210,12 +213,6 @@ protected:
}
template<>
struct HasDangerousPublicDestructor<dom::DOMRect>
{
static const bool value = true;
};
}
#endif /*MOZILLA_DOMRECT_H_*/

View File

@ -16,9 +16,9 @@ ScrollAreaEvent::ScrollAreaEvent(EventTarget* aOwner,
nsPresContext* aPresContext,
InternalScrollAreaEvent* aEvent)
: UIEvent(aOwner, aPresContext, aEvent)
, mClientArea(nullptr)
, mClientArea(new DOMRect(nullptr))
{
mClientArea.SetLayoutRect(aEvent ? aEvent->mArea : nsRect());
mClientArea->SetLayoutRect(aEvent ? aEvent->mArea : nsRect());
}
NS_IMPL_ADDREF_INHERITED(ScrollAreaEvent, UIEvent)
@ -57,7 +57,7 @@ ScrollAreaEvent::InitScrollAreaEvent(const nsAString& aEventType,
UIEvent::InitUIEvent(aEventType, aCanBubble, aCancelable, aView, aDetail);
NS_ENSURE_SUCCESS(rv, rv);
mClientArea.SetRect(aX, aY, aWidth, aHeight);
mClientArea->SetRect(aX, aY, aWidth, aHeight);
return NS_OK;
}
@ -88,7 +88,7 @@ ScrollAreaEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &y), false);
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &width), false);
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &height), false);
mClientArea.SetRect(x, y, width, height);
mClientArea->SetRect(x, y, width, height);
return true;
}

View File

@ -45,22 +45,22 @@ public:
float X() const
{
return mClientArea.Left();
return mClientArea->Left();
}
float Y() const
{
return mClientArea.Top();
return mClientArea->Top();
}
float Width() const
{
return mClientArea.Width();
return mClientArea->Width();
}
float Height() const
{
return mClientArea.Height();
return mClientArea->Height();
}
void InitScrollAreaEvent(const nsAString& aType,
@ -79,7 +79,7 @@ public:
protected:
~ScrollAreaEvent() {}
DOMRect mClientArea;
nsRefPtr<DOMRect> mClientArea;
};
} // namespace dom