From 7c9ffeed9dd28b3e6d48e64fc8d7e72e74fed7f7 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Tue, 10 Mar 2015 13:44:02 +0100 Subject: [PATCH] Bug 1137151: Marked destructors of ref-counted GonkHAL classes as protected, r=dhylands --- hal/gonk/GonkHal.cpp | 12 +++++++++++- hal/gonk/GonkSwitch.cpp | 8 ++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/hal/gonk/GonkHal.cpp b/hal/gonk/GonkHal.cpp index 334ef8a8ad5..eaf3994204f 100644 --- a/hal/gonk/GonkHal.cpp +++ b/hal/gonk/GonkHal.cpp @@ -297,6 +297,9 @@ public: static bool ShuttingDown() { return sShuttingDown; } +protected: + ~VibratorRunnable() {} + private: Monitor mMonitor; @@ -471,7 +474,7 @@ public: } // anonymous namespace -class BatteryObserver : public IUeventObserver +class BatteryObserver MOZ_FINAL : public IUeventObserver { public: NS_INLINE_DECL_REFCOUNTING(BatteryObserver) @@ -495,6 +498,9 @@ public: } } +protected: + ~BatteryObserver() {} + private: nsRefPtr mUpdater; }; @@ -1172,6 +1178,10 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSIOBSERVER + +protected: + ~OomVictimLogger() {} + private: double mLastLineChecked; ScopedFreePtr mRegexes; diff --git a/hal/gonk/GonkSwitch.cpp b/hal/gonk/GonkSwitch.cpp index 65c9e1b6b2e..e7f18570149 100644 --- a/hal/gonk/GonkSwitch.cpp +++ b/hal/gonk/GonkSwitch.cpp @@ -61,10 +61,6 @@ public: GetInitialState(); } - virtual ~SwitchHandler() - { - } - bool CheckEvent(NetlinkEvent* aEvent) { if (strcmp(GetSubsystem(), aEvent->getSubsystem()) || @@ -86,6 +82,10 @@ public: return mDevice; } protected: + virtual ~SwitchHandler() + { + } + virtual const char* GetSubsystem() { return "switch";