Skip to content

Commit

Permalink
Backed out 4 changesets (bug 1295192) for being a possible cause of c…
Browse files Browse the repository at this point in the history
…rashtest assertions CLOSED TREE

Backed out changeset 7f10779fe019 (bug 1295192)
Backed out changeset e683dce4197a (bug 1295192)
Backed out changeset 67d12eaa8074 (bug 1295192)
Backed out changeset 44f143a01f78 (bug 1295192)
  • Loading branch information
KWierso committed Aug 16, 2016
1 parent 6478db3 commit 57773cd
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 81 deletions.
8 changes: 3 additions & 5 deletions layout/base/nsDisplayList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
#include "mozilla/EffectCompositor.h"
#include "mozilla/EventStates.h"
#include "mozilla/LookAndFeel.h"
#include "mozilla/OperatorNewExtensions.h"
#include "mozilla/PendingAnimationTracker.h"
#include "mozilla/Preferences.h"
#include "mozilla/UniquePtr.h"
Expand Down Expand Up @@ -110,7 +109,7 @@ SpammyLayoutWarningsEnabled()
#endif

void*
AnimatedGeometryRoot::operator new(size_t aSize, nsDisplayListBuilder* aBuilder)
AnimatedGeometryRoot::operator new(size_t aSize, nsDisplayListBuilder* aBuilder) CPP_THROW_NEW
{
return aBuilder->Allocate(aSize);
}
Expand Down Expand Up @@ -1109,7 +1108,7 @@ nsDisplayListBuilder::AllocateDisplayItemClip(const DisplayItemClip& aOriginal)
return static_cast<DisplayItemClip*>(p);
}

DisplayItemClip* c = new (KnownNotNull, p) DisplayItemClip(aOriginal);
DisplayItemClip* c = new (p) DisplayItemClip(aOriginal);
mDisplayItemClipsToDestroy.AppendElement(c);
return c;
}
Expand All @@ -1122,8 +1121,7 @@ nsDisplayListBuilder::AllocateDisplayItemScrollClip(const DisplayItemScrollClip*
{
void* p = Allocate(sizeof(DisplayItemScrollClip));
DisplayItemScrollClip* c =
new (KnownNotNull, p) DisplayItemScrollClip(aParent, aScrollableFrame,
aClip, aIsAsyncScrollable);
new (p) DisplayItemScrollClip(aParent, aScrollableFrame, aClip, aIsAsyncScrollable);
mScrollClipsToDestroy.AppendElement(c);
return c;
}
Expand Down
4 changes: 2 additions & 2 deletions layout/base/nsDisplayList.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ struct AnimatedGeometryRoot
nsIFrame* operator ->() const { return mFrame; }

void* operator new(size_t aSize,
nsDisplayListBuilder* aBuilder);
nsDisplayListBuilder* aBuilder) CPP_THROW_NEW;

nsIFrame* mFrame;
AnimatedGeometryRoot* mParentAGR;
Expand Down Expand Up @@ -1357,7 +1357,7 @@ class nsDisplayItem : public nsDisplayItemLink {
virtual ~nsDisplayItem() {}

void* operator new(size_t aSize,
nsDisplayListBuilder* aBuilder) {
nsDisplayListBuilder* aBuilder) CPP_THROW_NEW {
return aBuilder->Allocate(aSize);
}

Expand Down
2 changes: 1 addition & 1 deletion layout/generic/nsFrameList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const AlignedFrameListBytes gEmptyFrameListBytes = { 0 };
} // namespace mozilla

