Bug 984786 part 2: Mark destructor as protected or private in two refcounted a11y classes, and mark one as MOZ_FINAL. r=tbsaunde

This commit is contained in:
Daniel Holbert 2014-04-01 17:21:24 -07:00
parent 2f52a506b6
commit ff8c36d435
2 changed files with 11 additions and 4 deletions

View File

@ -26,8 +26,6 @@ class DocAccessible;
class Notification class Notification
{ {
public: public:
virtual ~Notification() { }
NS_INLINE_DECL_REFCOUNTING(Notification) NS_INLINE_DECL_REFCOUNTING(Notification)
/** /**
@ -38,6 +36,11 @@ public:
protected: protected:
Notification() { } Notification() { }
/**
* Protected destructor, to discourage deletion outside of Release():
*/
virtual ~Notification() { }
private: private:
Notification(const Notification&); Notification(const Notification&);
Notification& operator = (const Notification&); Notification& operator = (const Notification&);

View File

@ -20,7 +20,7 @@
using namespace mozilla; using namespace mozilla;
using namespace mozilla::a11y; using namespace mozilla::a11y;
struct mozilla::a11y::SelData struct mozilla::a11y::SelData MOZ_FINAL
{ {
SelData(Selection* aSel, int32_t aReason) : SelData(Selection* aSel, int32_t aReason) :
mSel(aSel), mReason(aReason) {} mSel(aSel), mReason(aReason) {}
@ -28,7 +28,11 @@ struct mozilla::a11y::SelData
nsRefPtr<Selection> mSel; nsRefPtr<Selection> mSel;
int16_t mReason; int16_t mReason;
NS_INLINE_DECL_REFCOUNTING(SelData); NS_INLINE_DECL_REFCOUNTING(SelData)
private:
// Private destructor, to discourage deletion outside of Release():
~SelData() {}
}; };
void void