Bug 1028588 - Fix dangerous public destructors in layout/ - r=dbaron

This commit is contained in:
Benoit Jacob 2014-06-23 18:40:01 -04:00
parent 6ac5263924
commit 0c5dc76161
69 changed files with 235 additions and 82 deletions

View File

@ -57,7 +57,6 @@ public:
};
explicit SelectionCarets(nsIPresShell *aPresShell);
virtual ~SelectionCarets();
NS_DECL_ISUPPORTS
NS_DECL_NSISELECTIONLISTENER
@ -92,6 +91,8 @@ public:
}
private:
virtual ~SelectionCarets();
SelectionCarets() MOZ_DELETE;
/**

View File

@ -26,9 +26,11 @@ namespace mozilla {
*/
class TouchCaret MOZ_FINAL : public nsISelectionListener
{
private:
~TouchCaret();
public:
explicit TouchCaret(nsIPresShell* aPresShell);
~TouchCaret();
NS_DECL_ISUPPORTS
NS_DECL_NSISELECTIONLISTENER

View File

@ -23,18 +23,18 @@ class nsITimer;
class nsCaret : public nsISelectionListener
{
public:
nsCaret();
nsCaret();
virtual ~nsCaret();
protected:
virtual ~nsCaret();
public:
enum EViewCoordinates {
eTopLevelWindowCoordinates,
eRenderingViewCoordinates,
eClosestViewCoordinates
};
public:
NS_DECL_ISUPPORTS
nsresult Init(nsIPresShell *inPresShell);

View File

@ -180,12 +180,12 @@ public:
{
}
virtual ~nsDocViewerSelectionListener() {}
nsresult Init(nsDocumentViewer *aDocViewer);
protected:
virtual ~nsDocViewerSelectionListener() {}
nsDocumentViewer* mDocViewer;
bool mGotSelectionState;
bool mSelectionWasCollapsed;
@ -201,15 +201,17 @@ public:
/** default constructor
*/
nsDocViewerFocusListener();
/** default destructor
*/
virtual ~nsDocViewerFocusListener();
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMEVENTLISTENER
nsresult Init(nsDocumentViewer *aDocViewer);
protected:
/** default destructor
*/
virtual ~nsDocViewerFocusListener();
private:
nsDocumentViewer* mDocViewer;
};

View File

@ -18,8 +18,6 @@ public:
NS_DECL_ISUPPORTS
virtual ~nsFrameIterator() {}
virtual void First() MOZ_OVERRIDE;
virtual void Next() MOZ_OVERRIDE;
virtual nsIFrame* CurrentItem() MOZ_OVERRIDE;
@ -32,6 +30,8 @@ public:
nsIteratorType aType, bool aLockScroll, bool aFollowOOFs);
protected:
virtual ~nsFrameIterator() {}
void setCurrent(nsIFrame *aFrame){mCurrent = aFrame;}
nsIFrame *getCurrent(){return mCurrent;}
nsIFrame *getStart(){return mStart;}

View File

@ -24,7 +24,6 @@ class nsFrameTraversal : public nsIFrameTraversal
{
public:
nsFrameTraversal();
virtual ~nsFrameTraversal();
NS_DECL_ISUPPORTS
@ -35,6 +34,9 @@ public:
bool aVisual,
bool aLockInScrollView,
bool aFollowOOFs) MOZ_OVERRIDE;
protected:
virtual ~nsFrameTraversal();
};
#endif //NSFRAMETRAVERSAL_H

View File

@ -23,7 +23,6 @@ using namespace mozilla::layers;
class nsLayoutDebugger : public nsILayoutDebugger {
public:
nsLayoutDebugger();
virtual ~nsLayoutDebugger();
NS_DECL_ISUPPORTS
@ -44,6 +43,8 @@ public:
NS_IMETHOD GetStyleSize(nsIPresShell* aPresentation,
int32_t* aSizeInBytesResult) MOZ_OVERRIDE;
protected:
virtual ~nsLayoutDebugger();
};
nsresult

View File

@ -3737,6 +3737,8 @@ public:
}
private:
~PaintTimerCallBack() {}
PresShell* mShell;
};

View File

