Bug 1028588 - Fix dangerous public destructors in intl/ - r=ehsan
authorBenoit Jacob <bjacob@mozilla.com>
Mon, 23 Jun 2014 18:40:02 -0400
changeset 204152 12985d7bd06a6fb901b7c2fb55a5b86353d57660
parent 204151 461ad7d4f1ef5c99b4817b2ec3c9dbf8681e0b5e
child 204153 fdb81eed139712db471a6327ff3f98bb82d2e57e
push id6561
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 21:23:20 +0000
treeherdermozilla-aurora@428d4d3c8588 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1028588
milestone33.0a1
Bug 1028588 - Fix dangerous public destructors in intl/ - r=ehsan
intl/chardet/src/nsCyrillicDetector.h
intl/hyphenation/public/nsHyphenationManager.h
intl/locale/src/nsCollation.h
intl/locale/src/nsLocale.h
intl/locale/src/nsLocaleService.cpp
intl/locale/src/nsPlatformCharset.h
intl/locale/src/nsScriptableDateFormat.cpp
intl/locale/src/unix/nsCollationUnix.h
intl/locale/src/unix/nsDateTimeFormatUnix.h
intl/lwbrk/src/nsJISx4051LineBreaker.h
intl/lwbrk/src/nsSampleWordBreaker.h
intl/lwbrk/src/nsSemanticUnitScanner.h
intl/strres/src/nsStringBundle.h
intl/strres/src/nsStringBundleService.h
intl/strres/src/nsStringBundleTextOverride.cpp
intl/strres/src/nsStringBundleTextOverride.h
intl/uconv/public/nsUCSupport.h
intl/uconv/src/nsConverterInputStream.h
intl/uconv/src/nsScriptableUConv.h
intl/uconv/src/nsTextToSubURI.h
intl/uconv/src/nsUTF8ConverterService.h
intl/uconv/src/nsUnicodeToUTF8.h
intl/unicharutil/public/nsUnicodeNormalizer.h
intl/unicharutil/src/nsEntityConverter.h
intl/unicharutil/src/nsSaveAsCharset.h
--- a/intl/chardet/src/nsCyrillicDetector.h
+++ b/intl/chardet/src/nsCyrillicDetector.h
@@ -87,40 +87,40 @@ class nsCyrXPCOMDetector :
       public nsICharsetDetector
 {
   public:
     // nsISupports interface
     NS_DECL_ISUPPORTS
     nsCyrXPCOMDetector(uint8_t aItems, 
                       const uint8_t ** aCyrillicClass, 
                       const char **aCharsets);
-    virtual ~nsCyrXPCOMDetector();
     NS_IMETHOD Init(nsICharsetDetectionObserver* aObserver);
     NS_IMETHOD DoIt(const char* aBuf, uint32_t aLen, bool *oDontFeedMe);
     NS_IMETHOD Done();
   protected:
+    virtual ~nsCyrXPCOMDetector();
     virtual void Report(const char* aCharset);
   private:
     nsCOMPtr<nsICharsetDetectionObserver> mObserver;
 };
 
 class nsCyrXPCOMStringDetector :  
       public nsCyrillicDetector,
       public nsIStringCharsetDetector
 {
   public:
     // nsISupports interface
     NS_DECL_ISUPPORTS
     nsCyrXPCOMStringDetector(uint8_t aItems, 
                       const uint8_t ** aCyrillicClass, 
                       const char **aCharsets);
-    virtual ~nsCyrXPCOMStringDetector();
     NS_IMETHOD DoIt(const char* aBuf, uint32_t aLen, 
                      const char** oCharset, nsDetectionConfident &oConf);
   protected:
+    virtual ~nsCyrXPCOMStringDetector();
     virtual void Report(const char* aCharset);
   private:
     nsCOMPtr<nsICharsetDetectionObserver> mObserver;
     const char* mResult;
 };
 
 class nsRUProbDetector : public nsCyrXPCOMDetector
 {
--- a/intl/hyphenation/public/nsHyphenationManager.h
+++ b/intl/hyphenation/public/nsHyphenationManager.h
@@ -28,16 +28,18 @@ public:
   static void Shutdown();
 
 private:
   ~nsHyphenationManager();
 
 protected:
   class MemoryPressureObserver MOZ_FINAL : public nsIObserver
   {
+      ~MemoryPressureObserver() {}
+
   public:
       NS_DECL_ISUPPORTS
       NS_DECL_NSIOBSERVER
   };
 
   void LoadPatternList();
   void LoadPatternListFromOmnijar(mozilla::Omnijar::Type aType);
   void LoadPatternListFromDir(nsIFile *aDir);
--- a/intl/locale/src/nsCollation.h
+++ b/intl/locale/src/nsCollation.h
@@ -13,16 +13,18 @@
 #include "mozilla/Attributes.h"
 
 class nsIUnicodeEncoder;
 
 // Create a collation interface for an input locale.
 // 
 class nsCollationFactory MOZ_FINAL : public nsICollationFactory {
 
+  ~nsCollationFactory() {}
+
 public: 
   NS_DECL_ISUPPORTS 
 
   NS_IMETHOD CreateCollation(nsILocale* locale, nsICollation** instancePtr);
 
   nsCollationFactory() {}
 };
 
--- a/intl/locale/src/nsLocale.h
+++ b/intl/locale/src/nsLocale.h
@@ -25,28 +25,28 @@
 #include "plhash.h"
 
 class nsLocale : public nsILocale {
 	friend class nsLocaleService;
 	NS_DECL_THREADSAFE_ISUPPORTS
 
 public:
 	nsLocale(void);
-	virtual ~nsLocale(void);
 	
 	/* Declare methods from nsILocale */
 	NS_DECL_NSILOCALE
 
 protected:
 	
 	NS_IMETHOD AddCategory(const nsAString& category, const nsAString& value);
 
 	static PLHashNumber Hash_HashFunction(const void* key);
 	static int Hash_CompareNSString(const void* s1, const void* s2);
 	static int Hash_EnumerateDelete(PLHashEntry *he, int hashIndex, void *arg);
 
 	PLHashTable*	fHashtable;
 	uint32_t		fCategoryCount;
 
+        virtual ~nsLocale(void);
 };
 
 
 #endif
--- a/intl/locale/src/nsLocaleService.cpp
+++ b/intl/locale/src/nsLocaleService.cpp
@@ -76,26 +76,26 @@ public:
 
 	//
 	// nsILocaleService
 	//
     NS_DECL_NSILOCALESERVICE
 
 
 	nsLocaleService(void);
-	virtual ~nsLocaleService(void);
 
 protected:
 
 	nsresult SetSystemLocale(void);
 	nsresult SetApplicationLocale(void);
 
 	nsCOMPtr<nsILocale>				mSystemLocale;
 	nsCOMPtr<nsILocale>				mApplicationLocale;
 
+        virtual ~nsLocaleService(void);
 };
 
 //
 // nsLocaleService methods
 //
 nsLocaleService::nsLocaleService(void) 
 {
 #ifdef XP_WIN
--- a/intl/locale/src/nsPlatformCharset.h
+++ b/intl/locale/src/nsPlatformCharset.h
@@ -9,26 +9,27 @@
 
 class nsPlatformCharset : public nsIPlatformCharset
 {
   NS_DECL_ISUPPORTS
 
 public:
 
   nsPlatformCharset();
-  virtual ~nsPlatformCharset();
 
   NS_IMETHOD Init();
   NS_IMETHOD GetCharset(nsPlatformCharsetSel selector, nsACString& oResult);
   NS_IMETHOD GetDefaultCharsetForLocale(const nsAString& localeName, nsACString& oResult);
 
 private:
   nsCString mCharset;
   nsString mLocale; // remember the locale & charset
 
   nsresult MapToCharset(nsAString& inANSICodePage, nsACString& outCharset);
   nsresult InitGetCharset(nsACString& oString);
   nsresult VerifyCharset(nsCString &aCharset);
+
+  virtual ~nsPlatformCharset();
 };
 
 #endif // nsPlatformCharset_h__
 
 
--- a/intl/locale/src/nsScriptableDateFormat.cpp
+++ b/intl/locale/src/nsScriptableDateFormat.cpp
@@ -42,19 +42,21 @@ class nsScriptableDateFormat : public ns
                         int32_t hour, 
                         int32_t minute, 
                         int32_t second, 
                         char16_t **timeString)
                         {return FormatDateTime(locale, kDateFormatNone, timeFormatSelector, 
                                                1999, 1, 1, hour, minute, second, timeString);}
 
   nsScriptableDateFormat() {}
