Bug 1119268 - Mark virtual overridden functions as MOZ_OVERRIDE in misc code; r=bsmedberg
☠☠ backed out by 38250fe6e828 ☠ ☠
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 08 Jan 2015 10:18:00 -0500
changeset 250543 c034dba7a4175196c0dcaeb466751f7ee31b7d51
parent 250542 3a5fe7c44ce4223afd05e0d5135b00f219922664
child 250544 671a52fff391a9fb805e3a05e7e337d89e8142d5
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1119268
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 1119268 - Mark virtual overridden functions as MOZ_OVERRIDE in misc code; r=bsmedberg
caps/nsNullPrincipalURI.h
caps/nsPrincipal.h
docshell/base/IHistory.h
dom/audiochannel/tests/TestAudioChannelService.cpp
extensions/cookie/nsPermissionManager.cpp
extensions/universalchardet/src/xpcom/nsUdetXPCOMWrapper.h
hal/sandbox/SandboxHal.cpp
image/src/MultipartImage.cpp
storage/test/test_async_callbacks_with_spun_event_loops.cpp
--- a/caps/nsNullPrincipalURI.h
+++ b/caps/nsNullPrincipalURI.h
@@ -26,18 +26,18 @@
 class nsNullPrincipalURI MOZ_FINAL : public nsIURI
                                    , public nsISizeOf
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIURI
 
   // nsISizeOf
-  virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
-  virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
+  virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
+  virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
 
   explicit nsNullPrincipalURI(const nsCString &aSpec);
 
 private:
   ~nsNullPrincipalURI() {}
 
   nsCString mScheme;
   nsCString mPath;
--- a/caps/nsPrincipal.h
+++ b/caps/nsPrincipal.h
@@ -44,35 +44,35 @@ protected:
   nsCOMPtr<nsIContentSecurityPolicy> mCSP;
 };
 
 class nsPrincipal MOZ_FINAL : public nsBasePrincipal
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSISERIALIZABLE
-  NS_IMETHOD Equals(nsIPrincipal* other, bool* _retval);
-  NS_IMETHOD EqualsConsideringDomain(nsIPrincipal* other, bool* _retval);
-  NS_IMETHOD GetHashValue(uint32_t* aHashValue);
-  NS_IMETHOD GetURI(nsIURI** aURI);
-  NS_IMETHOD GetDomain(nsIURI** aDomain);
-  NS_IMETHOD SetDomain(nsIURI* aDomain);
-  NS_IMETHOD GetOrigin(char** aOrigin);
-  NS_IMETHOD Subsumes(nsIPrincipal* other, bool* _retval);
-  NS_IMETHOD SubsumesConsideringDomain(nsIPrincipal* other, bool* _retval);
-  NS_IMETHOD CheckMayLoad(nsIURI* uri, bool report, bool allowIfInheritsPrincipal);
-  NS_IMETHOD GetJarPrefix(nsACString& aJarPrefix);
-  NS_IMETHOD GetAppStatus(uint16_t* aAppStatus);
-  NS_IMETHOD GetAppId(uint32_t* aAppStatus);
-  NS_IMETHOD GetIsInBrowserElement(bool* aIsInBrowserElement);
-  NS_IMETHOD GetUnknownAppId(bool* aUnknownAppId);
-  NS_IMETHOD GetIsNullPrincipal(bool* aIsNullPrincipal);
-  NS_IMETHOD GetBaseDomain(nsACString& aBaseDomain);
+  NS_IMETHOD Equals(nsIPrincipal* other, bool* _retval) MOZ_OVERRIDE;
+  NS_IMETHOD EqualsConsideringDomain(nsIPrincipal* other, bool* _retval) MOZ_OVERRIDE;
+  NS_IMETHOD GetHashValue(uint32_t* aHashValue) MOZ_OVERRIDE;
+  NS_IMETHOD GetURI(nsIURI** aURI) MOZ_OVERRIDE;
+  NS_IMETHOD GetDomain(nsIURI** aDomain) MOZ_OVERRIDE;
+  NS_IMETHOD SetDomain(nsIURI* aDomain) MOZ_OVERRIDE;
+  NS_IMETHOD GetOrigin(char** aOrigin) MOZ_OVERRIDE;
+  NS_IMETHOD Subsumes(nsIPrincipal* other, bool* _retval) MOZ_OVERRIDE;
+  NS_IMETHOD SubsumesConsideringDomain(nsIPrincipal* other, bool* _retval) MOZ_OVERRIDE;
+  NS_IMETHOD CheckMayLoad(nsIURI* uri, bool report, bool allowIfInheritsPrincipal) MOZ_OVERRIDE;
+  NS_IMETHOD GetJarPrefix(nsACString& aJarPrefix) MOZ_OVERRIDE;
+  NS_IMETHOD GetAppStatus(uint16_t* aAppStatus) MOZ_OVERRIDE;
+  NS_IMETHOD GetAppId(uint32_t* aAppStatus) MOZ_OVERRIDE;
+  NS_IMETHOD GetIsInBrowserElement(bool* aIsInBrowserElement) MOZ_OVERRIDE;
+  NS_IMETHOD GetUnknownAppId(bool* aUnknownAppId) MOZ_OVERRIDE;
+  NS_IMETHOD GetIsNullPrincipal(bool* aIsNullPrincipal) MOZ_OVERRIDE;
+  NS_IMETHOD GetBaseDomain(nsACString& aBaseDomain) MOZ_OVERRIDE;
 #ifdef DEBUG