@ -33,7 +33,6 @@ class nsStyleSheetService MOZ_FINAL
{
public:
nsStyleSheetService();
~nsStyleSheetService();
NS_DECL_ISUPPORTS
NS_DECL_NSISTYLESHEETSERVICE
@ -51,6 +50,7 @@ class nsStyleSheetService MOZ_FINAL
static nsStyleSheetService *gInstance;
private:
~nsStyleSheetService();
void RegisterFromEnumerator(nsICategoryManager *aManager,
const char *aCategory,

View File

@ -21,9 +21,11 @@ class nsIStreamListener;
class nsContentDLF : public nsIDocumentLoaderFactory
{
protected:
virtual ~nsContentDLF();
public:
nsContentDLF();
virtual ~nsContentDLF();
NS_DECL_ISUPPORTS
NS_DECL_NSIDOCUMENTLOADERFACTORY

View File

@ -74,6 +74,9 @@ class nsPresState;
*/
class nsComboButtonListener : public nsIDOMEventListener
{
private:
virtual ~nsComboButtonListener() {}
public:
NS_DECL_ISUPPORTS
@ -88,8 +91,6 @@ public:
mComboBox = aCombobox;
}
virtual ~nsComboButtonListener() {}
nsComboboxControlFrame* mComboBox;
};

View File

@ -77,13 +77,14 @@ protected:
MouseListener(nsFileControlFrame* aFrame)
: mFrame(aFrame)
{}
virtual ~MouseListener() {}
void ForgetFrame() {
mFrame = nullptr;
}
protected:
virtual ~MouseListener() {}
nsFileControlFrame* mFrame;
};

View File

@ -71,6 +71,8 @@ public:
NS_DECL_NSIDOMEVENTLISTENER
private:
~nsListEventListener() {}
nsListControlFrame *mFrame;
};

View File

@ -77,8 +77,6 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMEVENTLISTENER
virtual ~ScrollbarActivity() {}
void Destroy();
void ActivityOccurred();
@ -94,6 +92,7 @@ public:
}
protected:
virtual ~ScrollbarActivity() {}
bool IsActivityOngoing()
{ return mNestedActivityCounter > 0; }

View File

@ -50,10 +50,12 @@ class Selection : public nsISelectionPrivate,
public nsWrapperCache,
public nsSupportsWeakReference
{
protected:
virtual ~Selection();
public:
Selection();
Selection(nsFrameSelection *aList);
virtual ~Selection();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Selection, nsISelectionPrivate)

View File

@ -39,6 +39,8 @@ public:
}
private:
~nsAutoCopyListener() {}
static nsAutoCopyListener* sInstance;
};

View File

@ -22,7 +22,6 @@ class nsBulletListener : public imgINotificationObserver
{
public:
nsBulletListener();
virtual ~nsBulletListener();
NS_DECL_ISUPPORTS
NS_DECL_IMGINOTIFICATIONOBSERVER
@ -30,6 +29,8 @@ public:
void SetFrame(nsBulletFrame *frame) { mFrame = frame; }
private:
virtual ~nsBulletListener();
nsBulletFrame *mFrame;
};

View File

