Bug 1319741 - Use C++11's override and remove virtual where applicable in hal/. draft
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Wed, 23 Nov 2016 13:21:06 +0200
changeset 442858 dfe18c9ec05b184bbb59a1f6bb2a502989de4921
parent 442499 1a3194836cb4c3da6ba3a9742a2d25cf26669b55
child 537916 67d531aa03f6435df5970922e6122838dc4db592
push id36847
push userbmo:bpostelnicu@mozilla.com
push dateWed, 23 Nov 2016 11:24:53 +0000
bugs1319741
milestone53.0a1
Bug 1319741 - Use C++11's override and remove virtual where applicable in hal/. MozReview-Commit-ID: 94CcvRoR6zQ
hal/Hal.cpp
--- a/hal/Hal.cpp
+++ b/hal/Hal.cpp
@@ -259,105 +259,105 @@ public:
 
   void BroadcastCachedInformation() {
     this->BroadcastInformation(mInfo);
   }
 
 protected:
   virtual void GetCurrentInformationInternal(InfoType*) = 0;
 
-  virtual void OnNotificationsDisabled() {
+  void OnNotificationsDisabled() override {
     mHasValidCache = false;
   }
 
 private:
   InfoType                mInfo;
   bool                    mHasValidCache;
 };
 
 class BatteryObserversManager : public CachingObserversManager<BatteryInformation>
 {
 protected:
-  void EnableNotifications() {
+  void EnableNotifications() override {
     PROXY_IF_SANDBOXED(EnableBatteryNotifications());
   }
 
-  void DisableNotifications() {
+  void DisableNotifications() override {
     PROXY_IF_SANDBOXED(DisableBatteryNotifications());
   }
 
-  void GetCurrentInformationInternal(BatteryInformation* aInfo) {
+  void GetCurrentInformationInternal(BatteryInformation* aInfo) override {
     PROXY_IF_SANDBOXED(GetCurrentBatteryInformation(aInfo));
   }
 };
 
 static BatteryObserversManager&
 BatteryObservers()
 {
   static BatteryObserversManager sBatteryObservers;
   AssertMainThread();
   return sBatteryObservers;
 }
 
 class NetworkObserversManager : public CachingObserversManager<NetworkInformation>
 {
 protected:
-  void EnableNotifications() {
+  void EnableNotifications() override {
     PROXY_IF_SANDBOXED(EnableNetworkNotifications());
   }
 
-  void DisableNotifications() {
+  void DisableNotifications() override {
     PROXY_IF_SANDBOXED(DisableNetworkNotifications());
   }
 
-  void GetCurrentInformationInternal(NetworkInformation* aInfo) {
+  void GetCurrentInformationInternal(NetworkInformation* aInfo) override {
     PROXY_IF_SANDBOXED(GetCurrentNetworkInformation(aInfo));
   }
 };
 
 static NetworkObserversManager&
 NetworkObservers()
 {
   static NetworkObserversManager sNetworkObservers;
   AssertMainThread();
   return sNetworkObservers;
 }
 
 class WakeLockObserversManager : public ObserversManager<WakeLockInformation>
 {
 protected:
-  void EnableNotifications() {
+  void EnableNotifications() override {
     PROXY_IF_SANDBOXED(EnableWakeLockNotifications());
   }
 
-  void DisableNotifications() {
+  void DisableNotifications() override {
     PROXY_IF_SANDBOXED(DisableWakeLockNotifications());
   }
 };
 
 static WakeLockObserversManager&
 WakeLockObservers()
 {
   static WakeLockObserversManager sWakeLockObservers;
   AssertMainThread();
   return sWakeLockObservers;
 }
 
 class ScreenConfigurationObserversManager : public CachingObserversManager<ScreenConfiguration>
 {
 protected:
-  void EnableNotifications() {
+  void EnableNotifications() override {
     PROXY_IF_SANDBOXED(EnableScreenConfigurationNotifications());
   }
 
-  void DisableNotifications() {
+  void DisableNotifications() override {
     PROXY_IF_SANDBOXED(DisableScreenConfigurationNotifications());
   }
 
-  void GetCurrentInformationInternal(ScreenConfiguration* aInfo) {
+  void GetCurrentInformationInternal(ScreenConfiguration* aInfo) override {
     PROXY_IF_SANDBOXED(GetCurrentScreenConfiguration(aInfo));
   }
 };
 
 static ScreenConfigurationObserversManager&
 ScreenConfigurationObservers()
 {
   AssertMainThread();
@@ -444,21 +444,21 @@ void SetScreenBrightness(double aBrightn
 {
   AssertMainThread();
   PROXY_IF_SANDBOXED(SetScreenBrightness(clamped(aBrightness, 0.0, 1.0)));
 }
 
 class SystemClockChangeObserversManager : public ObserversManager<int64_t>
 {
 protected:
-  void EnableNotifications() {
+  void EnableNotifications() override {
     PROXY_IF_SANDBOXED(EnableSystemClockChangeNotifications());
   }
 
-  void DisableNotifications() {
+  void DisableNotifications() override {
     PROXY_IF_SANDBOXED(DisableSystemClockChangeNotifications());
   }
 };
 
 static SystemClockChangeObserversManager&
 SystemClockChangeObservers()
 {
   static SystemClockChangeObserversManager sSystemClockChangeObservers;
@@ -484,21 +484,21 @@ void
 NotifySystemClockChange(const int64_t& aClockDeltaMS)
 {
   SystemClockChangeObservers().BroadcastInformation(aClockDeltaMS);
 }
 
 class SystemTimezoneChangeObserversManager : public ObserversManager<SystemTimezoneChangeInformation>
 {
 protected:
-  void EnableNotifications() {
+  void EnableNotifications() override {
     PROXY_IF_SANDBOXED(EnableSystemTimezoneChangeNotifications());
   }
 
-  void DisableNotifications() {
+  void DisableNotifications() override {
     PROXY_IF_SANDBOXED(DisableSystemTimezoneChangeNotifications());
   }
 };
 
 static SystemTimezoneChangeObserversManager&
 SystemTimezoneChangeObservers()
 {
   static SystemTimezoneChangeObserversManager sSystemTimezoneChangeObservers;