-  virtual void dumpImpl();
+  virtual void dumpImpl() MOZ_OVERRIDE;
 #endif
 
   nsPrincipal();
 
   // Init() must be called before the principal is in a usable state.
   nsresult Init(nsIURI* aCodebase,
                 uint32_t aAppId,
                 bool aInMozBrowser);
@@ -127,35 +127,35 @@ public:
 
 protected:
   virtual ~nsExpandedPrincipal();
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIEXPANDEDPRINCIPAL
   NS_DECL_NSISERIALIZABLE
-  NS_IMETHOD Equals(nsIPrincipal* other, bool* _retval);
-  NS_IMETHOD EqualsConsideringDomain(nsIPrincipal* other, bool* _retval);
-  NS_IMETHOD GetHashValue(uint32_t* aHashValue);
-  NS_IMETHOD GetURI(nsIURI** aURI);
-  NS_IMETHOD GetDomain(nsIURI** aDomain);
-  NS_IMETHOD SetDomain(nsIURI* aDomain);
-  NS_IMETHOD GetOrigin(char** aOrigin);
-  NS_IMETHOD Subsumes(nsIPrincipal* other, bool* _retval);
-  NS_IMETHOD SubsumesConsideringDomain(nsIPrincipal* other, bool* _retval);
-  NS_IMETHOD CheckMayLoad(nsIURI* uri, bool report, bool allowIfInheritsPrincipal);
-  NS_IMETHOD GetJarPrefix(nsACString& aJarPrefix);
-  NS_IMETHOD GetAppStatus(uint16_t* aAppStatus);
-  NS_IMETHOD GetAppId(uint32_t* aAppStatus);
-  NS_IMETHOD GetIsInBrowserElement(bool* aIsInBrowserElement);
-  NS_IMETHOD GetUnknownAppId(bool* aUnknownAppId);
-  NS_IMETHOD GetIsNullPrincipal(bool* aIsNullPrincipal);
-  NS_IMETHOD GetBaseDomain(nsACString& aBaseDomain);
+  NS_IMETHOD Equals(nsIPrincipal* other, bool* _retval) MOZ_OVERRIDE;
+  NS_IMETHOD EqualsConsideringDomain(nsIPrincipal* other, bool* _retval) MOZ_OVERRIDE;
+  NS_IMETHOD GetHashValue(uint32_t* aHashValue) MOZ_OVERRIDE;
+  NS_IMETHOD GetURI(nsIURI** aURI) MOZ_OVERRIDE;
+  NS_IMETHOD GetDomain(nsIURI** aDomain) MOZ_OVERRIDE;
+  NS_IMETHOD SetDomain(nsIURI* aDomain) MOZ_OVERRIDE;
+  NS_IMETHOD GetOrigin(char** aOrigin) MOZ_OVERRIDE;
+  NS_IMETHOD Subsumes(nsIPrincipal* other, bool* _retval) MOZ_OVERRIDE;
+  NS_IMETHOD SubsumesConsideringDomain(nsIPrincipal* other, bool* _retval) MOZ_OVERRIDE;
+  NS_IMETHOD CheckMayLoad(nsIURI* uri, bool report, bool allowIfInheritsPrincipal) MOZ_OVERRIDE;
+  NS_IMETHOD GetJarPrefix(nsACString& aJarPrefix) MOZ_OVERRIDE;
+  NS_IMETHOD GetAppStatus(uint16_t* aAppStatus) MOZ_OVERRIDE;
+  NS_IMETHOD GetAppId(uint32_t* aAppStatus) MOZ_OVERRIDE;
+  NS_IMETHOD GetIsInBrowserElement(bool* aIsInBrowserElement) MOZ_OVERRIDE;
+  NS_IMETHOD GetUnknownAppId(bool* aUnknownAppId) MOZ_OVERRIDE;
+  NS_IMETHOD GetIsNullPrincipal(bool* aIsNullPrincipal) MOZ_OVERRIDE;
+  NS_IMETHOD GetBaseDomain(nsACString& aBaseDomain) MOZ_OVERRIDE;
 #ifdef DEBUG
