bug 1122100 - more MOZ_OVERRIDE in xpcomish stuff r=froydnj
authorTrevor Saunders <trev.saunders@gmail.com>
Thu, 15 Jan 2015 11:36:10 -0500
changeset 253354 5183c96b9fb2af53cce4002b3dc0050fe9e4e149
parent 253353 a5c9550c4e4ff746fbd83399057f8fadf92de459
child 253355 8714804a7c658f2f503d2e66ab33ef184cc36f83
push id721
push userjlund@mozilla.com
push dateTue, 21 Apr 2015 23:03:33 +0000
treeherdermozilla-release@d27c9211ebb3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1122100
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1122100 - more MOZ_OVERRIDE in xpcomish stuff r=froydnj
intl/unicharutil/util/nsUnicharUtils.h
js/xpconnect/idl/nsIXPCScriptable.idl
xpcom/base/CycleCollectedJSRuntime.h
xpcom/base/nsAutoPtr.h
xpcom/ds/nsICollection.idl
xpcom/glue/nsArrayUtils.h
xpcom/glue/nsComponentManagerUtils.h
xpcom/glue/nsCycleCollectionParticipant.h
xpcom/glue/nsIWeakReferenceUtils.h
xpcom/glue/nsServiceManagerUtils.h
xpcom/string/nsAString.h
xpcom/string/nsTSubstring.h
--- a/intl/unicharutil/util/nsUnicharUtils.h
+++ b/intl/unicharutil/util/nsUnicharUtils.h
@@ -40,26 +40,26 @@ inline bool IsLowerCase(uint32_t c) {
 #ifdef MOZILLA_INTERNAL_API
 
 class nsCaseInsensitiveStringComparator : public nsStringComparator
 {
 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
 {
 public:
   virtual int32_t operator() (const char*,
                               const char*,
                               uint32_t,
-                              uint32_t) const;
+                              uint32_t) const MOZ_OVERRIDE;
 };
 
 class nsCaseInsensitiveStringArrayComparator
 {
 public:
   template<class A, class B>
   bool Equals(const A& a, const B& b) const {
     return a.Equals(b, nsCaseInsensitiveStringComparator());
@@ -68,17 +68,17 @@ public:
 
 class nsASCIICaseInsensitiveStringComparator : public nsStringComparator
 {
 public:
   nsASCIICaseInsensitiveStringComparator() {}
   virtual int operator() (const char16_t*,
                           const char16_t*,
                           uint32_t,
-                          uint32_t) const;
+                          uint32_t) const MOZ_OVERRIDE;
 };
 
 inline bool
 CaseInsensitiveFindInReadable(const nsAString& aPattern,
                               nsAString::const_iterator& aSearchStart,
                               nsAString::const_iterator& aSearchEnd)
 {
   return FindInReadable(aPattern, aSearchStart, aSearchEnd,
--- a/js/xpconnect/idl/nsIXPCScriptable.idl
+++ b/js/xpconnect/idl/nsIXPCScriptable.idl
@@ -151,18 +151,18 @@ interface nsIXPCScriptable : nsISupports
  { 0xb3, 0xf8, 0xeb, 0xf2, 0x13, 0x60, 0xfb, 0x7e } }
 
 class NS_NO_VTABLE nsXPCClassInfo : public nsIClassInfo,
                                     public nsIXPCScriptable
 {
 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;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsXPCClassInfo, NS_XPCCLASSINFO_IID)
 
 inline
 nsresult
--- a/xpcom/base/CycleCollectedJSRuntime.h
+++ b/xpcom/base/CycleCollectedJSRuntime.h
@@ -24,67 +24,69 @@ namespace js {
 struct Class;
 }
 
 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
 {
 public:
   MOZ_CONSTEXPR JSZoneParticipant(): nsCycleCollectionParticipant()
   {
   }
 
-  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;
 
 // Contains various stats about the cycle collection.
 struct CycleCollectorResults
 {
   CycleCollectorResults()
--- a/xpcom/base/nsAutoPtr.h
+++ b/xpcom/base/nsAutoPtr.h
@@ -766,17 +766,17 @@ class MOZ_STACK_CLASS nsQueryObject : pu
 {
 public:
   explicit nsQueryObject(T* aRawPtr)
     : mRawPtr(aRawPtr)
   {
   }
 
   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;
     return status;
   }
 private:
   T* MOZ_NON_OWNING_REF mRawPtr;
 };
--- a/xpcom/ds/nsICollection.idl
+++ b/xpcom/ds/nsICollection.idl
@@ -37,17 +37,18 @@ class MOZ_STACK_CLASS nsQueryElementAt :
       nsQueryElementAt( nsICollection* aCollection, uint32_t aIndex, nsresult* aErrorPtr )
           : mCollection(aCollection),
             mIndex(aIndex),
             mErrorPtr(aErrorPtr)
         {
           // 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;
       uint32_t        mIndex;
       nsresult*       mErrorPtr;
   };
 
 inline
--- a/xpcom/glue/nsArrayUtils.h
+++ b/xpcom/glue/nsArrayUtils.h
@@ -17,17 +17,18 @@ public:
   nsQueryArrayElementAt(nsIArray* aArray, uint32_t aIndex,
                         nsresult* aErrorPtr)
     : mArray(aArray)
     , mIndex(aIndex)
     , mErrorPtr(aErrorPtr)
   {
   }
 
-  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;
   uint32_t   mIndex;
   nsresult*  mErrorPtr;
 };
 
 inline const nsQueryArrayElementAt
--- a/xpcom/glue/nsComponentManagerUtils.h
+++ b/xpcom/glue/nsComponentManagerUtils.h
@@ -32,17 +32,18 @@ public:
   nsCreateInstanceByCID(const nsCID& aCID, nsISupports* aOuter,
                         nsresult* aErrorPtr)
     : mCID(aCID)
     , mOuter(aOuter)
     , mErrorPtr(aErrorPtr)
   {
   }
 
-  virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const;
+  virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const
+    MOZ_OVERRIDE;
 
 private:
   const nsCID&    mCID;
   nsISupports* MOZ_NON_OWNING_REF mOuter;
   nsresult*       mErrorPtr;
 };
 
 class MOZ_STACK_CLASS nsCreateInstanceByContractID : public nsCOMPtr_helper
@@ -51,17 +52,17 @@ public:
   nsCreateInstanceByContractID(const char* aContractID, nsISupports* aOuter,
                                nsresult* aErrorPtr)
     : mContractID(aContractID)
     , mOuter(aOuter)
     , mErrorPtr(aErrorPtr)
   {
   }
 
-  virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const;
+  virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const MOZ_OVERRIDE;
 
 private:
   const char*   mContractID;
   nsISupports* MOZ_NON_OWNING_REF mOuter;
   nsresult*     mErrorPtr;
 };
 
 class MOZ_STACK_CLASS nsCreateInstanceFromFactory : public nsCOMPtr_helper
@@ -70,17 +71,17 @@ public:
   nsCreateInstanceFromFactory(nsIFactory* aFactory, nsISupports* aOuter,
                               nsresult* aErrorPtr)
     : mFactory(aFactory)
     , mOuter(aOuter)
     , mErrorPtr(aErrorPtr)
   {
   }
 
-  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;
   nsISupports* MOZ_NON_OWNING_REF mOuter;
   nsresult*     mErrorPtr;
 };
 
 