-  virtual ~nsScriptableDateFormat() {}
+
 private:
   nsString mStringOut;   
+
+  virtual ~nsScriptableDateFormat() {}
 };
 
 NS_IMPL_ISUPPORTS(nsScriptableDateFormat, nsIScriptableDateFormat)
 
 NS_IMETHODIMP nsScriptableDateFormat::FormatDateTime(
                             const char16_t *aLocale, 
                             nsDateFormatSelector dateFormatSelector, 
                             nsTimeFormatSelector timeFormatSelector, 
--- a/intl/locale/src/unix/nsCollationUnix.h
+++ b/intl/locale/src/unix/nsCollationUnix.h
@@ -22,19 +22,20 @@ protected:
   nsCollation   *mCollation;
   nsCString     mLocale;
   nsCString     mSavedLocale;
   bool          mUseCodePointOrder;
 
   void DoSetLocale();
   void DoRestoreLocale();
 
-public: 
+  ~nsCollationUnix(); 
+
+public:
   nsCollationUnix();
-  ~nsCollationUnix(); 
 
   // nsISupports interface
   NS_DECL_ISUPPORTS
 
   // nsICollation interface
   NS_DECL_NSICOLLATION
 
 };
--- a/intl/locale/src/unix/nsDateTimeFormatUnix.h
+++ b/intl/locale/src/unix/nsDateTimeFormatUnix.h
@@ -45,19 +45,19 @@ public:
                                   const nsDateFormatSelector  dateFormatSelector, 
                                   const nsTimeFormatSelector timeFormatSelector, 
                                   const PRExplodedTime*  explodedTime, 
                                   nsAString& stringOut); 
 
 
   nsDateTimeFormatUnix() {mLocale.Truncate();mAppLocale.Truncate();}
 