@ -593,7 +593,10 @@ public:
nsresult ClearNormalSelection();
static HINT GetHintForPosition(nsIContent* aContent, int32_t aOffset);
private:
~nsFrameSelection() {}
nsresult TakeFocus(nsIContent *aNewFocus,
uint32_t aContentOffset,
uint32_t aContentEndOffset,

View File

@ -15,9 +15,11 @@
#ifdef DEBUG
class nsFrameUtil : public nsIFrameUtil {
protected:
virtual ~nsFrameUtil();
public:
nsFrameUtil();
virtual ~nsFrameUtil();
NS_DECL_ISUPPORTS

View File

@ -41,9 +41,11 @@ namespace layers {
class nsImageListener : public imgINotificationObserver
{
protected:
virtual ~nsImageListener();
public:
nsImageListener(nsImageFrame *aFrame);
virtual ~nsImageListener();
NS_DECL_ISUPPORTS
NS_DECL_IMGINOTIFICATIONOBSERVER
@ -331,6 +333,8 @@ private:
}
private:
~IconLoad() {}
void GetPrefs();
nsTObserverArray<nsImageFrame*> mIconObservers;

View File

@ -147,12 +147,6 @@ public:
{
}
virtual ~nsAutoScrollTimer()
{
if (mTimer)
mTimer->Cancel();
}
// aPoint is relative to aPresContext's root frame
nsresult Start(nsPresContext *aPresContext, nsPoint &aPoint)
{
@ -222,6 +216,15 @@ public:
}
return NS_OK;
}
protected:
virtual ~nsAutoScrollTimer()
{
if (mTimer) {
mTimer->Cancel();
}
}
private:
nsFrameSelection *mFrameSelection;
Selection* mSelection;

View File

@ -27,9 +27,9 @@ public:
NS_DECL_INICSSVALUESEARCH
inCSSValueSearch();
virtual ~inCSSValueSearch();
protected:
virtual ~inCSSValueSearch();
nsCOMPtr<inISearchObserver> mObserver;
nsCOMPtr<nsIDOMDocument> mDocument;
nsTArray<nsAutoString *>* mResults;

View File

@ -24,9 +24,10 @@ public:
NS_DECL_INIDOMUTILS
inDOMUtils();
virtual ~inDOMUtils();
private:
virtual ~inDOMUtils();
// aStyleContext must be released by the caller once he's done with aRuleNode.
static nsresult GetRuleNodeForElement(mozilla::dom::Element* aElement,
nsIAtom* aPseudo,

View File

@ -30,7 +30,6 @@ public:
NS_DECL_NSITREEVIEW
inDOMView();
virtual ~inDOMView();
// nsIMutationObserver
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
@ -40,6 +39,8 @@ public:
NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED
protected:
virtual ~inDOMView();
nsCOMPtr<nsITreeBoxObject> mTree;
nsCOMPtr<nsITreeSelection> mSelection;
nsCOMPtr<inIDOMUtils> mDOMUtils;

View File

@ -32,9 +32,10 @@ public:
NS_DECL_INIDEEPTREEWALKER
inDeepTreeWalker();
virtual ~inDeepTreeWalker();
protected:
virtual ~inDeepTreeWalker();
void PushNode(nsIDOMNode* aNode);
bool mShowAnonymousContent;

View File

@ -24,9 +24,10 @@ public:
NS_DECL_INIFLASHER
inFlasher();
virtual ~inFlasher();
protected:
virtual ~inFlasher();
void DrawOutline(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight,
nsRenderingContext* aRenderContext,
bool aDrawBegin, bool aDrawEnd);

View File

@ -21,7 +21,6 @@ public:
nsFontFace(gfxFontEntry* aFontEntry,
gfxFontGroup* aFontGroup,
uint8_t aMatchInfo);
virtual ~nsFontFace();
gfxFontEntry* GetFontEntry() const { return mFontEntry.get(); }
@ -30,6 +29,8 @@ public:
}
protected:
virtual ~nsFontFace();
nsRefPtr<gfxFontEntry> mFontEntry;
nsRefPtr<gfxFontGroup> mFontGroup;
uint8_t mMatchType;

View File

@ -21,12 +21,13 @@ public:
NS_DECL_NSIDOMFONTFACELIST
nsFontFaceList();
virtual ~nsFontFaceList();
nsresult AddFontsFromTextRun(gfxTextRun* aTextRun,
uint32_t aOffset, uint32_t aLength);
protected:
virtual ~nsFontFaceList();
nsInterfaceHashtable<nsPtrHashKey<gfxFontEntry>,nsIDOMFontFace> mFontFaces;
};

View File

@ -616,6 +616,14 @@ private:
nsTArray<nsPropertiesTable> mPropertiesTableList;
};
namespace mozilla {
template<>
struct HasDangerousPublicDestructor<nsGlyphTableList>
{
static const bool value = true;
};
}
NS_IMPL_ISUPPORTS(nsGlyphTableList, nsIObserver)
// -----------------------------------------------------------------------------

View File

@ -45,6 +45,10 @@ private:
class MouseListener MOZ_FINAL : public nsIDOMEventListener
{
private:
~MouseListener() {}
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMEVENTLISTENER

View File

@ -76,7 +76,6 @@ public:
};
nsPrintEngine();
~nsPrintEngine();
void Destroy();
void DestroyPrintingData();
@ -213,6 +212,7 @@ public:
}
protected:
~nsPrintEngine();
nsresult CommonPrint(bool aIsPrintPreview, nsIPrintSettings* aPrintSettings,
nsIWebProgressListener* aWebProgressListener,

View File

@ -35,7 +35,6 @@ public:
NS_DECL_NSIDOMEVENTLISTENER
nsPrintPreviewListener(mozilla::dom::EventTarget* aTarget);
~nsPrintPreviewListener();
// Add/remove the relevant listeners, based on what interfaces
// the embedding chrome implements.
@ -43,6 +42,7 @@ public:
nsresult RemoveListeners();
private:
~nsPrintPreviewListener();
nsCOMPtr<mozilla::dom::EventTarget> mEventTarget;

View File

@ -37,7 +37,6 @@ class CommonAnimationManager : public nsIStyleRuleProcessor,
public nsARefreshObserver {
public:
CommonAnimationManager(nsPresContext *aPresContext);
virtual ~CommonAnimationManager();
// nsISupports
NS_DECL_ISUPPORTS
@ -69,6 +68,8 @@ public:
nsStyleContext* aStyleContext,
nsStyleAnimation::Value& aComputedValue);
protected:
virtual ~CommonAnimationManager();
friend struct CommonElementAnimationData; // for ElementDataRemoved
virtual void AddElementData(CommonElementAnimationData* aData) = 0;
@ -193,6 +194,8 @@ public:
};
private:
~AnimValuesStyleRule() {}
InfallibleTArray<PropertyValuePair> mPropertyValuePairs;
};