void*
nsFrameList::operator new(size_t sz, nsIPresShell* aPresShell)
nsFrameList::operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW
{
return aPresShell->AllocateByObjectID(eArenaObjectID_nsFrameList, sz);
}
Expand Down
2 changes: 1 addition & 1 deletion layout/generic/nsFrameList.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class nsFrameList {
/**
* Infallibly allocate a nsFrameList from the shell arena.
*/
void* operator new(size_t sz, nsIPresShell* aPresShell);
void* operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW;

/**
* Deallocate this list that was allocated from the shell arena.
Expand Down
2 changes: 1 addition & 1 deletion layout/generic/nsLineBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ nsLineBox::NoteFramesMovedFrom(nsLineBox* aFromLine)
}

void*
nsLineBox::operator new(size_t sz, nsIPresShell* aPresShell)
nsLineBox::operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW
{
return aPresShell->AllocateByObjectID(eArenaObjectID_nsLineBox, sz);
}
Expand Down
2 changes: 1 addition & 1 deletion layout/generic/nsLineBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class nsLineBox final : public nsLineLink {

// Infallible overloaded new operator. Uses an arena (which comes from the
// presShell) to perform the allocation.
void* operator new(size_t sz, nsIPresShell* aPresShell);
void* operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW;
void operator delete(void* aPtr, size_t sz) = delete;

public:
Expand Down
4 changes: 2 additions & 2 deletions layout/style/CounterStyleManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ class DependentBuiltinCounterStyle final : public BuiltinCounterStyle
NS_IMETHOD_(MozExternalRefCountType) AddRef() override;
NS_IMETHOD_(MozExternalRefCountType) Release() override;

void* operator new(size_t sz, nsPresContext* aPresContext)
void* operator new(size_t sz, nsPresContext* aPresContext) CPP_THROW_NEW
{
return aPresContext->PresShell()->AllocateByObjectID(
eArenaObjectID_DependentBuiltinCounterStyle, sz);
Expand Down Expand Up @@ -1101,7 +1101,7 @@ class CustomCounterStyle final : public CounterStyle
NS_IMETHOD_(MozExternalRefCountType) AddRef() override;
NS_IMETHOD_(MozExternalRefCountType) Release() override;

void* operator new(size_t sz, nsPresContext* aPresContext)
void* operator new(size_t sz, nsPresContext* aPresContext) CPP_THROW_NEW
{
return aPresContext->PresShell()->AllocateByObjectID(
eArenaObjectID_CustomCounterStyle, sz);
Expand Down
15 changes: 7 additions & 8 deletions layout/style/nsCSSRuleProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
#include "mozilla/Preferences.h"
#include "mozilla/LookAndFeel.h"
#include "mozilla/Likely.h"
#include "mozilla/OperatorNewExtensions.h"
#include "mozilla/TypedEnumBits.h"
#include "RuleProcessorCache.h"
#include "nsIDOMMutationEvent.h"
Expand Down Expand Up @@ -261,7 +260,7 @@ static void
RuleHash_InitEntry(PLDHashEntryHdr *hdr, const void *key)
{
RuleHashTableEntry* entry = static_cast<RuleHashTableEntry*>(hdr);
new (KnownNotNull, entry) RuleHashTableEntry();
new (entry) RuleHashTableEntry();
}

static void
Expand All @@ -279,7 +278,7 @@ RuleHash_MoveEntry(PLDHashTable *table, const PLDHashEntryHdr *from,
RuleHashTableEntry *oldEntry =
const_cast<RuleHashTableEntry*>(
static_cast<const RuleHashTableEntry*>(from));
RuleHashTableEntry *newEntry = new (KnownNotNull, to) RuleHashTableEntry();
RuleHashTableEntry *newEntry = new (to) RuleHashTableEntry();
newEntry->mRules.SwapElements(oldEntry->mRules);
oldEntry->~RuleHashTableEntry();
}
Expand All @@ -297,7 +296,7 @@ static void
RuleHash_TagTable_InitEntry(PLDHashEntryHdr *hdr, const void *key)
{
RuleHashTagTableEntry* entry = static_cast<RuleHashTagTableEntry*>(hdr);
new (KnownNotNull, entry) RuleHashTagTableEntry();
new (entry) RuleHashTagTableEntry();
entry->mTag = const_cast<nsIAtom*>(static_cast<const nsIAtom*>(key));
}

Expand All @@ -316,7 +315,7 @@ RuleHash_TagTable_MoveEntry(PLDHashTable *table, const PLDHashEntryHdr *from,
RuleHashTagTableEntry *oldEntry =
const_cast<RuleHashTagTableEntry*>(
static_cast<const RuleHashTagTableEntry*>(from));
RuleHashTagTableEntry *newEntry = new (KnownNotNull, to) RuleHashTagTableEntry();
RuleHashTagTableEntry *newEntry = new (to) RuleHashTagTableEntry();
newEntry->mTag.swap(oldEntry->mTag);
newEntry->mRules.SwapElements(oldEntry->mRules);
oldEntry->~RuleHashTagTableEntry();
Expand Down Expand Up @@ -795,7 +794,7 @@ static void
AtomSelector_InitEntry(PLDHashEntryHdr *hdr, const void *key)
{
AtomSelectorEntry *entry = static_cast<AtomSelectorEntry*>(hdr);
new (KnownNotNull, entry) AtomSelectorEntry();
new (entry) AtomSelectorEntry();
entry->mAtom = const_cast<nsIAtom*>(static_cast<const nsIAtom*>(key));
}

Expand All @@ -806,7 +805,7 @@ AtomSelector_MoveEntry(PLDHashTable *table, const PLDHashEntryHdr *from,
NS_PRECONDITION(from != to, "This is not going to work!");
AtomSelectorEntry *oldEntry =
const_cast<AtomSelectorEntry*>(static_cast<const AtomSelectorEntry*>(from));
AtomSelectorEntry *newEntry = new (KnownNotNull, to) AtomSelectorEntry();
AtomSelectorEntry *newEntry = new (to) AtomSelectorEntry();
newEntry->mAtom = oldEntry->mAtom;
newEntry->mSelectors.SwapElements(oldEntry->mSelectors);
oldEntry->~AtomSelectorEntry();
Expand Down Expand Up @@ -3481,7 +3480,7 @@ static void
InitWeightEntry(PLDHashEntryHdr *hdr, const void *key)
{
RuleByWeightEntry* entry = static_cast<RuleByWeightEntry*>(hdr);
new (KnownNotNull, entry) RuleByWeightEntry();
new (entry) RuleByWeightEntry();
}

static const PLDHashTableOps gRulesByWeightOps = {
Expand Down
3 changes: 1 addition & 2 deletions layout/style/nsHTMLStyleSheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "mozilla/MemoryReporting.h"
#include "mozilla/dom/Element.h"
#include "nsHashKeys.h"
#include "mozilla/OperatorNewExtensions.h"
#include "mozilla/RestyleManagerHandle.h"
#include "mozilla/RestyleManagerHandleInlines.h"

Expand Down Expand Up @@ -237,7 +236,7 @@ LangRuleTable_InitEntry(PLDHashEntryHdr *hdr, const void *key)
{
const nsString *lang = static_cast<const nsString*>(key);

LangRuleTableEntry *entry = new (KnownNotNull, hdr) LangRuleTableEntry();
LangRuleTableEntry *entry = new (hdr) LangRuleTableEntry();

// Create the unique rule for this language
entry->mRule = new nsHTMLStyleSheet::LangRule(*lang);
Expand Down
5 changes: 2 additions & 3 deletions layout/style/nsRuleNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "mozilla/dom/AnimationEffectReadOnlyBinding.h" // for PlaybackDirection
#include "mozilla/Likely.h"
#include "mozilla/LookAndFeel.h"
#include "mozilla/OperatorNewExtensions.h"
#include "mozilla/unused.h"

#include "mozilla/css/Declaration.h"
Expand Down Expand Up @@ -1521,7 +1520,7 @@ SetFactor(const nsCSSValue& aValue, float& aField, RuleNodeCacheConditions& aCon
}

void*
nsRuleNode::operator new(size_t sz, nsPresContext* aPresContext)
nsRuleNode::operator new(size_t sz, nsPresContext* aPresContext) CPP_THROW_NEW
{
// Check the recycle list first.
return aPresContext->PresShell()->AllocateByObjectID(eArenaObjectID_nsRuleNode, sz);
Expand Down Expand Up @@ -2236,7 +2235,7 @@ struct AutoCSSValueArray {
// for the count (on Windows!).
mArray = static_cast<nsCSSValue*>(aStorage);
for (size_t i = 0; i < mCount; ++i) {
new (KnownNotNull, mArray + i) nsCSSValue();
new (mArray + i) nsCSSValue();
}
}

Expand Down
10 changes: 5 additions & 5 deletions layout/style/nsRuleNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct nsInheritedStyleData
nsStyleStructID_Inherited_Start,
nsStyleStructID_Inherited_Count> mStyleStructs;

void* operator new(size_t sz, nsPresContext* aContext) {
void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW {
return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsInheritedStyleData, sz);
}
Expand Down Expand Up @@ -84,7 +84,7 @@ struct nsResetStyleData
}
}

void* operator new(size_t sz, nsPresContext* aContext) {
void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW {
return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsResetStyleData, sz);
}
Expand Down Expand Up @@ -119,7 +119,7 @@ struct nsConditionalResetStyleData
Entry* aNext)
: mConditions(aConditions), mStyleStruct(aStyleStruct), mNext(aNext) {}

void* operator new(size_t sz, nsPresContext* aContext) {
void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW {
return aContext->PresShell()->AllocateByObjectID(
mozilla::eArenaObjectID_nsConditionalResetStyleDataEntry, sz);
}
Expand Down Expand Up @@ -148,7 +148,7 @@ struct nsConditionalResetStyleData
mConditionalBits = 0;
}

void* operator new(size_t sz, nsPresContext* aContext) {
void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW {
return aContext->PresShell()->AllocateByObjectID(
mozilla::eArenaObjectID_nsConditionalResetStyleData, sz);
}
Expand Down Expand Up @@ -550,7 +550,7 @@ class nsRuleNode : public mozilla::LinkedListElement<nsRuleNode> {

public:
// Infallible overloaded new operator that allocates from a presShell arena.
void* operator new(size_t sz, nsPresContext* aContext);
void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW;
void Destroy();

// Implemented in nsStyleSet.h, since it needs to know about nsStyleSet.
Expand Down
2 changes: 1 addition & 1 deletion layout/style/nsStyleContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ void nsStyleContext::List(FILE* out, int32_t aIndent, bool aListDescendants)
// Overloaded new operator. Initializes the memory to 0 and relies on an arena
// (which comes from the presShell) to perform the allocation.
void*
nsStyleContext::operator new(size_t sz, nsPresContext* aPresContext)
nsStyleContext::operator new(size_t sz, nsPresContext* aPresContext) CPP_THROW_NEW
{
// Check the recycle list first.
return aPresContext->PresShell()->
Expand Down
2 changes: 1 addition & 1 deletion layout/style/nsStyleContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class nsStyleContext final
already_AddRefed<ServoComputedValues> aComputedValues,
bool aSkipParentDisplayBasedStyleFixup);

void* operator new(size_t sz, nsPresContext* aPresContext);
void* operator new(size_t sz, nsPresContext* aPresContext) CPP_THROW_NEW;
void Destroy();

// These two methods are for use by ArenaRefPtr.
Expand Down
Loading

0 comments on commit 57773cd

Please sign in to comment.