+private:
   virtual ~nsDateTimeFormatUnix() {}
 
-private:
   // init this interface to a specified locale
   NS_IMETHOD Initialize(nsILocale* locale);
 
   void LocalePreferred24hour();
 
   nsString    mLocale;
   nsString    mAppLocale;
   nsCString   mCharset;        // in order to convert API result to unicode
--- a/intl/lwbrk/src/nsJISx4051LineBreaker.h
+++ b/intl/lwbrk/src/nsJISx4051LineBreaker.h
@@ -7,19 +7,21 @@
 
 
 #include "nsILineBreaker.h"
 
 class nsJISx4051LineBreaker : public nsILineBreaker
 {
   NS_DECL_ISUPPORTS
 
+private:
+  virtual ~nsJISx4051LineBreaker();
+
 public:
   nsJISx4051LineBreaker();
-  virtual ~nsJISx4051LineBreaker();
 
   int32_t Next( const char16_t* aText, uint32_t aLen, uint32_t aPos);
 
   int32_t Prev( const char16_t* aText, uint32_t aLen, uint32_t aPos);
 
   virtual void GetJISx4051Breaks(const char16_t* aText, uint32_t aLength,
                                  uint8_t aBreakMode,
                                  uint8_t* aBreakBefore);
--- a/intl/lwbrk/src/nsSampleWordBreaker.h
+++ b/intl/lwbrk/src/nsSampleWordBreaker.h
@@ -20,22 +20,23 @@ typedef enum {
 } wb_class;
 
 class nsSampleWordBreaker : public nsIWordBreaker
 {
   NS_DECL_ISUPPORTS
 public:
 
   nsSampleWordBreaker() ;
-  virtual ~nsSampleWordBreaker() ;
 
   bool BreakInBetween(const char16_t* aText1 , uint32_t aTextLen1,
                         const char16_t* aText2 , uint32_t aTextLen2);
   nsWordRange FindWord(const char16_t* aText1 , uint32_t aTextLen1,
                        uint32_t aOffset);
 
   int32_t NextWord(const char16_t* aText, uint32_t aLen, uint32_t aPos);
 
 protected:
   uint8_t  GetClass(char16_t aChar);
+
+  virtual ~nsSampleWordBreaker();
 };
 
 #endif  /* nsSampleWordBreaker_h__ */
--- a/intl/lwbrk/src/nsSemanticUnitScanner.h
+++ b/intl/lwbrk/src/nsSemanticUnitScanner.h
@@ -13,13 +13,15 @@
 class nsSemanticUnitScanner : public nsISemanticUnitScanner
                             , public nsSampleWordBreaker
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSISEMANTICUNITSCANNER
 
   nsSemanticUnitScanner();
+
+private:
   virtual ~nsSemanticUnitScanner();
   /* additional members */
 };
 
 #endif