@@ -127,33 +128,33 @@ class MOZ_STACK_CLASS nsGetClassObjectBy
 {
 public:
   nsGetClassObjectByCID(const nsCID& aCID, nsresult* aErrorPtr)
     : mCID(aCID)
     , mErrorPtr(aErrorPtr)
   {
   }
 
-  virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const;
+  virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const MOZ_OVERRIDE;
 
 private:
   const nsCID&    mCID;
   nsresult*       mErrorPtr;
 };
 
 class MOZ_STACK_CLASS nsGetClassObjectByContractID : public nsCOMPtr_helper
 {
 public:
   nsGetClassObjectByContractID(const char* aContractID, nsresult* aErrorPtr)
     : mContractID(aContractID)
     , mErrorPtr(aErrorPtr)
   {
   }
 
-  virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const;
+  virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const MOZ_OVERRIDE;
 
 private:
   const char*   mContractID;
   nsresult*     mErrorPtr;
 };
 
 /**
  * do_GetClassObject can be used to improve performance of callers
--- a/xpcom/glue/nsCycleCollectionParticipant.h
+++ b/xpcom/glue/nsCycleCollectionParticipant.h
@@ -177,17 +177,17 @@ public:
   {
   }
   MOZ_CONSTEXPR explicit nsScriptObjectTracer(bool aSkip)
     : nsCycleCollectionParticipant(aSkip)
   {
   }
 
   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);
 };
 
 class NS_NO_VTABLE nsXPCOMCycleCollectionParticipant : public nsScriptObjectTracer
 {
 public:
@@ -197,21 +197,21 @@ public:
   }
   MOZ_CONSTEXPR explicit nsXPCOMCycleCollectionParticipant(bool aSkip)
     : nsScriptObjectTracer(aSkip)
   {
   }
 
   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);
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsXPCOMCycleCollectionParticipant,
                               NS_XPCOMCYCLECOLLECTIONPARTICIPANT_IID)
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -502,18 +502,19 @@ DowncastCCParticipant(void* aPtr)
     NS_CHECK_FOR_RIGHT_PARTICIPANT_BODY(_class)
 #else
 #define NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL(_class)
 #define NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHERITED(_class)
 #endif
 
 #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();                \
   }                                                                            \
   static _class* Downcast(nsISupports* s)                                      \
   {                                                                            \
     return static_cast<_class*>(static_cast<_base*>(s));                       \
   }                                                                            \
   static nsISupports* Upcast(_class *p)                                        \
@@ -521,17 +522,17 @@ public:                                 
     return NS_ISUPPORTS_CAST(_base*, p);                                       \
   }                                                                            \
   template<typename T>                                                         \
   friend nsISupports*                                                          \
   ToSupports(T* p, NS_CYCLE_COLLECTION_INNERCLASS* dummy);
 
 #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<type*>(reinterpret_cast<const type*>(participant))
 
 #define NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                 \
   static MOZ_CONSTEXPR nsXPCOMCycleCollectionParticipant* GetParticipant()     \
   {                                                                            \
     return &_class::NS_CYCLE_COLLECTION_INNERNAME;                             \
@@ -568,53 +569,54 @@ static NS_CYCLE_COLLECTION_INNERCLASS NS
 class NS_CYCLE_COLLECTION_INNERCLASS                                             \
  : public nsXPCOMCycleCollectionParticipant                                      \
 {                                                                                \
 public:                                                                          \
   MOZ_CONSTEXPR NS_CYCLE_COLLECTION_INNERCLASS ()                                \
   : 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)                                      \
 static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;             \
 NOT_INHERITED_CANT_OVERRIDE
 
 #define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_CLASS(_class)                       \
         NS_DECL_CYCLE_COLLECTION_SKIPPABLE_CLASS_AMBIGUOUS(_class, _class)
 
 #define NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(_class, _base)          \
 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)                                            \
 static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME; \
 NOT_INHERITED_CANT_OVERRIDE
 
 #define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(_class, _base)   \
 class NS_CYCLE_COLLECTION_INNERCLASS                                                      \
  : public nsXPCOMCycleCollectionParticipant                                               \
 {                                                                                         \
 public:                                                                                   \
   MOZ_CONSTEXPR NS_CYCLE_COLLECTION_INNERCLASS ()                                         \
   : 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)                                               \
 static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME; \
 NOT_INHERITED_CANT_OVERRIDE
 
 #define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(_class)  \
   NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(_class, _class)
@@ -635,26 +637,27 @@ NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHE
 static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;
 
 #define NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(_class)  \
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(_class, _class)
 
 #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*>(                     \
       NS_CYCLE_COLLECTION_CLASSNAME(_base_class)::Downcast(s)));               \
   }
 
 #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                                           \
  : public NS_CYCLE_COLLECTION_CLASSNAME(_base_class)                           \
 {                                                                              \
 public:                                                                        \
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_BODY(_class, _base_class)           \
   NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                       \
@@ -675,31 +678,33 @@ NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHE
 static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;
 
 #define NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(_class,                 \
                                                                _base_class)            \
 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)                                  \
 static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;
 
 // Cycle collector participant declarations.
 
 #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();              \
     }                                                                          \
     static _class* Downcast(void* s)                                           \
     {                                                                          \
       return DowncastCCParticipant<_class>(s);                                 \
     }                                                                          \
     static void* Upcast(_class *p)                                             \
@@ -731,55 +736,56 @@ static NS_CYCLE_COLLECTION_INNERCLASS NS
   class NS_CYCLE_COLLECTION_INNERCLASS                                         \
    : public nsCycleCollectionParticipant                                       \
   {                                                                            \
   public:                                                                      \
     MOZ_CONSTEXPR NS_CYCLE_COLLECTION_INNERCLASS ()                            \
     : 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;                           \
     }                                                                          \
   };                                                                           \
   static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;
 
 #define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_NATIVE_CLASS_WITH_CUSTOM_DELETE(_class) \
 class NS_CYCLE_COLLECTION_INNERCLASS                                           \
  : public nsCycleCollectionParticipant                                         \
 {                                                                              \
 public:                                                                        \
   MOZ_CONSTEXPR NS_CYCLE_COLLECTION_INNERCLASS ()                              \
   : 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;                             \
   }                                                                            \
 };                                                                             \
 static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;
 
 #define NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(_class)            \
   void DeleteCycleCollectable(void)                                            \
   {                                                                            \
     delete this;                                                               \
   }                                                                            \
   class NS_CYCLE_COLLECTION_INNERCLASS                                         \
    : 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;                           \
     }                                                                          \
   };                                                                           \
   static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;
 
 #define NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(_class, _root_function)           \
--- a/xpcom/glue/nsIWeakReferenceUtils.h
+++ b/xpcom/glue/nsIWeakReferenceUtils.h
@@ -34,17 +34,18 @@ class MOZ_STACK_CLASS nsQueryReferent : 
 {
 public:
   nsQueryReferent(nsIWeakReference* aWeakPtr, nsresult* aError)
     : mWeakPtr(aWeakPtr)
     , mErrorPtr(aError)
   {
   }
 
-  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;
   nsresult*          mErrorPtr;
 };
 
 inline const nsQueryReferent
 do_QueryReferent(nsIWeakReference* aRawPtr, nsresult* aError = 0)
--- a/xpcom/glue/nsServiceManagerUtils.h
+++ b/xpcom/glue/nsServiceManagerUtils.h
@@ -40,17 +40,18 @@ public:
   nsGetServiceFromCategory(const char* aCategory, const char* aEntry,
                            nsresult* aErrorPtr)
     : mCategory(aCategory)
     , mEntry(aEntry)
     , mErrorPtr(aErrorPtr)
   {
   }
 
-  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;
   nsresult*                   mErrorPtr;
 };
 
 inline const nsGetServiceFromCategory
 do_GetServiceFromCategory(const char* aCategory, const char* aEntry,
--- a/xpcom/string/nsAString.h
+++ b/xpcom/string/nsAString.h
@@ -38,17 +38,17 @@ class nsCaseInsensitiveCStringComparator
 {
 public:
   nsCaseInsensitiveCStringComparator()
   {
   }
   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
 {
 public:
   template<class A, class B>
   bool Equals(const A& aStrA, const B& aStrB) const
   {
--- a/xpcom/string/nsTSubstring.h
+++ b/xpcom/string/nsTSubstring.h
@@ -38,17 +38,17 @@ class nsTDefaultStringComparator_CharT
 public:
   typedef CharT char_type;
 
   nsTDefaultStringComparator_CharT()
   {
   }
 
   virtual int operator()(const char_type*, const char_type*,
-                         uint32_t, uint32_t) const;
+                         uint32_t, uint32_t) const MOZ_OVERRIDE;
 };
 
 /**
  * nsTSubstring is the most abstract class in the string hierarchy. It
  * represents a single contiguous array of characters, which may or may not
  * be null-terminated. This type is not instantiated directly.  A sub-class
  * is instantiated instead.  For example, see nsTString.
  *