Bug 1436505. r=mats, a=abillings

--HG--
extra : rebase_source : 9f91c91eb1061577148e1880dc4dc5655f7b099a
This commit is contained in:
Matt Woodrow 2018-05-28 12:42:54 +12:00
Родитель f72f5fc596
Коммит 636753b307
3 изменённых файлов: 10 добавлений и 4 удалений

Просмотреть файл

@ -1617,15 +1617,15 @@ protected:
bool DetermineFontSizeInflationState();
void RecordAlloc(void* aPtr) {
#ifdef DEBUG
MOZ_ASSERT(!mAllocatedPointers.Contains(aPtr));
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
MOZ_DIAGNOSTIC_ASSERT(!mAllocatedPointers.Contains(aPtr));
mAllocatedPointers.PutEntry(aPtr);
#endif
}
void RecordFree(void* aPtr) {
#ifdef DEBUG
MOZ_ASSERT(mAllocatedPointers.Contains(aPtr));
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
MOZ_DIAGNOSTIC_ASSERT(mAllocatedPointers.Contains(aPtr));
mAllocatedPointers.RemoveEntry(aPtr);
#endif
}
@ -1717,7 +1717,9 @@ protected:
#ifdef DEBUG
nsIFrame* mDrawEventTargetFrame;
#endif
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
// We track allocated pointers in a debug-only hashtable to assert against
// missing/double frees.
nsTHashtable<nsPtrHashKey<void>> mAllocatedPointers;

Просмотреть файл

@ -612,6 +612,7 @@ nsFrame::Init(nsIContent* aContent,
mContent = aContent;
mParent = aParent;
MOZ_DIAGNOSTIC_ASSERT(!mParent || PresShell() == mParent->PresShell());
if (aPrevInFlow) {
mWritingMode = aPrevInFlow->GetWritingMode();
@ -10914,6 +10915,7 @@ nsIFrame::SetParent(nsContainerFrame* aParent)
// Note that the current mParent may already be destroyed at this point.
mParent = aParent;
MOZ_DIAGNOSTIC_ASSERT(!mParent || PresShell() == mParent->PresShell());
if (::IsXULBoxWrapped(this)) {
::InitBoxMetrics(this, true);
} else {

Просмотреть файл

@ -780,6 +780,7 @@ public:
void SetComputedStyle(ComputedStyle* aStyle)
{
if (aStyle != mComputedStyle) {
MOZ_DIAGNOSTIC_ASSERT(PresShell() == aStyle->PresContextForFrame()->PresShell());
RefPtr<ComputedStyle> oldComputedStyle = mComputedStyle.forget();
mComputedStyle = aStyle;
DidSetComputedStyle(oldComputedStyle);
@ -795,6 +796,7 @@ public:
void SetComputedStyleWithoutNotification(ComputedStyle* aStyle)
{
if (aStyle != mComputedStyle) {
MOZ_DIAGNOSTIC_ASSERT(PresShell() == aStyle->PresContextForFrame()->PresShell());
mComputedStyle = aStyle;
}
}