--- a/intl/strres/src/nsStringBundle.h
+++ b/intl/strres/src/nsStringBundle.h
@@ -16,24 +16,25 @@ class nsIPersistentProperties;
 class nsIStringBundleOverride;
 
 class nsStringBundle : public nsIStringBundle
 {
 public:
     // init version
     nsStringBundle(const char* aURLSpec, nsIStringBundleOverride*);
     nsresult LoadProperties();
-    virtual ~nsStringBundle();
 
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSISTRINGBUNDLE
 
     nsCOMPtr<nsIPersistentProperties> mProps;
 
 protected:
+    virtual ~nsStringBundle();
+
     //
     // functional decomposition of the funitions repeatively called
     //
     nsresult GetStringFromID(int32_t aID, nsAString& aResult);
     nsresult GetStringFromName(const nsAString& aName, nsAString& aResult);
 
     nsresult GetCombinedEnumeration(nsIStringBundleOverride* aOverrideString,
                                     nsISimpleEnumerator** aResult);
@@ -45,16 +46,26 @@ private:
     bool                         mLoaded;
 
 public:
     static nsresult FormatString(const char16_t *formatStr,
                                  const char16_t **aParams, uint32_t aLength,
                                  char16_t **aResult);
 };
 
+class nsExtensibleStringBundle;
+
+namespace mozilla {
+template<>
+struct HasDangerousPublicDestructor<nsExtensibleStringBundle>
+{
+  static const bool value = true;
+};
+}
+
 /**
  * An extensible implementation of the StringBundle interface.
  *
  * @created         28/Dec/1999
  * @author  Catalin Rotaru [CATA]
  */
 class nsExtensibleStringBundle : public nsIStringBundle
 {
--- a/intl/strres/src/nsStringBundleService.h
+++ b/intl/strres/src/nsStringBundleService.h
@@ -21,25 +21,26 @@
 struct bundleCacheEntry_t;
 
 class nsStringBundleService : public nsIStringBundleService,
                               public nsIObserver,
                               public nsSupportsWeakReference
 {
 public:
   nsStringBundleService();
-  virtual ~nsStringBundleService();
 
   nsresult Init();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSISTRINGBUNDLESERVICE
   NS_DECL_NSIOBSERVER
 
 private:
+  virtual ~nsStringBundleService();
+
   nsresult getStringBundle(const char *aUrl, nsIStringBundle** aResult);
   nsresult FormatWithBundle(nsIStringBundle* bundle, nsresult aStatus,
                             uint32_t argCount, char16_t** argArray,
                             char16_t* *result);
 
   void flushBundleCache();
 
   bundleCacheEntry_t *insertIntoCache(already_AddRefed<nsIStringBundle> aBundle,
--- a/intl/strres/src/nsStringBundleTextOverride.cpp
+++ b/intl/strres/src/nsStringBundleTextOverride.cpp
@@ -14,24 +14,25 @@
 // cuts out the leading URL from the key
 class URLPropertyElement : public nsIPropertyElement
 {
 public:
     URLPropertyElement(nsIPropertyElement *aRealElement, uint32_t aURLLength) :
         mRealElement(aRealElement),
         mURLLength(aURLLength)
     { }
-    virtual ~URLPropertyElement() {}
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIPROPERTYELEMENT
-    
+
 private:
     nsCOMPtr<nsIPropertyElement> mRealElement;
     uint32_t mURLLength;
+
+    virtual ~URLPropertyElement() {}
 };
 
 NS_IMPL_ISUPPORTS(URLPropertyElement, nsIPropertyElement)
 
 // we'll tweak the key on the way through, and remove the url prefix
 NS_IMETHODIMP
 URLPropertyElement::GetKey(nsACString& aKey)
 {
@@ -85,28 +86,29 @@ public:
         // that character
         mURL.ReplaceSubstring(":", "%3A");
         // there is always a # between the url and the real key
         mURL.Append('#');
     }
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSISIMPLEENUMERATOR
-    
-    virtual ~nsPropertyEnumeratorByURL() {}
+
 private:
 
     // actual enumerator of all strings from nsIProperties
     nsCOMPtr<nsISimpleEnumerator> mOuter;
 
     // the current element that is valid for this url
     nsCOMPtr<nsIPropertyElement> mCurrent;
 
     // the url in question, pre-escaped and with the # already in it
     nsCString mURL;
+
+    virtual ~nsPropertyEnumeratorByURL() {}
 };
 
 //
 // nsStringBundleTextOverride implementation
 //
 NS_IMPL_ISUPPORTS(nsStringBundleTextOverride,
                   nsIStringBundleOverride)
 
--- a/intl/strres/src/nsStringBundleTextOverride.h
+++ b/intl/strres/src/nsStringBundleTextOverride.h
@@ -19,23 +19,23 @@
 
 #define NS_STRINGBUNDLETEXTOVERRIDE_CONTRACTID \
     "@mozilla.org/intl/stringbundle/text-override;1"
 
 // an implementation which does overrides from a text file
 
 class nsStringBundleTextOverride : public nsIStringBundleOverride
 {
- public:
+  public:
     nsStringBundleTextOverride() { }
-    virtual ~nsStringBundleTextOverride() {}
 
     nsresult Init();
-    
+
     NS_DECL_ISUPPORTS
     NS_DECL_NSISTRINGBUNDLEOVERRIDE
 
-private:
+  private:
     nsCOMPtr<nsIPersistentProperties> mValues;
-    
+
+    virtual ~nsStringBundleTextOverride() {}
 };
 
 #endif
--- a/intl/uconv/public/nsUCSupport.h
+++ b/intl/uconv/public/nsUCSupport.h
@@ -73,29 +73,29 @@ class nsBasicDecoderSupport : public nsI
 
 public:
 
   /**
    * Class constructor.
    */
   nsBasicDecoderSupport();
 
-  /**
-   * Class destructor.
-   */
-  virtual ~nsBasicDecoderSupport();
-
   //--------------------------------------------------------------------
   // Interface nsIUnicodeDecoder [declaration]
 
   virtual void SetInputErrorBehavior(int32_t aBehavior);
   virtual char16_t GetCharacterForUnMapped();
 
 protected:
   int32_t   mErrBehavior;
+
+  /**
+   * Class destructor.
+   */
+  virtual ~nsBasicDecoderSupport();
 };
 
 //----------------------------------------------------------------------
 // Class nsBufferDecoderSupport [declaration]
 
 /**
  * Support class for the Unicode decoders. 
  *
@@ -277,16 +277,17 @@ class nsBasicEncoder : public nsIUnicode
   NS_DECL_ISUPPORTS
 
 public:
   /**
    * Class constructor.
    */
   nsBasicEncoder();
 
+protected:
   /**
    * Class destructor.
    */
   virtual ~nsBasicEncoder();
 
 };
 //----------------------------------------------------------------------
 // Class nsEncoderSupport [declaration]
