Bug 1035394 - Fix dangerous public destructors in widget - r=roc

This commit is contained in:
Benoit Jacob 2014-07-08 17:23:18 -04:00
parent 35bc40cd1b
commit 716bd91400
12 changed files with 26 additions and 11 deletions

View File

@ -57,6 +57,8 @@ public:
protected:
virtual ~GfxInfo() {}
virtual nsresult GetFeatureStatusImpl(int32_t aFeature,
int32_t *aStatus,
nsAString & aSuggestedDriverVersion,

View File

@ -404,9 +404,8 @@ private:
typedef mozilla::layers::APZCTreeManager APZCTreeManager;
public:
nsChildView();
virtual ~nsChildView();
nsChildView();
NS_DECL_ISUPPORTS_INHERITED
// nsIWidget interface
@ -595,6 +594,7 @@ public:
APZCTreeManager* APZCTM() { return mAPZCTreeManager; }
protected:
virtual ~nsChildView();
void ReportMoveEvent();
void ReportSizeEvent();

View File

@ -236,7 +236,6 @@ private:
public:
nsCocoaWindow();
virtual ~nsCocoaWindow();
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSPIWIDGETCOCOA
@ -352,6 +351,7 @@ public:
NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent);
protected:
virtual ~nsCocoaWindow();
nsresult CreateNativeWindow(const NSRect &aRect,
nsBorderStyle aBorderStyle,

View File

@ -19,7 +19,6 @@ class nsDragService : public nsBaseDragService
{
public:
nsDragService();
virtual ~nsDragService();
// nsIDragService
NS_IMETHOD InvokeDragSession(nsIDOMNode *aDOMNode, nsISupportsArray * anArrayTransferables,
@ -31,6 +30,9 @@ public:
NS_IMETHOD IsDataFlavorSupported(const char *aDataFlavor, bool *_retval);
NS_IMETHOD GetNumDropItems(uint32_t * aNumItems);
protected:
virtual ~nsDragService();
private:
NSImage* ConstructDragImage(nsIDOMNode* aDOMNode,

View File

@ -29,7 +29,6 @@ class nsNativeThemeCocoa : private nsNativeTheme,
{
public:
nsNativeThemeCocoa();
virtual ~nsNativeThemeCocoa();
NS_DECL_ISUPPORTS_INHERITED
@ -69,7 +68,8 @@ public:
bool inIsIndeterminate, bool inIsHorizontal,
double inValue, double inMaxValue, nsIFrame* aFrame);
protected:
protected:
virtual ~nsNativeThemeCocoa();
nsIntMargin RTLAwareMargin(const nsIntMargin& aMargin, nsIFrame* aFrame);
nsIFrame* SeparatorResponsibility(nsIFrame* aBefore, nsIFrame* aAfter);

View File

@ -20,7 +20,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
nsPrintSettingsX();
virtual ~nsPrintSettingsX();
nsresult Init();
NSPrintInfo* GetCocoaPrintInfo() { return mPrintInfo; }
void SetCocoaPrintInfo(NSPrintInfo* aPrintInfo);
@ -33,6 +32,8 @@ public:
void SetPMPageFormat(PMPageFormat aPageFormat);
protected:
virtual ~nsPrintSettingsX();
nsPrintSettingsX(const nsPrintSettingsX& src);
nsPrintSettingsX& operator=(const nsPrintSettingsX& rhs);

View File

@ -53,7 +53,6 @@ class nsDragService : public nsBaseDragService,
{
public:
nsDragService();
virtual ~nsDragService();
NS_DECL_ISUPPORTS_INHERITED
@ -119,6 +118,9 @@ public:
// set the drag icon during drag-begin
void SetDragIcon(GdkDragContext* aContext);
protected:
virtual ~nsDragService();
private:
// mScheduledTask indicates what signal has been received from GTK and

View File

@ -62,6 +62,8 @@ public:
uint8_t aWidgetType);
nsNativeThemeGTK();
protected:
virtual ~nsNativeThemeGTK();
private:

View File

@ -34,7 +34,6 @@ public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_PRINTSETTINGSGTK_IID)
nsPrintSettingsGTK();
virtual ~nsPrintSettingsGTK();
// We're overriding these methods because we want to read/write with GTK objects,
// not local variables. This allows a simpler settings implementation between
@ -120,6 +119,8 @@ public:
NS_IMETHOD SetDuplex(int32_t aDuplex);
protected:
virtual ~nsPrintSettingsGTK();
nsPrintSettingsGTK(const nsPrintSettingsGTK& src);
nsPrintSettingsGTK& operator=(const nsPrintSettingsGTK& rhs);

View File

@ -75,7 +75,6 @@ class nsWindow : public nsBaseWidget, public nsSupportsWeakReference
{
public:
nsWindow();
virtual ~nsWindow();
static void ReleaseGlobals();
@ -298,6 +297,8 @@ public:
{ return SynthesizeNativeMouseEvent(aPoint, GDK_MOTION_NOTIFY, 0); }
protected:
virtual ~nsWindow();
// event handling code
void DispatchActivateEvent(void);
void DispatchDeactivateEvent(void);

View File

@ -52,6 +52,7 @@ public:
#endif
protected:
~GfxInfo() {}
virtual nsresult GetFeatureStatusImpl(int32_t aFeature,
int32_t *aStatus,

View File

@ -48,8 +48,11 @@ class PuppetWidget : public nsBaseWidget, public nsSupportsWeakReference
public:
PuppetWidget(TabChild* aTabChild);
protected:
virtual ~PuppetWidget();
public:
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD Create(nsIWidget* aParent,