View File

@ -28,7 +28,6 @@ public:
{
SetIsDOMBinding();
}
virtual ~CSSRuleList() {}
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSRULELIST_IID)
@ -60,6 +59,9 @@ public:
virtual nsIDOMCSSRule* IndexedGetter(uint32_t aIndex, bool& aFound) = 0;
virtual uint32_t Length() = 0;
protected:
virtual ~CSSRuleList() {}
};
NS_DEFINE_STATIC_IID_ACCESSOR(CSSRuleList, NS_ICSSRULELIST_IID)

View File

@ -67,6 +67,8 @@ public:
void DestroyRequest(imgIRequest* aRequest);
private:
~ImageLoader() {}
// We need to be able to look up the frames associated with a request (for
// delivering notifications) and the requests associated with a frame (when
// the frame goes away). Thus we maintain hashtables going both ways. These

View File

@ -107,8 +107,10 @@ class SheetLoadData : public nsIRunnable,
public nsIUnicharStreamLoaderObserver,
public nsIThreadObserver
{
public:
protected:
virtual ~SheetLoadData(void);
public:
// Data for loading a sheet linked from a document
SheetLoadData(Loader* aLoader,
const nsSubstring& aTitle,

View File

@ -982,9 +982,11 @@ class DOMCSSStyleRule;
class DOMCSSDeclarationImpl : public nsDOMCSSDeclaration
{
protected:
virtual ~DOMCSSDeclarationImpl(void);
public:
DOMCSSDeclarationImpl(css::StyleRule *aRule);
virtual ~DOMCSSDeclarationImpl(void);
NS_IMETHOD GetParentRule(nsIDOMCSSRule **aParent) MOZ_OVERRIDE;
void DropReference(void);
@ -1026,7 +1028,6 @@ class DOMCSSStyleRule : public nsICSSStyleRuleDOMWrapper
{
public:
DOMCSSStyleRule(StyleRule *aRule);
virtual ~DOMCSSStyleRule();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMCSSStyleRule)
@ -1041,6 +1042,8 @@ public:
friend class ::DOMCSSDeclarationImpl;
protected:
virtual ~DOMCSSStyleRule();
DOMCSSDeclarationImpl mDOMDeclaration;
StyleRule* Rule() {

View File

@ -54,7 +54,6 @@ public:
nsCSSRuleProcessor(const sheet_array_type& aSheets,
uint8_t aSheetType,
mozilla::dom::Element* aScopeElement);
virtual ~nsCSSRuleProcessor();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(nsCSSRuleProcessor)
@ -175,6 +174,9 @@ public:
nsCSSSelector* mSelector;
};
protected:
virtual ~nsCSSRuleProcessor();
private:
static bool CascadeSheet(mozilla::CSSStyleSheet* aSheet,
CascadeEnumData* aData);

View File

@ -209,6 +209,8 @@ public:
virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
protected:
~nsCSSFontFaceStyleDecl() {}
friend class nsCSSFontFaceRule;
#define CSS_FONT_DESC(name_, method_) nsCSSValue m##method_;
#include "nsCSSFontDescList.h"
@ -262,6 +264,8 @@ public:
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
protected:
~nsCSSFontFaceRule() {}
friend class nsCSSFontFaceStyleDecl;
nsCSSFontFaceStyleDecl mDecl;
};
@ -342,6 +346,8 @@ public:
}
protected:
~nsCSSFontFeatureValuesRule() {}
mozilla::FontFamilyList mFamilyList;
nsTArray<gfxFontFeatureValueSet::FeatureValues> mFeatureValues;
};
@ -395,7 +401,6 @@ class nsCSSKeyframeStyleDeclaration MOZ_FINAL : public nsDOMCSSDeclaration
{
public:
nsCSSKeyframeStyleDeclaration(nsCSSKeyframeRule *aRule);
virtual ~nsCSSKeyframeStyleDeclaration();
NS_IMETHOD GetParentRule(nsIDOMCSSRule **aParent) MOZ_OVERRIDE;
void DropReference() { mRule = nullptr; }
@ -411,6 +416,8 @@ public:
virtual nsINode* GetParentObject() MOZ_OVERRIDE;
protected:
virtual ~nsCSSKeyframeStyleDeclaration();
// This reference is not reference-counted. The rule object tells us
// when it's about to go away.
nsCSSKeyframeRule *mRule;
@ -523,7 +530,6 @@ class nsCSSPageStyleDeclaration MOZ_FINAL : public nsDOMCSSDeclaration
{
public:
nsCSSPageStyleDeclaration(nsCSSPageRule *aRule);
virtual ~nsCSSPageStyleDeclaration();
NS_IMETHOD GetParentRule(nsIDOMCSSRule **aParent) MOZ_OVERRIDE;
void DropReference() { mRule = nullptr; }
@ -539,6 +545,8 @@ public:
virtual nsINode *GetParentObject() MOZ_OVERRIDE;
protected:
virtual ~nsCSSPageStyleDeclaration();
// This reference is not reference-counted. The rule object tells us
// when it's about to go away.
nsCSSPageRule *mRule;

View File

@ -623,6 +623,14 @@ private:
#endif
};
namespace mozilla {
template<>
struct HasDangerousPublicDestructor<nsComputedDOMStyle>
{
static const bool value = true;
};
}
already_AddRefed<nsComputedDOMStyle>
NS_NewComputedDOMStyle(mozilla::dom::Element* aElement,
const nsAString& aPseudoElt,

View File

@ -24,7 +24,6 @@ class nsDOMCSSAttributeDeclaration MOZ_FINAL : public nsDOMCSSDeclaration
public:
typedef mozilla::dom::Element Element;
nsDOMCSSAttributeDeclaration(Element* aContent, bool aIsSMILOverride);
~nsDOMCSSAttributeDeclaration();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsDOMCSSAttributeDeclaration,
@ -42,6 +41,8 @@ public:
const nsAString& aValue) MOZ_OVERRIDE;
protected:
~nsDOMCSSAttributeDeclaration();
virtual nsresult SetCSSDeclaration(mozilla::css::Declaration* aDecl) MOZ_OVERRIDE;
virtual nsIDocument* DocToUpdate() MOZ_OVERRIDE;

View File

@ -23,8 +23,6 @@ public:
nsROCSSPrimitiveValue* aAlpha,
bool aHasAlpha);
virtual ~nsDOMCSSRGBColor(void);
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsDOMCSSRGBColor)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(nsDOMCSSRGBColor)
@ -58,6 +56,8 @@ public:
MOZ_OVERRIDE MOZ_FINAL;
private:
virtual ~nsDOMCSSRGBColor(void);
nsRefPtr<nsROCSSPrimitiveValue> mRed;
nsRefPtr<nsROCSSPrimitiveValue> mGreen;
nsRefPtr<nsROCSSPrimitiveValue> mBlue;