--- a/intl/uconv/src/nsConverterInputStream.h
+++ b/intl/uconv/src/nsConverterInputStream.h
@@ -35,21 +35,19 @@ class nsConverterInputStream : public ns
 
     nsConverterInputStream() :
         mLastErrorCode(NS_OK),
         mLeftOverBytes(0),
         mUnicharDataOffset(0),
         mUnicharDataLength(0),
         mReplacementChar(DEFAULT_REPLACEMENT_CHARACTER),
         mLineBuffer(nullptr) { }
-    
-    virtual ~nsConverterInputStream() { Close(); }
 
  private:
-
+    virtual ~nsConverterInputStream() { Close(); }
 
     uint32_t Fill(nsresult *aErrorCode);
     
     nsCOMPtr<nsIUnicodeDecoder> mConverter;
     FallibleTArray<char> mByteData;
     FallibleTArray<char16_t> mUnicharData;
     nsCOMPtr<nsIInputStream> mInput;
 
--- a/intl/uconv/src/nsScriptableUConv.h
+++ b/intl/uconv/src/nsScriptableUConv.h
@@ -14,19 +14,20 @@
 
 class nsScriptableUnicodeConverter : public nsIScriptableUnicodeConverter
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSISCRIPTABLEUNICODECONVERTER
 
   nsScriptableUnicodeConverter();
