Bug 1317954 - Use C++11's override and remove virtual where applicable in xpcom/.
MozReview-Commit-ID: 2XXoxNHYCKm
--- a/xpcom/build/NSPRInterposer.cpp
+++ b/xpcom/build/NSPRInterposer.cpp
@@ -31,17 +31,17 @@ PRFileInfo64FN sFileInfo64Fn = nullptr;
class NSPRIOAutoObservation : public IOInterposeObserver::Observation
{
public:
explicit NSPRIOAutoObservation(IOInterposeObserver::Operation aOp)
: IOInterposeObserver::Observation(aOp, "NSPRIOInterposer")
{
}
- ~NSPRIOAutoObservation()
+ ~NSPRIOAutoObservation() override
{
Report();
}
};
PRStatus PR_CALLBACK
interposedClose(PRFileDesc* aFd)
{
--- a/xpcom/glue/nsWeakReference.cpp
+++ b/xpcom/glue/nsWeakReference.cpp
@@ -31,17 +31,17 @@
class nsWeakReference final : public nsIWeakReference
{
public:
// nsISupports...
NS_DECL_ISUPPORTS
// nsIWeakReference...
NS_DECL_NSIWEAKREFERENCE
- virtual size_t SizeOfOnlyThis(mozilla::MallocSizeOf aMallocSizeOf) const override;
+ size_t SizeOfOnlyThis(mozilla::MallocSizeOf aMallocSizeOf) const override;
private:
MOZ_WEAKREF_DECL_OWNINGTHREAD
friend class nsSupportsWeakReference;
explicit nsWeakReference(nsSupportsWeakReference* aReferent)
: mReferent(aReferent)
--- a/xpcom/tests/gtest/TestCOMPtr.cpp
+++ b/xpcom/tests/gtest/TestCOMPtr.cpp
@@ -20,19 +20,19 @@ class IFoo : public nsISupports
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFOO_IID)
public:
IFoo();
// virtual dtor because IBar uses our Release()
virtual ~IFoo();
- NS_IMETHOD_(MozExternalRefCountType) AddRef();
- NS_IMETHOD_(MozExternalRefCountType) Release();
- NS_IMETHOD QueryInterface( const nsIID&, void** );
+ NS_IMETHOD_(MozExternalRefCountType) AddRef() override;
+ NS_IMETHOD_(MozExternalRefCountType) Release() override;
+ NS_IMETHOD QueryInterface( const nsIID&, void** ) override;
unsigned int refcount_;
static int total_constructions_;
static int total_destructions_;
static int total_queries_;
};
@@ -130,19 +130,19 @@ return_a_IFoo()
class IBar : public IFoo
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IBAR_IID)
public:
IBar();
- virtual ~IBar();
+ ~IBar() override;
- NS_IMETHOD QueryInterface( const nsIID&, void** );
+ NS_IMETHOD QueryInterface( const nsIID&, void** ) override;
static int total_destructions_;
static int total_queries_;
};
NS_DEFINE_STATIC_IID_ACCESSOR(IBar, NS_IBAR_IID)
int IBar::total_destructions_;
--- a/xpcom/tests/gtest/TestHashtables.cpp
+++ b/xpcom/tests/gtest/TestHashtables.cpp
@@ -139,19 +139,19 @@ testTHashtable(nsTHashtable<EntityToUnic
class IFoo final : public nsISupports
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFOO_IID)
IFoo();
- NS_IMETHOD_(MozExternalRefCountType) AddRef();
- NS_IMETHOD_(MozExternalRefCountType) Release();
- NS_IMETHOD QueryInterface( const nsIID&, void** );
+ NS_IMETHOD_(MozExternalRefCountType) AddRef() override;
+ NS_IMETHOD_(MozExternalRefCountType) Release() override;
+ NS_IMETHOD QueryInterface( const nsIID&, void** ) override;
NS_IMETHOD SetString(const nsACString& /*in*/ aString);
NS_IMETHOD GetString(nsACString& /*out*/ aString);
static void print_totals();
private:
~IFoo();
--- a/xpcom/tests/gtest/TestNsRefPtr.cpp
+++ b/xpcom/tests/gtest/TestNsRefPtr.cpp
@@ -23,19 +23,19 @@ class Foo : public nsISupports
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_FOO_IID)
public:
Foo();
// virtual dtor because Bar uses our Release()
virtual ~Foo();
- NS_IMETHOD_(MozExternalRefCountType) AddRef();
- NS_IMETHOD_(MozExternalRefCountType) Release();
- NS_IMETHOD QueryInterface( const nsIID&, void** );
+ NS_IMETHOD_(MozExternalRefCountType) AddRef() override;
+ NS_IMETHOD_(MozExternalRefCountType) Release() override;
+ NS_IMETHOD QueryInterface( const nsIID&, void** ) override;
void MemberFunction( int, int*, int& );
virtual void VirtualMemberFunction( int, int*, int& );
virtual void VirtualConstMemberFunction( int, int*, int& ) const;
void NonconstMethod() {}
void ConstMethod() const {}
int refcount_;
@@ -158,22 +158,22 @@ return_a_Foo()
class Bar : public Foo
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_BAR_IID)
public:
Bar();
- virtual ~Bar();
+ ~Bar() override;
NS_IMETHOD QueryInterface( const nsIID&, void** ) override;
- virtual void VirtualMemberFunction( int, int*, int& ) override;
- virtual void VirtualConstMemberFunction( int, int*, int& ) const override;
+ void VirtualMemberFunction( int, int*, int& ) override;
+ void VirtualConstMemberFunction( int, int*, int& ) const override;
static int total_constructions_;
static int total_destructions_;
static int total_queries_;
};
NS_DEFINE_STATIC_IID_ACCESSOR(Bar, NS_BAR_IID)