Bug 1295192 - part 2 - remove CPP_THROW_NEW from style struct type-safe operator new overloads; r=bholley

operator new overloads that declare that they don't throw exceptions
require a null check on their return value, per the C++ spec.  We know
that Servo isn't going to call these functions with null pointers, so
remove the CPP_THROW_NEW annotation and save ourselves some work.
This commit is contained in:
Nathan Froyd 2016-08-16 17:05:38 -04:00
Родитель fa4f709cfd
Коммит 880a5a466c
1 изменённых файлов: 24 добавлений и 24 удалений

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

@ -180,7 +180,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleFont
static nscoord UnZoomText(nsPresContext* aPresContext, nscoord aSize); static nscoord UnZoomText(nsPresContext* aPresContext, nscoord aSize);
static already_AddRefed<nsIAtom> GetLanguage(StyleStructContext aPresContext); static already_AddRefed<nsIAtom> GetLanguage(StyleStructContext aPresContext);
void* operator new(size_t sz, nsStyleFont* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleFont* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleFont, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleFont, sz);
@ -454,7 +454,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleColor
return nsChangeHint(0); return nsChangeHint(0);
} }
void* operator new(size_t sz, nsStyleColor* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleColor* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleColor, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleColor, sz);
@ -823,7 +823,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleBackground {
nsStyleBackground(const nsStyleBackground& aOther); nsStyleBackground(const nsStyleBackground& aOther);
~nsStyleBackground(); ~nsStyleBackground();
void* operator new(size_t sz, nsStyleBackground* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleBackground* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleBackground, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleBackground, sz);
@ -883,7 +883,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleMargin
MOZ_COUNT_DTOR(nsStyleMargin); MOZ_COUNT_DTOR(nsStyleMargin);
} }
void* operator new(size_t sz, nsStyleMargin* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleMargin* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleMargin, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleMargin, sz);
@ -930,7 +930,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStylePadding
MOZ_COUNT_DTOR(nsStylePadding); MOZ_COUNT_DTOR(nsStylePadding);
} }
void* operator new(size_t sz, nsStylePadding* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStylePadding* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStylePadding, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStylePadding, sz);
@ -1137,7 +1137,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleBorder
nsStyleBorder(const nsStyleBorder& aBorder); nsStyleBorder(const nsStyleBorder& aBorder);
~nsStyleBorder(); ~nsStyleBorder();
void* operator new(size_t sz, nsStyleBorder* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleBorder* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleBorder, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleBorder, sz);
@ -1370,7 +1370,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleOutline
MOZ_COUNT_DTOR(nsStyleOutline); MOZ_COUNT_DTOR(nsStyleOutline);
} }
void* operator new(size_t sz, nsStyleOutline* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleOutline* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleOutline, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleOutline, sz);
@ -1483,7 +1483,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleList
nsStyleList(const nsStyleList& aStyleList); nsStyleList(const nsStyleList& aStyleList);
~nsStyleList(); ~nsStyleList();
void* operator new(size_t sz, nsStyleList* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleList* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleList, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleList, sz);
@ -1710,7 +1710,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStylePosition
nsStylePosition(const nsStylePosition& aOther); nsStylePosition(const nsStylePosition& aOther);
~nsStylePosition(); ~nsStylePosition();
void* operator new(size_t sz, nsStylePosition* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStylePosition* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStylePosition, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStylePosition, sz);
@ -1961,7 +1961,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTextReset
nsStyleTextReset(const nsStyleTextReset& aOther); nsStyleTextReset(const nsStyleTextReset& aOther);
~nsStyleTextReset(); ~nsStyleTextReset();
void* operator new(size_t sz, nsStyleTextReset* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleTextReset* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleTextReset, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleTextReset, sz);
@ -2048,7 +2048,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleText
nsStyleText(const nsStyleText& aOther); nsStyleText(const nsStyleText& aOther);
~nsStyleText(); ~nsStyleText();
void* operator new(size_t sz, nsStyleText* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleText* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleText, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleText, sz);
@ -2269,7 +2269,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleVisibility
MOZ_COUNT_DTOR(nsStyleVisibility); MOZ_COUNT_DTOR(nsStyleVisibility);
} }
void* operator new(size_t sz, nsStyleVisibility* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleVisibility* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleVisibility, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleVisibility, sz);
@ -2786,7 +2786,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay
MOZ_COUNT_DTOR(nsStyleDisplay); MOZ_COUNT_DTOR(nsStyleDisplay);
} }
void* operator new(size_t sz, nsStyleDisplay* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleDisplay* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleDisplay, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleDisplay, sz);
@ -3064,7 +3064,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTable
nsStyleTable(const nsStyleTable& aOther); nsStyleTable(const nsStyleTable& aOther);
~nsStyleTable(); ~nsStyleTable();
void* operator new(size_t sz, nsStyleTable* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleTable* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleTable, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleTable, sz);
@ -3095,7 +3095,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTableBorder
nsStyleTableBorder(const nsStyleTableBorder& aOther); nsStyleTableBorder(const nsStyleTableBorder& aOther);
~nsStyleTableBorder(); ~nsStyleTableBorder();
void* operator new(size_t sz, nsStyleTableBorder* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleTableBorder* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleTableBorder, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleTableBorder, sz);
@ -3196,7 +3196,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleContent
nsStyleContent(const nsStyleContent& aContent); nsStyleContent(const nsStyleContent& aContent);
~nsStyleContent(); ~nsStyleContent();
void* operator new(size_t sz, nsStyleContent* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleContent* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleContent, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleContent, sz);
@ -3308,7 +3308,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUIReset
nsStyleUIReset(const nsStyleUIReset& aOther); nsStyleUIReset(const nsStyleUIReset& aOther);
~nsStyleUIReset(); ~nsStyleUIReset();
void* operator new(size_t sz, nsStyleUIReset* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleUIReset* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleUIReset, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleUIReset, sz);
@ -3377,7 +3377,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUserInterface
nsStyleUserInterface(const nsStyleUserInterface& aOther); nsStyleUserInterface(const nsStyleUserInterface& aOther);
~nsStyleUserInterface(); ~nsStyleUserInterface();
void* operator new(size_t sz, nsStyleUserInterface* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleUserInterface* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleUserInterface, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleUserInterface, sz);
@ -3429,7 +3429,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleXUL
nsStyleXUL(const nsStyleXUL& aSource); nsStyleXUL(const nsStyleXUL& aSource);
~nsStyleXUL(); ~nsStyleXUL();
void* operator new(size_t sz, nsStyleXUL* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleXUL* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleXUL, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleXUL, sz);
@ -3468,7 +3468,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleColumn
nsStyleColumn(const nsStyleColumn& aSource); nsStyleColumn(const nsStyleColumn& aSource);
~nsStyleColumn(); ~nsStyleColumn();
void* operator new(size_t sz, nsStyleColumn* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleColumn* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleColumn, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleColumn, sz);
@ -3566,7 +3566,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleSVG
nsStyleSVG(const nsStyleSVG& aSource); nsStyleSVG(const nsStyleSVG& aSource);
~nsStyleSVG(); ~nsStyleSVG();
void* operator new(size_t sz, nsStyleSVG* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleSVG* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleSVG, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleSVG, sz);
@ -3757,7 +3757,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleSVGReset
nsStyleSVGReset(const nsStyleSVGReset& aSource); nsStyleSVGReset(const nsStyleSVGReset& aSource);
~nsStyleSVGReset(); ~nsStyleSVGReset();
void* operator new(size_t sz, nsStyleSVGReset* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleSVGReset* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleSVGReset, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleSVGReset, sz);
@ -3808,7 +3808,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleVariables
nsStyleVariables(const nsStyleVariables& aSource); nsStyleVariables(const nsStyleVariables& aSource);
~nsStyleVariables(); ~nsStyleVariables();
void* operator new(size_t sz, nsStyleVariables* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleVariables* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleVariables, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleVariables, sz);
@ -3838,7 +3838,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleEffects
nsStyleEffects(const nsStyleEffects& aSource); nsStyleEffects(const nsStyleEffects& aSource);
~nsStyleEffects(); ~nsStyleEffects();
void* operator new(size_t sz, nsStyleEffects* aSelf) CPP_THROW_NEW { return aSelf; } void* operator new(size_t sz, nsStyleEffects* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) { void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()-> return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleEffects, sz); AllocateByObjectID(mozilla::eArenaObjectID_nsStyleEffects, sz);