From 6c486b0407d975b01378df8a0b74843847cb8919 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Thu, 15 Jan 2015 11:36:10 -0500 Subject: [PATCH] bug 1122100 - more MOZ_OVERRIDE in xpcomish stuff r=froydnj --- intl/unicharutil/util/nsUnicharUtils.h | 6 +-- js/xpconnect/idl/nsIXPCScriptable.idl | 4 +- xpcom/base/CycleCollectedJSRuntime.h | 22 ++++---- xpcom/base/nsAutoPtr.h | 2 +- xpcom/ds/nsICollection.idl | 3 +- xpcom/glue/nsArrayUtils.h | 3 +- xpcom/glue/nsComponentManagerUtils.h | 11 ++-- xpcom/glue/nsCycleCollectionParticipant.h | 66 ++++++++++++----------- xpcom/glue/nsIWeakReferenceUtils.h | 3 +- xpcom/glue/nsServiceManagerUtils.h | 3 +- xpcom/string/nsAString.h | 2 +- xpcom/string/nsTSubstring.h | 2 +- 12 files changed, 70 insertions(+), 57 deletions(-) diff --git a/intl/unicharutil/util/nsUnicharUtils.h b/intl/unicharutil/util/nsUnicharUtils.h index 3f33c851da83..af4b2843c161 100644 --- a/intl/unicharutil/util/nsUnicharUtils.h +++ b/intl/unicharutil/util/nsUnicharUtils.h @@ -45,7 +45,7 @@ public: virtual int32_t operator() (const char16_t*, const char16_t*, uint32_t, - uint32_t) const; + uint32_t) const MOZ_OVERRIDE; }; class nsCaseInsensitiveUTF8StringComparator : public nsCStringComparator @@ -54,7 +54,7 @@ public: virtual int32_t operator() (const char*, const char*, uint32_t, - uint32_t) const; + uint32_t) const MOZ_OVERRIDE; }; class nsCaseInsensitiveStringArrayComparator @@ -73,7 +73,7 @@ public: virtual int operator() (const char16_t*, const char16_t*, uint32_t, - uint32_t) const; + uint32_t) const MOZ_OVERRIDE; }; inline bool diff --git a/js/xpconnect/idl/nsIXPCScriptable.idl b/js/xpconnect/idl/nsIXPCScriptable.idl index e3962d1222fb..0117c1439e5f 100644 --- a/js/xpconnect/idl/nsIXPCScriptable.idl +++ b/js/xpconnect/idl/nsIXPCScriptable.idl @@ -156,8 +156,8 @@ class NS_NO_VTABLE nsXPCClassInfo : public nsIClassInfo, public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_XPCCLASSINFO_IID) - NS_IMETHOD_(MozExternalRefCountType) AddRef() = 0; - NS_IMETHOD_(MozExternalRefCountType) Release() = 0; + NS_IMETHOD_(MozExternalRefCountType) AddRef() MOZ_OVERRIDE = 0; + NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE = 0; virtual void PreserveWrapper(nsISupports *aNative) = 0; }; diff --git a/xpcom/base/CycleCollectedJSRuntime.h b/xpcom/base/CycleCollectedJSRuntime.h index c3845c2d403e..c3bf60b30c41 100644 --- a/xpcom/base/CycleCollectedJSRuntime.h +++ b/xpcom/base/CycleCollectedJSRuntime.h @@ -29,27 +29,28 @@ namespace mozilla { class JSGCThingParticipant: public nsCycleCollectionParticipant { public: - NS_IMETHOD_(void) Root(void*) + NS_IMETHOD_(void) Root(void*) MOZ_OVERRIDE { MOZ_ASSERT(false, "Don't call Root on GC things"); } - NS_IMETHOD_(void) Unlink(void*) + NS_IMETHOD_(void) Unlink(void*) MOZ_OVERRIDE { MOZ_ASSERT(false, "Don't call Unlink on GC things, as they may be dead"); } - NS_IMETHOD_(void) Unroot(void*) + NS_IMETHOD_(void) Unroot(void*) MOZ_OVERRIDE { MOZ_ASSERT(false, "Don't call Unroot on GC things, as they may be dead"); } - NS_IMETHOD_(void) DeleteCycleCollectable(void* aPtr) + NS_IMETHOD_(void) DeleteCycleCollectable(void* aPtr) MOZ_OVERRIDE { MOZ_ASSERT(false, "Can't directly delete a cycle collectable GC thing"); } - NS_IMETHOD Traverse(void* aPtr, nsCycleCollectionTraversalCallback& aCb); + NS_IMETHOD Traverse(void* aPtr, nsCycleCollectionTraversalCallback& aCb) + MOZ_OVERRIDE; }; class JSZoneParticipant : public nsCycleCollectionParticipant @@ -59,27 +60,28 @@ public: { } - NS_IMETHOD_(void) Root(void*) + NS_IMETHOD_(void) Root(void*) MOZ_OVERRIDE { MOZ_ASSERT(false, "Don't call Root on GC things"); } - NS_IMETHOD_(void) Unlink(void*) + NS_IMETHOD_(void) Unlink(void*) MOZ_OVERRIDE { MOZ_ASSERT(false, "Don't call Unlink on GC things, as they may be dead"); } - NS_IMETHOD_(void) Unroot(void*) + NS_IMETHOD_(void) Unroot(void*) MOZ_OVERRIDE { MOZ_ASSERT(false, "Don't call Unroot on GC things, as they may be dead"); } - NS_IMETHOD_(void) DeleteCycleCollectable(void*) + NS_IMETHOD_(void) DeleteCycleCollectable(void*) MOZ_OVERRIDE { MOZ_ASSERT(false, "Can't directly delete a cycle collectable GC thing"); } - NS_IMETHOD Traverse(void* aPtr, nsCycleCollectionTraversalCallback& aCb); + NS_IMETHOD Traverse(void* aPtr, nsCycleCollectionTraversalCallback& aCb) + MOZ_OVERRIDE; }; class IncrementalFinalizeRunnable; diff --git a/xpcom/base/nsAutoPtr.h b/xpcom/base/nsAutoPtr.h index ff83f97a0f82..f56503c871b2 100644 --- a/xpcom/base/nsAutoPtr.h +++ b/xpcom/base/nsAutoPtr.h @@ -771,7 +771,7 @@ public: } virtual nsresult NS_FASTCALL operator()(const nsIID& aIID, - void** aResult) const + void** aResult) const MOZ_OVERRIDE { nsresult status = mRawPtr ? mRawPtr->QueryInterface(aIID, aResult) : NS_ERROR_NULL_POINTER; diff --git a/xpcom/ds/nsICollection.idl b/xpcom/ds/nsICollection.idl index 3e7c1f087d16..afa7ac7d2dac 100644 --- a/xpcom/ds/nsICollection.idl +++ b/xpcom/ds/nsICollection.idl @@ -42,7 +42,8 @@ class MOZ_STACK_CLASS nsQueryElementAt : public nsCOMPtr_helper // nothing else to do here } - virtual nsresult NS_FASTCALL operator()( const nsIID& aIID, void** ) const; + virtual nsresult NS_FASTCALL operator()( const nsIID& aIID, void** ) + const MOZ_OVERRIDE; private: nsICollection* MOZ_NON_OWNING_REF mCollection; diff --git a/xpcom/glue/nsArrayUtils.h b/xpcom/glue/nsArrayUtils.h index d380e9cd9bc8..e216c18c2697 100644 --- a/xpcom/glue/nsArrayUtils.h +++ b/xpcom/glue/nsArrayUtils.h @@ -22,7 +22,8 @@ public: { } - virtual nsresult NS_FASTCALL operator()(const nsIID& aIID, void**) const; + virtual nsresult NS_FASTCALL operator()(const nsIID& aIID, void**) const + MOZ_OVERRIDE; private: nsIArray* MOZ_NON_OWNING_REF mArray; diff --git a/xpcom/glue/nsComponentManagerUtils.h b/xpcom/glue/nsComponentManagerUtils.h index f8b4da2e952a..aa40f6891c28 100644 --- a/xpcom/glue/nsComponentManagerUtils.h +++ b/xpcom/glue/nsComponentManagerUtils.h @@ -37,7 +37,8 @@ public: { } - virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const; + virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const + MOZ_OVERRIDE; private: const nsCID& mCID; @@ -56,7 +57,7 @@ public: { } - virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const; + virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const MOZ_OVERRIDE; private: const char* mContractID; @@ -75,7 +76,7 @@ public: { } - virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const; + virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const MOZ_OVERRIDE; private: nsIFactory* MOZ_NON_OWNING_REF mFactory; @@ -132,7 +133,7 @@ public: { } - virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const; + virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const MOZ_OVERRIDE; private: const nsCID& mCID; @@ -148,7 +149,7 @@ public: { } - virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const; + virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const MOZ_OVERRIDE; private: const char* mContractID; diff --git a/xpcom/glue/nsCycleCollectionParticipant.h b/xpcom/glue/nsCycleCollectionParticipant.h index 1fcf858f75b8..03c8078e0eec 100644 --- a/xpcom/glue/nsCycleCollectionParticipant.h +++ b/xpcom/glue/nsCycleCollectionParticipant.h @@ -182,7 +182,7 @@ public: } NS_IMETHOD_(void) Trace(void* aPtr, const TraceCallbacks& aCb, - void* aClosure) = 0; + void* aClosure) MOZ_OVERRIDE = 0; static void NoteJSChild(JS::GCCellPtr aGCThing, const char* aName, void* aClosure); @@ -202,11 +202,11 @@ public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_XPCOMCYCLECOLLECTIONPARTICIPANT_IID) - NS_IMETHOD_(void) Root(void* aPtr); - NS_IMETHOD_(void) Unroot(void* aPtr); + NS_IMETHOD_(void) Root(void* aPtr) MOZ_OVERRIDE; + NS_IMETHOD_(void) Unroot(void* aPtr) MOZ_OVERRIDE; NS_IMETHOD_(void) Trace(void* aPtr, const TraceCallbacks& aCb, - void* aClosure); + void* aClosure) MOZ_OVERRIDE; static bool CheckForRightISupports(nsISupports* aSupports); }; @@ -507,8 +507,9 @@ DowncastCCParticipant(void* aPtr) #define NS_DECL_CYCLE_COLLECTION_CLASS_BODY_NO_UNLINK(_class, _base) \ public: \ - NS_IMETHOD Traverse(void *p, nsCycleCollectionTraversalCallback &cb); \ - NS_IMETHOD_(void) DeleteCycleCollectable(void *p) \ + NS_IMETHOD Traverse(void *p, nsCycleCollectionTraversalCallback &cb) \ + MOZ_OVERRIDE; \ + NS_IMETHOD_(void) DeleteCycleCollectable(void *p) MOZ_OVERRIDE \ { \ DowncastCCParticipant<_class>(p)->DeleteCycleCollectable(); \ } \ @@ -526,7 +527,7 @@ public: \ #define NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base) \ NS_DECL_CYCLE_COLLECTION_CLASS_BODY_NO_UNLINK(_class, _base) \ - NS_IMETHOD_(void) Unlink(void *p); + NS_IMETHOD_(void) Unlink(void *p) MOZ_OVERRIDE; #define NS_PARTICIPANT_AS(type, participant) \ const_cast(reinterpret_cast(participant)) @@ -573,9 +574,9 @@ public: : nsXPCOMCycleCollectionParticipant(true) {} \ private: \ NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base) \ - NS_IMETHOD_(bool) CanSkipReal(void *p, bool aRemovingAllowed); \ - NS_IMETHOD_(bool) CanSkipInCCReal(void *p); \ - NS_IMETHOD_(bool) CanSkipThisReal(void *p); \ + NS_IMETHOD_(bool) CanSkipReal(void *p, bool aRemovingAllowed) MOZ_OVERRIDE; \ + NS_IMETHOD_(bool) CanSkipInCCReal(void *p) MOZ_OVERRIDE; \ + NS_IMETHOD_(bool) CanSkipThisReal(void *p) MOZ_OVERRIDE; \ NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class) \ }; \ NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL(_class) \ @@ -590,7 +591,8 @@ class NS_CYCLE_COLLECTION_INNERCLASS : public nsXPCOMCycleCollectionParticipant \ { \ NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base) \ - NS_IMETHOD_(void) Trace(void *p, const TraceCallbacks &cb, void *closure); \ + NS_IMETHOD_(void) Trace(void *p, const TraceCallbacks &cb, void *closure) \ + MOZ_OVERRIDE; \ NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class) \ }; \ NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL(_class) \ @@ -606,10 +608,10 @@ public: : nsXPCOMCycleCollectionParticipant(true) {} \ private: \ NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base) \ - NS_IMETHOD_(void) Trace(void *p, const TraceCallbacks &cb, void *closure); \ - NS_IMETHOD_(bool) CanSkipReal(void *p, bool aRemovingAllowed); \ - NS_IMETHOD_(bool) CanSkipInCCReal(void *p); \ - NS_IMETHOD_(bool) CanSkipThisReal(void *p); \ + NS_IMETHOD_(void) Trace(void *p, const TraceCallbacks &cb, void *closure) MOZ_OVERRIDE; \ + NS_IMETHOD_(bool) CanSkipReal(void *p, bool aRemovingAllowed) MOZ_OVERRIDE; \ + NS_IMETHOD_(bool) CanSkipInCCReal(void *p) MOZ_OVERRIDE; \ + NS_IMETHOD_(bool) CanSkipThisReal(void *p) MOZ_OVERRIDE; \ NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class) \ }; \ NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL(_class) \ @@ -640,7 +642,8 @@ static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME; #define NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_BODY_NO_UNLINK(_class, \ _base_class) \ public: \ - NS_IMETHOD Traverse(void *p, nsCycleCollectionTraversalCallback &cb); \ + NS_IMETHOD Traverse(void *p, nsCycleCollectionTraversalCallback &cb) \ + MOZ_OVERRIDE; \ static _class* Downcast(nsISupports* s) \ { \ return static_cast<_class*>(static_cast<_base_class*>( \ @@ -649,7 +652,7 @@ public: \ #define NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_BODY(_class, _base_class) \ NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_BODY_NO_UNLINK(_class, _base_class) \ - NS_IMETHOD_(void) Unlink(void *p); + NS_IMETHOD_(void) Unlink(void *p) MOZ_OVERRIDE; #define NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(_class, _base_class) \ class NS_CYCLE_COLLECTION_INNERCLASS \ @@ -680,7 +683,8 @@ class NS_CYCLE_COLLECTION_INNERCLASS : public NS_CYCLE_COLLECTION_CLASSNAME(_base_class) \ { \ NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_BODY(_class, _base_class) \ - NS_IMETHOD_(void) Trace(void *p, const TraceCallbacks &cb, void *closure); \ + NS_IMETHOD_(void) Trace(void *p, const TraceCallbacks &cb, void *closure) \ + MOZ_OVERRIDE; \ NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class) \ }; \ NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHERITED(_class) \ @@ -690,11 +694,12 @@ static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME; #define NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS_BODY(_class) \ public: \ - NS_IMETHOD_(void) Root(void *n); \ - NS_IMETHOD_(void) Unlink(void *n); \ - NS_IMETHOD_(void) Unroot(void *n); \ - NS_IMETHOD Traverse(void *n, nsCycleCollectionTraversalCallback &cb); \ - NS_IMETHOD_(void) DeleteCycleCollectable(void *n) \ + NS_IMETHOD_(void) Root(void *n) MOZ_OVERRIDE; \ + NS_IMETHOD_(void) Unlink(void *n) MOZ_OVERRIDE; \ + NS_IMETHOD_(void) Unroot(void *n) MOZ_OVERRIDE; \ + NS_IMETHOD Traverse(void *n, nsCycleCollectionTraversalCallback &cb) \ + MOZ_OVERRIDE; \ + NS_IMETHOD_(void) DeleteCycleCollectable(void *n) MOZ_OVERRIDE \ { \ DowncastCCParticipant<_class>(n)->DeleteCycleCollectable(); \ } \ @@ -736,9 +741,9 @@ static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME; : nsCycleCollectionParticipant(true) {} \ private: \ NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS_BODY(_class) \ - NS_IMETHOD_(bool) CanSkipReal(void *p, bool aRemovingAllowed); \ - NS_IMETHOD_(bool) CanSkipInCCReal(void *p); \ - NS_IMETHOD_(bool) CanSkipThisReal(void *p); \ + NS_IMETHOD_(bool) CanSkipReal(void *p, bool aRemovingAllowed) MOZ_OVERRIDE;\ + NS_IMETHOD_(bool) CanSkipInCCReal(void *p) MOZ_OVERRIDE; \ + NS_IMETHOD_(bool) CanSkipThisReal(void *p) MOZ_OVERRIDE; \ static nsCycleCollectionParticipant* GetParticipant() \ { \ return &_class::NS_CYCLE_COLLECTION_INNERNAME; \ @@ -755,9 +760,9 @@ public: \ : nsCycleCollectionParticipant(true) {} \ private: \ NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS_BODY(_class) \ - NS_IMETHOD_(bool) CanSkipReal(void *p, bool aRemovingAllowed); \ - NS_IMETHOD_(bool) CanSkipInCCReal(void *p); \ - NS_IMETHOD_(bool) CanSkipThisReal(void *p); \ + NS_IMETHOD_(bool) CanSkipReal(void *p, bool aRemovingAllowed) MOZ_OVERRIDE; \ + NS_IMETHOD_(bool) CanSkipInCCReal(void *p) MOZ_OVERRIDE; \ + NS_IMETHOD_(bool) CanSkipThisReal(void *p) MOZ_OVERRIDE; \ static nsCycleCollectionParticipant* GetParticipant() \ { \ return &_class::NS_CYCLE_COLLECTION_INNERNAME; \ @@ -774,7 +779,8 @@ static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME; : public nsScriptObjectTracer \ { \ NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS_BODY(_class) \ - NS_IMETHOD_(void) Trace(void *p, const TraceCallbacks &cb, void *closure); \ + NS_IMETHOD_(void) Trace(void *p, const TraceCallbacks &cb, void *closure) \ + MOZ_OVERRIDE; \ static MOZ_CONSTEXPR nsScriptObjectTracer* GetParticipant() \ { \ return &_class::NS_CYCLE_COLLECTION_INNERNAME; \ diff --git a/xpcom/glue/nsIWeakReferenceUtils.h b/xpcom/glue/nsIWeakReferenceUtils.h index 466f5dc59970..2964cb91f781 100644 --- a/xpcom/glue/nsIWeakReferenceUtils.h +++ b/xpcom/glue/nsIWeakReferenceUtils.h @@ -39,7 +39,8 @@ public: { } - virtual nsresult NS_FASTCALL operator()(const nsIID& aIID, void**) const; + virtual nsresult NS_FASTCALL operator()(const nsIID& aIID, void**) const + MOZ_OVERRIDE; private: nsIWeakReference* MOZ_NON_OWNING_REF mWeakPtr; diff --git a/xpcom/glue/nsServiceManagerUtils.h b/xpcom/glue/nsServiceManagerUtils.h index 026b0929f812..86d5e7da0aa4 100644 --- a/xpcom/glue/nsServiceManagerUtils.h +++ b/xpcom/glue/nsServiceManagerUtils.h @@ -45,7 +45,8 @@ public: { } - virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const; + virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const + MOZ_OVERRIDE; protected: const char* mCategory; const char* mEntry; diff --git a/xpcom/string/nsAString.h b/xpcom/string/nsAString.h index e15ae81aec96..5ad82735d3f6 100644 --- a/xpcom/string/nsAString.h +++ b/xpcom/string/nsAString.h @@ -43,7 +43,7 @@ public: typedef char char_type; virtual int operator()(const char_type*, const char_type*, - uint32_t, uint32_t) const; + uint32_t, uint32_t) const MOZ_OVERRIDE; }; class nsCaseInsensitiveCStringArrayComparator diff --git a/xpcom/string/nsTSubstring.h b/xpcom/string/nsTSubstring.h index a7d5734c1984..313bc9523eef 100644 --- a/xpcom/string/nsTSubstring.h +++ b/xpcom/string/nsTSubstring.h @@ -43,7 +43,7 @@ public: } virtual int operator()(const char_type*, const char_type*, - uint32_t, uint32_t) const; + uint32_t, uint32_t) const MOZ_OVERRIDE; }; /**