+
+protected:
   virtual ~nsScriptableUnicodeConverter();
 
-protected:
   nsCString mCharset;
   nsCOMPtr<nsIUnicodeEncoder> mEncoder;
   nsCOMPtr<nsIUnicodeDecoder> mDecoder;
   bool mIsInternal;
 
   nsresult FinishWithLength(char **_retval, int32_t* aLength);
   nsresult ConvertFromUnicodeWithLength(const nsAString& aSrc,
                                         int32_t* aOutLen,
--- a/intl/uconv/src/nsTextToSubURI.h
+++ b/intl/uconv/src/nsTextToSubURI.h
@@ -10,19 +10,20 @@
 
 //==============================================================
 class nsTextToSubURI: public nsITextToSubURI {
   NS_DECL_ISUPPORTS
   NS_DECL_NSITEXTTOSUBURI
 
 public:
   nsTextToSubURI();
+
+private:
   virtual ~nsTextToSubURI();
 
-private:
   // IRI is "Internationalized Resource Identifiers"
   // http://www.ietf.org/internet-drafts/draft-duerst-iri-01.txt
   // 
   // if the IRI option is true then we assume that the URI is encoded as UTF-8
   // note: there is no definite way to distinguish between IRI and a URI encoded 
   // with a non-UTF-8 charset
   // Use this option carefully -- it may cause dataloss
   // (recommended to set to true for UI purpose only)
--- a/intl/uconv/src/nsUTF8ConverterService.h
+++ b/intl/uconv/src/nsUTF8ConverterService.h
@@ -4,16 +4,26 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsUTF8ConverterService_h__
 #define nsUTF8ConverterService_h__
 
 #include "nsIUTF8ConverterService.h"
 
 //==============================================================
 
+class nsUTF8ConverterService;
+
+namespace mozilla {
+template<>
+struct HasDangerousPublicDestructor<nsUTF8ConverterService>
+{
+  static const bool value = true;
+};
+}
+
 class nsUTF8ConverterService: public nsIUTF8ConverterService {
   NS_DECL_ISUPPORTS
   NS_DECL_NSIUTF8CONVERTERSERVICE
 
 public:
   nsUTF8ConverterService() {}
   virtual ~nsUTF8ConverterService() {}
 };
--- a/intl/uconv/src/nsUnicodeToUTF8.h
+++ b/intl/uconv/src/nsUnicodeToUTF8.h
@@ -25,16 +25,18 @@
 /**
  * A character set converter from Unicode to UTF8.
  *
  * @created         05/Apr/1999
  * @author  Catalin Rotaru [CATA]
  */
 class nsUnicodeToUTF8 MOZ_FINAL : public nsIUnicodeEncoder
 {
+  ~nsUnicodeToUTF8() {}
+
   NS_DECL_ISUPPORTS
 
 public:
 
   /**
    * Class constructor.
    */
   nsUnicodeToUTF8() {mHighSurrogate = 0;}
--- a/intl/unicharutil/public/nsUnicodeNormalizer.h
+++ b/intl/unicharutil/public/nsUnicodeNormalizer.h
@@ -12,24 +12,26 @@
 #include "nsIUnicodeNormalizer.h"
 
 nsresult NS_NewUnicodeNormalizer(nsISupports** oResult);
 
 
 class nsUnicodeNormalizer : public nsIUnicodeNormalizer {
 public:
    nsUnicodeNormalizer();
-   virtual ~nsUnicodeNormalizer();
 
    NS_DECL_ISUPPORTS 
 
    NS_IMETHOD NormalizeUnicodeNFD( const nsAString& aSrc, nsAString& aDest);
    NS_IMETHOD NormalizeUnicodeNFC( const nsAString& aSrc, nsAString& aDest);
    NS_IMETHOD NormalizeUnicodeNFKD( const nsAString& aSrc, nsAString& aDest);
    NS_IMETHOD NormalizeUnicodeNFKC( const nsAString& aSrc, nsAString& aDest);
 
    // low-level access to the composition data needed for HarfBuzz callbacks
    static bool Compose(uint32_t a, uint32_t b, uint32_t *ab);
    static bool DecomposeNonRecursively(uint32_t comp, uint32_t *c1, uint32_t *c2);
+
+private:
+   virtual ~nsUnicodeNormalizer();
 };
 
 #endif //nsUnicodeNormalizer_h__
 
--- a/intl/unicharutil/src/nsEntityConverter.h
+++ b/intl/unicharutil/src/nsEntityConverter.h
@@ -25,17 +25,16 @@ public:
 class nsEntityConverter: public nsIEntityConverter
 {
 public:
 	
 	//
 	// implementation methods
 	//
 	nsEntityConverter();
-	virtual ~nsEntityConverter();
 
 	//
 	// nsISupports
 	//
 	NS_DECL_ISUPPORTS
 
 	//
 	// nsIEntityConverter
@@ -57,11 +56,13 @@ protected:
   nsIStringBundle* GetVersionBundleInstance(uint32_t versionNumber);
 
   // load a string bundle file
   already_AddRefed<nsIStringBundle> LoadEntityBundle(uint32_t version);
 
 
   nsEntityVersionList *mVersionList;            // array of version number/name pairs
   uint32_t mVersionListLength;                  // number of supported versions
+
+  virtual ~nsEntityConverter();
 };
 
 #endif
--- a/intl/unicharutil/src/nsSaveAsCharset.h
+++ b/intl/unicharutil/src/nsSaveAsCharset.h
@@ -23,17 +23,16 @@ class nsIEntityConverter;
 class nsSaveAsCharset : public nsISaveAsCharset
 {
 public:
 	
 	//
 	// implementation methods
 	//
   nsSaveAsCharset();
-  virtual ~nsSaveAsCharset();
 
 	//
 	// nsISupports
 	//
 	NS_DECL_ISUPPORTS
 
 	//
 	// nsIEntityConverter
@@ -41,16 +40,18 @@ public:
   NS_IMETHOD Init(const char *charset, uint32_t attr, uint32_t entityVersion);
 
   NS_IMETHOD Convert(const char16_t *inString, char **_retval);
 
   NS_IMETHODIMP GetCharset(char * *aCharset);
 
 protected:
 
+  virtual ~nsSaveAsCharset();
+
   NS_IMETHOD DoCharsetConversion(const char16_t *inString, char **outString);
 
   NS_IMETHOD DoConversionFallBack(uint32_t inUCS4, char *outString, int32_t bufferLength);
 
   // do the fallback, reallocate the buffer if necessary
   // need to pass destination buffer info (size, current position and estimation of rest of the conversion)
   NS_IMETHOD HandleFallBack(uint32_t character, char **outString, int32_t *bufferLength, 
                             int32_t *currentPos, int32_t estimatedLength);