View File

@ -24,7 +24,6 @@ public:
nsROCSSPrimitiveValue* aRight,
nsROCSSPrimitiveValue* aBottom,
nsROCSSPrimitiveValue* aLeft);
virtual ~nsDOMCSSRect(void);
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_NSIDOMRECT
@ -41,6 +40,9 @@ public:
virtual JSObject* WrapObject(JSContext* cx)
MOZ_OVERRIDE MOZ_FINAL;
protected:
virtual ~nsDOMCSSRect(void);
private:
nsRefPtr<nsROCSSPrimitiveValue> mTop;
nsRefPtr<nsROCSSPrimitiveValue> mRight;

View File

@ -69,4 +69,12 @@ private:
InfallibleTArray<nsRefPtr<CSSValue> > mCSSValues;
};
namespace mozilla {
template<>
struct HasDangerousPublicDestructor<nsDOMCSSValueList>
{
static const bool value = true;
};
}
#endif /* nsDOMCSSValueList_h___ */

View File

@ -106,8 +106,6 @@ public:
gfxProxyFontEntry* aFontToLoad, nsIURI* aFontURI,
nsUserFontSet* aFontSet, nsIChannel* aChannel);
virtual ~nsFontFaceLoader();
NS_DECL_ISUPPORTS
NS_DECL_NSISTREAMLOADEROBSERVER
@ -126,6 +124,9 @@ public:
nsIURI* aTargetURI,
nsISupports* aContext);
protected:
virtual ~nsFontFaceLoader();
private:
nsRefPtr<gfxMixedFontFamily> mFontFamily;
nsRefPtr<gfxProxyFontEntry> mFontEntry;

View File