-  virtual void dumpImpl();
+  virtual void dumpImpl() MOZ_OVERRIDE;
 #endif
   
   virtual void GetScriptLocation(nsACString &aStr) MOZ_OVERRIDE;
 
 private:
   nsTArray< nsCOMPtr<nsIPrincipal> > mPrincipals;
 };
 
--- a/docshell/base/IHistory.h
+++ b/docshell/base/IHistory.h
@@ -127,20 +127,20 @@ public:
      */
     NS_IMETHOD NotifyVisited(nsIURI* aURI) = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(IHistory, IHISTORY_IID)
 
 #define NS_DECL_IHISTORY \
     NS_IMETHOD RegisterVisitedCallback(nsIURI *aURI, \
-                                       mozilla::dom::Link *aContent); \
+                                       mozilla::dom::Link *aContent) MOZ_OVERRIDE; \
     NS_IMETHOD UnregisterVisitedCallback(nsIURI *aURI, \
-                                         mozilla::dom::Link *aContent); \
+                                         mozilla::dom::Link *aContent) MOZ_OVERRIDE; \
     NS_IMETHOD VisitURI(nsIURI *aURI, \
                         nsIURI *aLastVisitedURI, \
-                        uint32_t aFlags); \
-    NS_IMETHOD SetURITitle(nsIURI* aURI, const nsAString& aTitle); \
-    NS_IMETHOD NotifyVisited(nsIURI* aURI);
+                        uint32_t aFlags) MOZ_OVERRIDE; \
+    NS_IMETHOD SetURITitle(nsIURI* aURI, const nsAString& aTitle) MOZ_OVERRIDE; \
+    NS_IMETHOD NotifyVisited(nsIURI* aURI) MOZ_OVERRIDE;
 
 } // namespace mozilla
 
 #endif // mozilla_IHistory_h_
--- a/dom/audiochannel/tests/TestAudioChannelService.cpp
+++ b/dom/audiochannel/tests/TestAudioChannelService.cpp
@@ -98,24 +98,24 @@ public:
   nsresult SetVisibilityState(bool visible)
   {
     if (mRegistered) {
       mWaitCallback = true;
     }
     return mAgent->SetVisibilityState(visible);
   }
 
