Bug 1028588 - Fix dangerous public destructors in xpfe/ - r=ndeakin

This commit is contained in:
Benoit Jacob 2014-06-24 12:36:45 -04:00
parent 00603a968f
commit 84d2f7e177
7 changed files with 26 additions and 6 deletions

View File

@ -214,8 +214,9 @@ nsAppShellService::CreateTopLevelWindow(nsIXULWindow *aParent,
class WebBrowserChrome2Stub : public nsIWebBrowserChrome2,
public nsIInterfaceRequestor,
public nsSupportsWeakReference {
public:
protected:
virtual ~WebBrowserChrome2Stub() {}
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBBROWSERCHROME
NS_DECL_NSIWEBBROWSERCHROME2
@ -332,6 +333,7 @@ public:
NS_FORWARD_NSIWEBNAVIGATION(mWebNavigation->)
NS_FORWARD_NSIINTERFACEREQUESTOR(mInterfaceRequestor->)
private:
~WindowlessBrowserStub() {}
nsCOMPtr<nsIWebBrowser> mBrowser;
nsCOMPtr<nsIWebNavigation> mWebNavigation;
nsCOMPtr<nsIInterfaceRequestor> mInterfaceRequestor;

View File

@ -50,7 +50,6 @@ friend class nsWindowMediator;
public:
nsAppShellWindowEnumerator(const char16_t* aTypeString,
nsWindowMediator& inMediator);
virtual ~nsAppShellWindowEnumerator();
NS_IMETHOD GetNext(nsISupports **retval) = 0;
NS_IMETHOD HasMoreElements(bool *retval);
@ -58,6 +57,8 @@ public:
protected:
virtual ~nsAppShellWindowEnumerator();
void AdjustInitialPosition();
virtual nsWindowInfo *FindNext() = 0;

View File

@ -68,6 +68,14 @@ private:
nsContentTreeOwner *mAggregator;
};
namespace mozilla {
template<>
struct HasDangerousPublicDestructor<nsSiteWindow>
{
static const bool value = true;
};
}
//*****************************************************************************
//*** nsContentTreeOwner: Object Management
//*****************************************************************************

View File

@ -460,6 +460,8 @@ public:
}
private:
~WebShellWindowTimerCallback() {}
nsRefPtr<nsWebShellWindow> mWindow;
};

View File

@ -39,9 +39,11 @@ friend class nsASXULWindowFrontToBackEnumerator;
friend class nsASDOMWindowBackToFrontEnumerator;
friend class nsASXULWindowBackToFrontEnumerator;
protected:
virtual ~nsWindowMediator();
public:
nsWindowMediator();
virtual ~nsWindowMediator();
nsresult Init();

View File

@ -25,11 +25,13 @@ class nsDirectoryViewerFactory : public nsIDocumentLoaderFactory
{
public:
nsDirectoryViewerFactory();
virtual ~nsDirectoryViewerFactory();
// nsISupports interface
NS_DECL_ISUPPORTS
NS_DECL_NSIDOCUMENTLOADERFACTORY
protected:
virtual ~nsDirectoryViewerFactory();
};
class nsHTTPIndex : public nsIHTTPIndex,
@ -87,9 +89,10 @@ protected:
static void FireTimer(nsITimer* aTimer, void* aClosure);
virtual ~nsHTTPIndex();
public:
nsHTTPIndex();
virtual ~nsHTTPIndex();
nsresult Init(void);
static nsresult Create(nsIURI* aBaseURI, nsIInterfaceRequestor* aContainer,

View File

@ -27,7 +27,6 @@ class nsWindowDataSource : public nsIRDFDataSource,
{
public:
nsWindowDataSource() { }
virtual ~nsWindowDataSource();
nsresult Init();
@ -39,6 +38,9 @@ class nsWindowDataSource : public nsIRDFDataSource,
NS_DECL_NSIWINDOWDATASOURCE
NS_DECL_NSIRDFDATASOURCE
protected:
virtual ~nsWindowDataSource();
private:
// mapping of window -> RDF resource