@ -22,7 +22,6 @@ class nsHTMLCSSStyleSheet MOZ_FINAL : public nsIStyleRuleProcessor
{
public:
nsHTMLCSSStyleSheet();
~nsHTMLCSSStyleSheet();
NS_DECL_ISUPPORTS
@ -49,6 +48,8 @@ public:
MiscContainer* LookupStyleAttr(const nsAString& aSerialized);
private:
~nsHTMLCSSStyleSheet();
nsHTMLCSSStyleSheet(const nsHTMLCSSStyleSheet& aCopy) MOZ_DELETE;
nsHTMLCSSStyleSheet& operator=(const nsHTMLCSSStyleSheet& aCopy) MOZ_DELETE;

View File

@ -74,6 +74,8 @@ private:
class HTMLColorRule;
friend class HTMLColorRule;
class HTMLColorRule MOZ_FINAL : public nsIStyleRule {
private:
~HTMLColorRule() {}
public:
HTMLColorRule() {}
@ -94,9 +96,10 @@ private:
class GenericTableRule;
friend class GenericTableRule;
class GenericTableRule : public nsIStyleRule {
protected:
virtual ~GenericTableRule() {}
public:
GenericTableRule() {}
virtual ~GenericTableRule() {}
NS_DECL_ISUPPORTS
@ -130,6 +133,8 @@ public: // for mLangRuleTable structures only
// Rule to handle xml:lang attributes, of which we have exactly one
// per language string, maintained in mLangRuleTable.
class LangRule MOZ_FINAL : public nsIStyleRule {
private:
~LangRule() {}
public:
LangRule(const nsSubstring& aLang) : mLang(aLang) {}

View File

@ -123,6 +123,14 @@ private:
} mValue;
};
namespace mozilla {
template<>
struct HasDangerousPublicDestructor<nsROCSSPrimitiveValue>
{
static const bool value = true;
};
}
inline nsROCSSPrimitiveValue *mozilla::dom::CSSValue::AsPrimitiveValue()
{
return CssValueType() == nsIDOMCSSValue::CSS_PRIMITIVE_VALUE ?

View File

@ -41,6 +41,10 @@ class EventStates;
class nsEmptyStyleRule MOZ_FINAL : public nsIStyleRule
{
private:
~nsEmptyStyleRule() {}
public:
NS_DECL_ISUPPORTS
virtual void MapRuleInfoInto(nsRuleData* aRuleData) MOZ_OVERRIDE;
#ifdef DEBUG
@ -50,6 +54,10 @@ class nsEmptyStyleRule MOZ_FINAL : public nsIStyleRule
class nsInitialStyleRule MOZ_FINAL : public nsIStyleRule
{
private:
~nsInitialStyleRule() {}
public:
NS_DECL_ISUPPORTS
virtual void MapRuleInfoInto(nsRuleData* aRuleData) MOZ_OVERRIDE;
#ifdef DEBUG
@ -59,6 +67,10 @@ class nsInitialStyleRule MOZ_FINAL : public nsIStyleRule
class nsDisableTextZoomStyleRule MOZ_FINAL : public nsIStyleRule
{
private:
~nsDisableTextZoomStyleRule() {}
public:
NS_DECL_ISUPPORTS
virtual void MapRuleInfoInto(nsRuleData* aRuleData) MOZ_OVERRIDE;
#ifdef DEBUG

View File

@ -265,6 +265,8 @@ protected:
AddStateBits(NS_STATE_SVG_POSITIONING_DIRTY);
}
~SVGTextFrame() {}
public:
NS_DECL_QUERYFRAME_TARGET(SVGTextFrame)
NS_DECL_QUERYFRAME
@ -695,4 +697,12 @@ private:
float mLengthAdjustScaleFactor;
};
namespace mozilla {
template<>
struct HasDangerousPublicDestructor<SVGTextFrame::MutationObserver>
{
static const bool value = true;
};
}
#endif

View File

@ -42,13 +42,16 @@ class nsSVGMaskFrame;
* StopListening, respectively.
*/
class nsSVGRenderingObserver : public nsStubMutationObserver {
protected:
virtual ~nsSVGRenderingObserver()
{}
public:
typedef mozilla::dom::Element Element;
nsSVGRenderingObserver()
: mInObserverList(false)
{}
virtual ~nsSVGRenderingObserver()
{}
// nsISupports
NS_DECL_ISUPPORTS
@ -199,7 +202,6 @@ class nsSVGFilterProperty : public nsISupports {
public:
nsSVGFilterProperty(const nsTArray<nsStyleFilter> &aFilters,
nsIFrame *aFilteredFrame);
virtual ~nsSVGFilterProperty();
const nsTArray<nsStyleFilter>& GetFilters() { return mFilters; }
bool ReferencesValidResources();
@ -209,6 +211,9 @@ public:
// nsISupports
NS_DECL_ISUPPORTS
protected:
virtual ~nsSVGFilterProperty();
private:
nsTArray<nsSVGFilterReference*> mReferences;
nsTArray<nsStyleFilter> mFilters;

View File

@ -40,6 +40,8 @@ public:
void SetFrame(nsSVGImageFrame *frame) { mFrame = frame; }
private:
~nsSVGImageListener() {}
nsSVGImageFrame *mFrame;
};

View File

@ -18,10 +18,12 @@ class nsLayoutDebugCLH : public ICOMMANDLINEHANDLER
{
public:
nsLayoutDebugCLH();
virtual ~nsLayoutDebugCLH();
NS_DECL_ISUPPORTS
NS_DECL_NSICOMMANDLINEHANDLER
protected:
virtual ~nsLayoutDebugCLH();
};
#endif /* !defined(nsLayoutDebugCLH_h_) */

View File

@ -15,13 +15,14 @@ class nsLayoutDebuggingTools : public nsILayoutDebuggingTools {
public:
nsLayoutDebuggingTools();
virtual ~nsLayoutDebuggingTools();
NS_DECL_ISUPPORTS
NS_DECL_NSILAYOUTDEBUGGINGTOOLS
protected:
virtual ~nsLayoutDebuggingTools();
void ForceRefresh();
nsresult GetBoolPref(const char * aPrefName, bool *aValue);
nsresult SetBoolPrefAndRefresh(const char * aPrefName, bool aNewValue);

View File

@ -25,9 +25,9 @@ public:
NS_DECL_NSILAYOUTREGRESSIONTESTER
nsRegressionTester();
virtual ~nsRegressionTester();
protected:
virtual ~nsRegressionTester();
nsresult GetDocShellFromWindow(nsIDOMWindow* inWindow, nsIDocShell** outShell);
};

View File

@ -23,10 +23,12 @@ class nsIGridPart;
class nsBoxLayout : public nsISupports {
protected:
virtual ~nsBoxLayout() {}
public:
nsBoxLayout() {}
virtual ~nsBoxLayout() {}
NS_DECL_ISUPPORTS

View File

@ -28,7 +28,6 @@ class nsBoxObject : public nsPIBoxObject
public:
nsBoxObject();
virtual ~nsBoxObject();
// nsPIBoxObject
virtual nsresult Init(nsIContent* aContent) MOZ_OVERRIDE;
@ -46,6 +45,7 @@ public:
nsIDOMElement** aResult);
protected:
virtual ~nsBoxObject();
nsAutoPtr<nsInterfaceHashtable<nsStringHashKey,nsISupports> > mPropertyTable; //[OWNER]

View File

@ -24,7 +24,6 @@ class nsImageBoxListener : public imgINotificationObserver,
{
public:
nsImageBoxListener();
virtual ~nsImageBoxListener();
NS_DECL_ISUPPORTS
NS_DECL_IMGINOTIFICATIONOBSERVER
@ -33,6 +32,8 @@ public:
void SetFrame(nsImageBoxFrame *frame) { mFrame = frame; }
private:
virtual ~nsImageBoxListener();
nsImageBoxFrame *mFrame;
};

View File

@ -66,11 +66,13 @@ using namespace mozilla::dom;
class nsListScrollSmoother : public nsITimerCallback
{
private:
virtual ~nsListScrollSmoother();
public:
NS_DECL_ISUPPORTS
nsListScrollSmoother(nsListBoxBodyFrame* aOuter);
virtual ~nsListScrollSmoother();
// nsITimerCallback
NS_DECL_NSITIMERCALLBACK

View File

@ -25,9 +25,6 @@ public:
/** default constructor
*/
nsMenuBarListener(nsMenuBarFrame* aMenuBar);
/** default destructor
*/
virtual ~nsMenuBarListener();
static void InitializeStatics();
@ -46,6 +43,10 @@ public:
static bool IsAccessKeyPressed(nsIDOMKeyEvent* event);
protected:
/** default destructor
*/
virtual ~nsMenuBarListener();
static void InitAccessKey();
static mozilla::Modifiers GetModifiersForAccessKey(nsIDOMKeyEvent* event);

View File

@ -59,7 +59,6 @@ class nsMenuTimerMediator MOZ_FINAL : public nsITimerCallback
{
public:
nsMenuTimerMediator(nsMenuFrame* aFrame);
~nsMenuTimerMediator();
NS_DECL_ISUPPORTS
NS_DECL_NSITIMERCALLBACK
@ -67,6 +66,7 @@ public:
void ClearFrame();
private:
~nsMenuTimerMediator();
// Pointer to the wrapped frame.
nsMenuFrame* mFrame;

View File

@ -44,10 +44,10 @@ public:
static void Shutdown();
NS_DECL_ISUPPORTS
virtual ~nsRepeatService();
protected:
nsRepeatService();
virtual ~nsRepeatService();
private:
Callback mCallback;

View File

@ -29,11 +29,13 @@ public:
nsSliderFrame* mSlider;
nsSliderMediator(nsSliderFrame* aSlider) { mSlider = aSlider; }
virtual ~nsSliderMediator() {}
virtual void SetSlider(nsSliderFrame* aSlider) { mSlider = aSlider; }
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) MOZ_OVERRIDE;
protected:
virtual ~nsSliderMediator() {}
};
class nsSliderFrame : public nsBoxFrame

View File

@ -52,6 +52,9 @@ public:
class nsSplitterFrameInner : public nsIDOMEventListener
{
protected:
virtual ~nsSplitterFrameInner();
public:
NS_DECL_ISUPPORTS
@ -62,7 +65,6 @@ public:
mOuter = aSplitter;
mPressed = false;
}
virtual ~nsSplitterFrameInner();
void Disconnect() { mOuter = nullptr; }

View File

@ -932,6 +932,9 @@ nsXULPopupManager::HidePopup(nsIContent* aPopup,
// This is used to hide the popup after a transition finishes.
class TransitionEnder : public nsIDOMEventListener
{
protected:
virtual ~TransitionEnder() { }
public:
nsCOMPtr<nsIContent> mContent;
@ -945,8 +948,6 @@ public:
{
}
virtual ~TransitionEnder() { }
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) MOZ_OVERRIDE
{
mContent->RemoveSystemEventListener(NS_LITERAL_STRING("transitionend"), this, false);

View File

@ -40,7 +40,6 @@ class Element;
class nsTreeColumn MOZ_FINAL : public nsITreeColumn {
public:
nsTreeColumn(nsTreeColumns* aColumns, nsIContent* aContent);
~nsTreeColumn();
NS_DECLARE_STATIC_IID_ACCESSOR(NS_TREECOLUMN_IMPL_CID)
@ -52,6 +51,7 @@ public:
friend class nsTreeColumns;
protected:
~nsTreeColumn();
nsIFrame* GetFrame();
nsIFrame* GetFrame(nsTreeBodyFrame* aBodyFrame);
// Don't call this if GetWidthInTwips or GetRect fails
@ -126,9 +126,11 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsTreeColumn, NS_TREECOLUMN_IMPL_CID)
class nsTreeColumns MOZ_FINAL : public nsITreeColumns
, public nsWrapperCache
{
private:
~nsTreeColumns();
public:
nsTreeColumns(nsTreeBodyFrame* aTree);
~nsTreeColumns();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsTreeColumns)

View File

@ -29,8 +29,6 @@ class nsTreeContentView MOZ_FINAL : public nsINativeTreeView,
public:
nsTreeContentView(void);
~nsTreeContentView(void);
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsTreeContentView,
nsINativeTreeView)
@ -51,6 +49,8 @@ class nsTreeContentView MOZ_FINAL : public nsINativeTreeView,
static bool CanTrustTreeSelection(nsISupports* aValue);
protected:
~nsTreeContentView(void);
// Recursive methods which deal with serializing of nested content.
void Serialize(nsIContent* aContent, int32_t aParentIndex, int32_t* aIndex,
nsTArray<nsAutoPtr<Row> >& aRows);

View File

@ -17,7 +17,6 @@ class nsTreeImageListener MOZ_FINAL : public imgINotificationObserver
{
public:
nsTreeImageListener(nsTreeBodyFrame *aTreeFrame);
~nsTreeImageListener();
NS_DECL_ISUPPORTS
NS_DECL_IMGINOTIFICATIONOBSERVER
@ -27,6 +26,8 @@ public:
friend class nsTreeBodyFrame;
protected:
~nsTreeImageListener();
void UnsuppressInvalidation() { mInvalidationSuppressed = false; }
void Invalidate();
void AddCell(int32_t aIndex, nsITreeColumn* aCol);

View File

@ -20,7 +20,6 @@ class nsTreeSelection MOZ_FINAL : public nsINativeTreeSelection
{
public:
nsTreeSelection(nsITreeBoxObject* aTree);
~nsTreeSelection();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(nsTreeSelection)
@ -32,6 +31,8 @@ public:
friend struct nsTreeRange;
protected:
~nsTreeSelection();
nsresult FireOnSelectHandler();
static void SelectCallback(nsITimer *aTimer, void *aClosure);