-  NS_IMETHODIMP CanPlayChanged(int32_t canPlay)
+  NS_IMETHODIMP CanPlayChanged(int32_t canPlay) MOZ_OVERRIDE
   {
     mCanPlay = static_cast<AudioChannelState>(canPlay);
     mWaitCallback = false;
     return NS_OK;
   }
 
-  NS_IMETHODIMP WindowVolumeChanged()
+  NS_IMETHODIMP WindowVolumeChanged() MOZ_OVERRIDE
   {
     return NS_OK;
   }
 
   nsresult GetCanPlay(AudioChannelState *_ret, bool aWaitCallback = false)
   {
     if (aWaitCallback) {
       mWaitCallback = true;
--- a/extensions/cookie/nsPermissionManager.cpp
+++ b/extensions/cookie/nsPermissionManager.cpp
@@ -188,17 +188,17 @@ GetNextSubDomainForHost(const nsACString
 class AppClearDataObserver MOZ_FINAL : public nsIObserver {
   ~AppClearDataObserver() {}
 
 public:
   NS_DECL_ISUPPORTS
 
   // nsIObserver implementation.
   NS_IMETHODIMP
-  Observe(nsISupports *aSubject, const char *aTopic, const char16_t *data)
+  Observe(nsISupports *aSubject, const char *aTopic, const char16_t *data) MOZ_OVERRIDE
   {
     MOZ_ASSERT(!nsCRT::strcmp(aTopic, "webapps-clear-data"));
 
     nsCOMPtr<mozIApplicationClearPrivateDataParams> params =
       do_QueryInterface(aSubject);
     if (!params) {
       NS_ERROR("'webapps-clear-data' notification's subject should be a mozIApplicationClearPrivateDataParams");
       return NS_ERROR_UNEXPECTED;
--- a/extensions/universalchardet/src/xpcom/nsUdetXPCOMWrapper.h
+++ b/extensions/universalchardet/src/xpcom/nsUdetXPCOMWrapper.h
@@ -24,40 +24,40 @@
 //=====================================================================
 class nsXPCOMDetector :  
       public nsUniversalDetector,
       public nsICharsetDetector
 {
   NS_DECL_ISUPPORTS
   public:
     nsXPCOMDetector();
-    NS_IMETHOD Init(nsICharsetDetectionObserver* aObserver);
-    NS_IMETHOD DoIt(const char* aBuf, uint32_t aLen, bool *oDontFeedMe);
-    NS_IMETHOD Done();
+    NS_IMETHOD Init(nsICharsetDetectionObserver* aObserver) MOZ_OVERRIDE;
+    NS_IMETHOD DoIt(const char* aBuf, uint32_t aLen, bool *oDontFeedMe) MOZ_OVERRIDE;
+    NS_IMETHOD Done() MOZ_OVERRIDE;
   protected:
     virtual ~nsXPCOMDetector();
-    virtual void Report(const char* aCharset);
+    virtual void Report(const char* aCharset) MOZ_OVERRIDE;
   private:
     nsCOMPtr<nsICharsetDetectionObserver> mObserver;
 };
 
 
 //=====================================================================
 class nsXPCOMStringDetector :  
       public nsUniversalDetector,
       public nsIStringCharsetDetector
 {
   NS_DECL_ISUPPORTS
   public:
     nsXPCOMStringDetector();
     NS_IMETHOD DoIt(const char* aBuf, uint32_t aLen, 
-                    const char** oCharset, nsDetectionConfident &oConf);
+                    const char** oCharset, nsDetectionConfident &oConf) MOZ_OVERRIDE;
   protected:
     virtual ~nsXPCOMStringDetector();
-    virtual void Report(const char* aCharset);
+    virtual void Report(const char* aCharset) MOZ_OVERRIDE;
   private:
     nsCOMPtr<nsICharsetDetectionObserver> mObserver;
     const char* mResult;
 };
 
 //=====================================================================
 
 class nsJAPSMDetector : public nsXPCOMDetector
--- a/hal/sandbox/SandboxHal.cpp
+++ b/hal/sandbox/SandboxHal.cpp
@@ -565,17 +565,17 @@ public:
   }
 
   virtual bool
   RecvGetCurrentNetworkInformation(NetworkInformation* aNetworkInfo) MOZ_OVERRIDE {
     hal::GetCurrentNetworkInformation(aNetworkInfo);
     return true;
   }
 
-  void Notify(const NetworkInformation& aNetworkInfo) {
+  void Notify(const NetworkInformation& aNetworkInfo) MOZ_OVERRIDE {
     unused << SendNotifyNetworkChange(aNetworkInfo);
   }
 
   virtual bool
   RecvEnableScreenConfigurationNotifications() MOZ_OVERRIDE {
     // Screen configuration is used to implement CSS and DOM
     // properties, so all content already has access to this.
     hal::RegisterScreenConfigurationObserver(this);
@@ -607,17 +607,17 @@ public:
 
   virtual bool
   RecvUnlockScreenOrientation() MOZ_OVERRIDE
   {
     hal::UnlockScreenOrientation();
     return true;
   }
 
-  void Notify(const ScreenConfiguration& aScreenConfiguration) {
+  void Notify(const ScreenConfiguration& aScreenConfiguration) MOZ_OVERRIDE {
     unused << SendNotifyScreenConfigurationChange(aScreenConfiguration);
   }
 
   virtual bool
   RecvGetScreenEnabled(bool* aEnabled) MOZ_OVERRIDE
   {
     if (!AssertAppProcessPermission(this, "power")) {
       return false;
@@ -773,17 +773,17 @@ public:
   }
    
   virtual bool
   RecvDisableSensorNotifications(const SensorType &aSensor) MOZ_OVERRIDE {
     hal::UnregisterSensorObserver(aSensor, this);
     return true;
   }
   
-  void Notify(const SensorData& aSensorData) {
+  void Notify(const SensorData& aSensorData) MOZ_OVERRIDE {
     unused << SendNotifySensorChange(aSensorData);
   }
 
   virtual bool
   RecvModifyWakeLock(const nsString& aTopic,
                      const WakeLockControl& aLockAdjust,
                      const WakeLockControl& aHiddenAdjust,
                      const uint64_t& aProcessID) MOZ_OVERRIDE
@@ -812,17 +812,17 @@ public:
 
   virtual bool
   RecvGetWakeLockInfo(const nsString &aTopic, WakeLockInformation *aWakeLockInfo) MOZ_OVERRIDE
   {
     hal::GetWakeLockInfo(aTopic, aWakeLockInfo);
     return true;
   }
   
-  void Notify(const WakeLockInformation& aWakeLockInfo)
+  void Notify(const WakeLockInformation& aWakeLockInfo) MOZ_OVERRIDE
   {
     unused << SendNotifyWakeLockChange(aWakeLockInfo);
   }
 
   virtual bool
   RecvEnableSwitchNotifications(const SwitchDevice& aDevice) MOZ_OVERRIDE
   {
     // Content has no reason to listen to switch events currently.
@@ -832,35 +832,35 @@ public:
 
   virtual bool
   RecvDisableSwitchNotifications(const SwitchDevice& aDevice) MOZ_OVERRIDE
   {
     hal::UnregisterSwitchObserver(aDevice, this);
     return true;
   }
 
-  void Notify(const SwitchEvent& aSwitchEvent)
+  void Notify(const SwitchEvent& aSwitchEvent) MOZ_OVERRIDE
   {
     unused << SendNotifySwitchChange(aSwitchEvent);
   }
 
   virtual bool
   RecvGetCurrentSwitchState(const SwitchDevice& aDevice, hal::SwitchState *aState) MOZ_OVERRIDE
   {
     // Content has no reason to listen to switch events currently.
     *aState = hal::GetCurrentSwitchState(aDevice);
     return true;
   }
 
-  void Notify(const int64_t& aClockDeltaMS)
+  void Notify(const int64_t& aClockDeltaMS) MOZ_OVERRIDE
   {
     unused << SendNotifySystemClockChange(aClockDeltaMS);
   }
 
-  void Notify(const SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo)
+  void Notify(const SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo) MOZ_OVERRIDE
   {
     unused << SendNotifySystemTimezoneChange(aSystemTimezoneChangeInfo);
   }
 
   virtual bool
   RecvFactoryReset(const nsString& aReason) MOZ_OVERRIDE
   {
     if (!AssertAppProcessPermission(this, "power")) {
@@ -933,24 +933,24 @@ public:
 
   virtual bool
   RecvNotifySwitchChange(const mozilla::hal::SwitchEvent& aEvent) MOZ_OVERRIDE {
     hal::NotifySwitchChange(aEvent);
     return true;
   }
 
   virtual bool
-  RecvNotifySystemClockChange(const int64_t& aClockDeltaMS) {
+  RecvNotifySystemClockChange(const int64_t& aClockDeltaMS) MOZ_OVERRIDE {
     hal::NotifySystemClockChange(aClockDeltaMS);
     return true;
   }
 
   virtual bool
   RecvNotifySystemTimezoneChange(
-    const SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo) {
+    const SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo) MOZ_OVERRIDE {
     hal::NotifySystemTimezoneChange(aSystemTimezoneChangeInfo);
     return true;
   }
 };
 
 bool
 HalChild::RecvNotifySensorChange(const hal::SensorData &aSensorData) {
   hal::NotifySensorChange(aSensorData);
--- a/image/src/MultipartImage.cpp
+++ b/image/src/MultipartImage.cpp
@@ -13,17 +13,17 @@ namespace image {
 ///////////////////////////////////////////////////////////////////////////////
 // Helpers
 ///////////////////////////////////////////////////////////////////////////////
 
 class NextPartObserver : public IProgressObserver
 {
 public:
   MOZ_DECLARE_REFCOUNTED_TYPENAME(NextPartObserver)
-  NS_INLINE_DECL_REFCOUNTING(NextPartObserver)
+  NS_INLINE_DECL_REFCOUNTING(NextPartObserver, MOZ_OVERRIDE)
 
   explicit NextPartObserver(MultipartImage* aOwner)
     : mOwner(aOwner)
   {
     MOZ_ASSERT(mOwner);
   }
 
   void BeginObserving(Image* aImage)
--- a/storage/test/test_async_callbacks_with_spun_event_loops.cpp
+++ b/storage/test/test_async_callbacks_with_spun_event_loops.cpp
@@ -53,37 +53,37 @@ public:
 private:
   ~UnownedCallback()
   {
     sAlive = false;
     blocking_async_close(mDBConn);
   }
 
 public:
-  NS_IMETHOD HandleResult(mozIStorageResultSet* aResultSet)
+  NS_IMETHOD HandleResult(mozIStorageResultSet* aResultSet) MOZ_OVERRIDE
   {
     sResult = true;
     spin_events_loop_until_true(&mCompleted);
     if (!sAlive) {
       NS_RUNTIMEABORT("The statement callback was destroyed prematurely.");
     }
     return NS_OK;
   }
 
-  NS_IMETHOD HandleError(mozIStorageError* aError)
+  NS_IMETHOD HandleError(mozIStorageError* aError) MOZ_OVERRIDE
   {
     sError = true;
     spin_events_loop_until_true(&mCompleted);
     if (!sAlive) {
       NS_RUNTIMEABORT("The statement callback was destroyed prematurely.");
     }
     return NS_OK;
   }
 
-  NS_IMETHOD HandleCompletion(uint16_t aReason)
+  NS_IMETHOD HandleCompletion(uint16_t aReason) MOZ_OVERRIDE
   {
     mCompleted = true;
     return NS_OK;
   }
 
 protected:
   nsCOMPtr<mozIStorageConnection> mDBConn;
   bool mCompleted;