Bug 921472 - Minimize the #includes in intl/; r=smontagu
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 27 Sep 2013 12:45:04 -0400
changeset 162842 19af7baaf26e984eceec910174b968386bbd7ed2
parent 162841 6d0b41d53c320b89a04f7ec9ce55f4e0cbb4bf3f
child 162843 3f8e57e07eee72c5ec94b53c7ca4f955c95657e1
push idunknown
push userunknown
push dateunknown
reviewerssmontagu
bugs921472
milestone27.0a1
Bug 921472 - Minimize the #includes in intl/; r=smontagu
intl/chardet/src/nsChardetModule.cpp
intl/locale/src/mac/nsCollationMacUC.cpp
intl/locale/src/nsCharsetAlias.cpp
intl/locale/src/nsCollation.cpp
intl/locale/src/nsCollation.h
intl/locale/src/nsLanguageAtomService.cpp
intl/locale/src/nsLanguageAtomService.h
intl/locale/src/nsLocale.cpp
intl/locale/src/nsLocale.h
intl/locale/src/nsLocaleService.cpp
intl/locale/src/nsScriptableDateFormat.cpp
intl/locale/src/nsUConvPropertySearch.cpp
intl/locale/src/nsUConvPropertySearch.h
intl/locale/src/unix/nsCollationUnix.h
intl/lwbrk/src/nsCarbonBreaker.cpp
intl/lwbrk/src/nsJISx4051LineBreaker.cpp
intl/strres/src/nsStringBundle.cpp
intl/strres/src/nsStringBundle.h
intl/strres/src/nsStringBundleTextOverride.cpp
intl/uconv/src/nsCP1252ToUnicode.h
intl/uconv/src/nsCharsetConverterManager.cpp
intl/uconv/src/nsCharsetConverterManager.h
intl/uconv/src/nsConverterInputStream.cpp
intl/uconv/src/nsConverterInputStream.h
intl/uconv/src/nsConverterOutputStream.cpp
intl/uconv/src/nsConverterOutputStream.h
intl/uconv/src/nsISO88591ToUnicode.h
intl/uconv/src/nsMacRomanToUnicode.h
intl/uconv/src/nsScriptableUConv.cpp
intl/uconv/src/nsScriptableUConv.h
intl/uconv/src/nsTextToSubURI.cpp
intl/uconv/src/nsUConvModule.cpp
intl/uconv/src/nsUTF8ConverterService.cpp
intl/uconv/src/nsUTF8ToUnicode.cpp
intl/uconv/src/nsUTF8ToUnicode.h
intl/uconv/src/nsUnicodeToCP1252.h
intl/uconv/src/nsUnicodeToISO88591.h
intl/uconv/src/nsUnicodeToMacRoman.h
intl/uconv/src/nsUnicodeToUTF8.cpp
intl/uconv/src/nsUnicodeToUTF8.h
intl/uconv/ucvcn/nsGBKToUnicode.h
intl/uconv/ucvcn/nsHZToUnicode.h
intl/uconv/ucvcn/nsISO2022CNToUnicode.cpp
intl/uconv/ucvcn/nsISO2022CNToUnicode.h
intl/uconv/ucvcn/nsUnicodeToGB2312V2.h
intl/uconv/ucvcn/nsUnicodeToGBK.cpp
intl/uconv/ucvcn/nsUnicodeToGBK.h
intl/uconv/ucvcn/nsUnicodeToHZ.h
intl/uconv/ucvibm/nsCP850ToUnicode.h
intl/uconv/ucvibm/nsCP852ToUnicode.h
intl/uconv/ucvibm/nsCP855ToUnicode.h
intl/uconv/ucvibm/nsCP857ToUnicode.h
intl/uconv/ucvibm/nsCP862ToUnicode.h
intl/uconv/ucvibm/nsCP864ToUnicode.h
intl/uconv/ucvibm/nsUnicodeToCP850.h
intl/uconv/ucvibm/nsUnicodeToCP852.h
intl/uconv/ucvibm/nsUnicodeToCP855.h
intl/uconv/ucvibm/nsUnicodeToCP857.h
intl/uconv/ucvibm/nsUnicodeToCP862.h
intl/uconv/ucvibm/nsUnicodeToCP864.h
intl/uconv/ucvja/nsJapaneseToUnicode.cpp
intl/uconv/ucvja/nsJapaneseToUnicode.h
intl/uconv/ucvja/nsUnicodeToEUCJP.h
intl/uconv/ucvja/nsUnicodeToISO2022JP.cpp
intl/uconv/ucvja/nsUnicodeToJISx0201.h
intl/uconv/ucvja/nsUnicodeToSJIS.h
intl/uconv/ucvko/nsCP949ToUnicode.h
intl/uconv/ucvko/nsISO2022KRToUnicode.cpp
intl/uconv/ucvko/nsISO2022KRToUnicode.h
intl/uconv/ucvko/nsJohabToUnicode.h
intl/uconv/ucvko/nsUnicodeToCP949.h
intl/uconv/ucvko/nsUnicodeToJohab.h
intl/uconv/ucvlatin/nsISO88598EToUnicode.cpp
intl/uconv/ucvlatin/nsISO88598IToUnicode.cpp
intl/uconv/ucvlatin/nsISO88599ToUnicode.cpp
intl/uconv/ucvlatin/nsISO88599ToUnicode.h
intl/uconv/ucvlatin/nsUTF16ToUnicode.cpp
intl/uconv/ucvlatin/nsUnicodeToISO88598I.cpp
intl/uconv/ucvlatin/nsUnicodeToMUTF7.cpp
intl/uconv/util/nsUCConstructors.h
intl/uconv/util/nsUCSupport.cpp
intl/uconv/util/nsUnicodeDecodeHelper.cpp
intl/uconv/util/nsUnicodeDecodeHelper.h
intl/uconv/util/nsUnicodeEncodeHelper.cpp
intl/uconv/util/nsUnicodeEncodeHelper.h
intl/unicharutil/src/nsEntityConverter.cpp
intl/unicharutil/src/nsEntityConverter.h
intl/unicharutil/src/nsSaveAsCharset.cpp
intl/unicharutil/src/nsSaveAsCharset.h
intl/unicharutil/src/nsUnicodeNormalizer.cpp
intl/unicharutil/tests/NormalizationTest.cpp
intl/unicharutil/tests/UnicharSelfTest.cpp
intl/unicharutil/util/nsBidiUtils.cpp
intl/unicharutil/util/nsUnicharUtils.cpp
intl/unicharutil/util/nsUnicodeProperties.cpp
--- a/intl/chardet/src/nsChardetModule.cpp
+++ b/intl/chardet/src/nsChardetModule.cpp
@@ -1,17 +1,14 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ModuleUtils.h"
-#include "nsCOMPtr.h"
-#include "nsICategoryManager.h"
-#include "nsIServiceManager.h"
 
 #include "nsCharDetConstructors.h"
 
 NS_DEFINE_NAMED_CID(NS_RU_PROBDETECTOR_CID);
 NS_DEFINE_NAMED_CID(NS_UK_PROBDETECTOR_CID);
 NS_DEFINE_NAMED_CID(NS_RU_STRING_PROBDETECTOR_CID);
 NS_DEFINE_NAMED_CID(NS_UK_STRING_PROBDETECTOR_CID);
 
--- a/intl/locale/src/mac/nsCollationMacUC.cpp
+++ b/intl/locale/src/mac/nsCollationMacUC.cpp
@@ -2,16 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsCollationMacUC.h"
 #include "nsILocaleService.h"
 #include "nsIServiceManager.h"
 #include "prmem.h"
+#include "nsString.h"
 
 NS_IMPL_ISUPPORTS1(nsCollationMacUC, nsICollation)
 
 nsCollationMacUC::nsCollationMacUC() 
   : mInit(false)
   , mHasCollator(false)
   , mLocale(nullptr)
   , mLastStrength(-1)
--- a/intl/locale/src/nsCharsetAlias.cpp
+++ b/intl/locale/src/nsCharsetAlias.cpp
@@ -3,24 +3,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Util.h"
 
 #include "nsCharsetAlias.h"
 
 // for NS_ERROR_UCONV_NOCONV
-#include "nsEncoderDecoderUtils.h"
 #include "nsCharsetConverterManager.h"
 
-// for NS_IMPL_IDS only
-#include "nsIPlatformCharset.h"
-
-#include "nsReadableUtils.h"
-#include "nsUnicharUtils.h"
 #include "nsUConvPropertySearch.h"
 
 using namespace mozilla;
 
 // 
 static const char* kAliases[][3] = {
 #include "charsetalias.properties.h"
 };
--- a/intl/locale/src/nsCollation.cpp
+++ b/intl/locale/src/nsCollation.cpp
@@ -1,21 +1,20 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsIPlatformCharset.h"
-#include "nsIServiceManager.h"
-#include "nsIComponentManager.h"
 #include "nsCollation.h"
 #include "nsCollationCID.h"
 #include "nsUnicharUtils.h"
 #include "prmem.h"
-#include "nsReadableUtils.h"
+#include "nsIUnicodeEncoder.h"
+#include "nsICharsetConverterManager.h"
+#include "nsServiceManagerUtils.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 
 NS_DEFINE_CID(kCollationCID, NS_COLLATION_CID);
 
 NS_IMPL_ISUPPORTS1(nsCollationFactory, nsICollationFactory)
 
 nsresult nsCollationFactory::CreateCollation(nsILocale* locale, nsICollation** instancePtr)
--- a/intl/locale/src/nsCollation.h
+++ b/intl/locale/src/nsCollation.h
@@ -4,20 +4,20 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsCollation_h__
 #define nsCollation_h__
 
 
 #include "nsICollation.h"
-#include "nsICharsetConverterManager.h"
 #include "nsCOMPtr.h"
 #include "mozilla/Attributes.h"
 
+class nsIUnicodeEncoder;
 
 // Create a collation interface for an input locale.
 // 
 class nsCollationFactory MOZ_FINAL : public nsICollationFactory {
 
 public: 
   NS_DECL_ISUPPORTS 
 
--- a/intl/locale/src/nsLanguageAtomService.cpp
+++ b/intl/locale/src/nsLanguageAtomService.cpp
@@ -1,22 +1,20 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsIComponentManager.h"
 #include "nsLanguageAtomService.h"
 #include "nsICharsetConverterManager.h"
 #include "nsILocaleService.h"
-#include "nsXPIDLString.h"
 #include "nsUnicharUtils.h"
-#include "nsIServiceManager.h"
 #include "nsIAtom.h"
 #include "mozilla/Services.h"
+#include "nsServiceManagerUtils.h"
 
 NS_IMPL_ISUPPORTS1(nsLanguageAtomService, nsILanguageAtomService)
 
 nsLanguageAtomService::nsLanguageAtomService()
 {
 }
 
 nsresult
--- a/intl/locale/src/nsLanguageAtomService.h
+++ b/intl/locale/src/nsLanguageAtomService.h
@@ -2,17 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsCOMPtr.h"
 #include "nsICharsetConverterManager.h"
 #include "nsILanguageAtomService.h"
 #include "nsIStringBundle.h"
-#include "nsCRT.h"
 #include "nsInterfaceHashtable.h"
 #include "nsIAtom.h"
 #include "mozilla/Attributes.h"
 
 #define NS_LANGUAGEATOMSERVICE_CID \
   {0xB7C65853, 0x2996, 0x435E, {0x96, 0x54, 0xDC, 0xC1, 0x78, 0xAA, 0xB4, 0x8C}}
 
 class nsLanguageAtomService MOZ_FINAL : public nsILanguageAtomService
--- a/intl/locale/src/nsLocale.cpp
+++ b/intl/locale/src/nsLocale.cpp
@@ -1,21 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsString.h"
-#include "nsReadableUtils.h"
 #include "nsISupports.h"
 #include "nsILocale.h"
 #include "nsLocale.h"
-#include "nsLocaleCID.h"
-#include "nsCOMPtr.h"
-#include "nsVoidArray.h"
 #include "nsMemory.h"
 #include "nsCRT.h"
 
 #define LOCALE_HASH_SIZE  0xFF
 
 
 /* nsILocale */
 NS_IMPL_ISUPPORTS1(nsLocale, nsILocale)
--- a/intl/locale/src/nsLocale.h
+++ b/intl/locale/src/nsLocale.h
@@ -15,18 +15,17 @@
  *
  * Date         Modified by     Description of modification
  * 03/27/2000   IBM Corp.       Added PR_CALLBACK for Optlink
  *                               use in OS2
  */
 #ifndef nsLocale_h__
 #define nsLocale_h__
 
-#include "nsString.h"
-#include "nsTArray.h"
+#include "nsStringFwd.h"
 #include "nsILocale.h"
 #include "plhash.h"
 
 class nsLocale : public nsILocale {
 	friend class nsLocaleService;
 	NS_DECL_THREADSAFE_ISUPPORTS
 
 public:
--- a/intl/locale/src/nsLocaleService.cpp
+++ b/intl/locale/src/nsLocaleService.cpp
@@ -8,28 +8,27 @@
 #include <QtCore/QLocale>
 #endif
 
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "nsILocale.h"
 #include "nsILocaleService.h"
 #include "nsLocale.h"
-#include "nsLocaleCID.h"
-#include "nsServiceManagerUtils.h"
-#include "nsReadableUtils.h"
 #include "nsCRT.h"
 #include "prprf.h"
 #include "nsTArray.h"
+#include "nsString.h"
 
 #include <ctype.h>
 
 #if defined(XP_WIN)
 #  include "nsWin32Locale.h"
 #elif defined(XP_OS2)
+#  include "nsServiceManagerUtils.h"
 #  include "unidef.h"
 #  include "nsIOS2Locale.h"
 #elif defined(XP_MACOSX)
 #  include <Carbon/Carbon.h>
 #elif defined(XP_UNIX)
 #  include <locale.h>
 #  include <stdlib.h>
 #  include "nsPosixLocale.h"
--- a/intl/locale/src/nsScriptableDateFormat.cpp
+++ b/intl/locale/src/nsScriptableDateFormat.cpp
@@ -1,22 +1,19 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsIServiceManager.h"
-#include "nsIComponentManager.h"
-#include "nsLocaleCID.h"
 #include "nsILocaleService.h"
 #include "nsDateTimeFormatCID.h"
 #include "nsIDateTimeFormat.h"
 #include "nsIScriptableDateFormat.h"
-#include "nsCRT.h"
-#include "nsReadableUtils.h"
+#include "nsCOMPtr.h"
+#include "nsServiceManagerUtils.h"
 
 static NS_DEFINE_CID(kLocaleServiceCID, NS_LOCALESERVICE_CID);
 static NS_DEFINE_CID(kDateTimeFormatCID, NS_DATETIMEFORMAT_CID);
 
 class nsScriptableDateFormat : public nsIScriptableDateFormat {
  public: 
   NS_DECL_ISUPPORTS 
 
--- a/intl/locale/src/nsUConvPropertySearch.cpp
+++ b/intl/locale/src/nsUConvPropertySearch.cpp
@@ -1,14 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsUConvPropertySearch.h"
 #include "nsCRT.h"
+#include "nsString.h"
 
 // static
 nsresult
 nsUConvPropertySearch::SearchPropertyValue(const char* aProperties[][3],
                                            int32_t aNumberOfProperties,
                                            const nsACString& aKey,
                                            nsACString& aValue)
 {
--- a/intl/locale/src/nsUConvPropertySearch.h
+++ b/intl/locale/src/nsUConvPropertySearch.h
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsUConvPropertySearch_h_
 #define nsUConvPropertySearch_h_
 
-#include "nsString.h"
+#include "nsStringFwd.h"
 
 class nsUConvPropertySearch
 {
   public:
     /**
      * Looks up a property by value.
      *
      * @param aProperties
--- a/intl/locale/src/unix/nsCollationUnix.h
+++ b/intl/locale/src/unix/nsCollationUnix.h
@@ -7,16 +7,17 @@
 #ifndef nsCollationUnix_h__
 #define nsCollationUnix_h__
 
 
 #include "nsICollation.h"
 #include "nsCollation.h"  // static library
 #include "plstr.h"
 #include "mozilla/Attributes.h"
+#include "nsString.h"
 
 
 
 class nsCollationUnix MOZ_FINAL : public nsICollation {
 
 protected:
   nsCollation   *mCollation;
   nsCString     mLocale;
--- a/intl/lwbrk/src/nsCarbonBreaker.cpp
+++ b/intl/lwbrk/src/nsCarbonBreaker.cpp
@@ -1,15 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsComplexBreaker.h"
 #include <Carbon/Carbon.h>
+#include <stdint.h>
+#include "nsDebug.h"
+#include "nscore.h"
 
 void
 NS_GetComplexLineBreaks(const PRUnichar* aText, uint32_t aLength,
                         uint8_t* aBreakBefore)
 {
   NS_ASSERTION(aText, "aText shouldn't be null");
   TextBreakLocatorRef breakLocator;
 
--- a/intl/lwbrk/src/nsJISx4051LineBreaker.cpp
+++ b/intl/lwbrk/src/nsJISx4051LineBreaker.cpp
@@ -5,17 +5,16 @@
 
 
 
 #include "nsJISx4051LineBreaker.h"
 
 #include "jisx4051class.h"
 #include "nsComplexBreaker.h"
 #include "nsTArray.h"
-#include "nsUnicharUtils.h"
 
 /* 
 
    Simplification of Pair Table in JIS X 4051
 
    1. The Origion Table - in 4.1.3
 
    In JIS x 4051. The pair table is defined as below
--- a/intl/strres/src/nsStringBundle.cpp
+++ b/intl/strres/src/nsStringBundle.cpp
@@ -1,49 +1,38 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsStringBundle.h"
 #include "nsID.h"
 #include "nsString.h"
-#include "nsReadableUtils.h"
 #include "nsIStringBundle.h"
 #include "nsStringBundleService.h"
-#include "nsStringBundle.h"
 #include "nsStringBundleTextOverride.h"
-#include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIMutableArray.h"
 #include "nsArrayEnumerator.h"
 #include "nscore.h"
 #include "nsHashtable.h"
 #include "nsMemory.h"
-#include "plstr.h"
 #include "nsNetUtil.h"
-#include "nsIURL.h"
-#include "nsIComponentManager.h"
-#include "nsIMemory.h"
 #include "nsIObserverService.h"
 #include "nsCOMArray.h"
 #include "nsTextFormatter.h"
 #include "nsIErrorService.h"
 #include "nsICategoryManager.h"
 
-#include "nsPrintfCString.h"
 // for async loading
 #ifdef ASYNC_LOADING
 #include "nsIBinaryInputStream.h"
 #include "nsIStringStream.h"
 #endif
 
-#include "prenv.h"
-#include "nsCRT.h"
-
 using namespace mozilla;
 
 static NS_DEFINE_CID(kErrorServiceCID, NS_ERRORSERVICE_CID);
 static NS_DEFINE_CID(kPersistentPropertiesCID, NS_IPERSISTENTPROPERTIES_CID);
 
 nsStringBundle::~nsStringBundle()
 {
 }
--- a/intl/strres/src/nsStringBundle.h
+++ b/intl/strres/src/nsStringBundle.h
@@ -4,20 +4,21 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsStringBundle_h__
 #define nsStringBundle_h__
 
 #include "mozilla/ReentrantMonitor.h"
 #include "nsIStringBundle.h"
 #include "nsCOMPtr.h"
-#include "nsIPersistentProperties2.h"
 #include "nsString.h"
 #include "nsCOMArray.h"
-#include "nsIStringBundleOverride.h"
+
+class nsIPersistentProperties;
+class nsIStringBundleOverride;
 
 class nsStringBundle : public nsIStringBundle
 {
 public:
     // init version
     nsStringBundle(const char* aURLSpec, nsIStringBundleOverride*);
     nsresult LoadProperties();
     virtual ~nsStringBundle();
--- a/intl/strres/src/nsStringBundleTextOverride.cpp
+++ b/intl/strres/src/nsStringBundleTextOverride.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "nsStringBundleTextOverride.h"
 #include "nsString.h"
-#include "nsEscape.h"
 
 #include "nsNetUtil.h"
 #include "nsAppDirectoryServiceDefs.h"
 
 static NS_DEFINE_CID(kPersistentPropertiesCID, NS_IPERSISTENTPROPERTIES_CID);
 
 
 // first we need a simple class which wraps a nsIPropertyElement and
--- a/intl/uconv/src/nsCP1252ToUnicode.h
+++ b/intl/uconv/src/nsCP1252ToUnicode.h
@@ -1,17 +1,19 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsCP1252ToUnicode_h___
 #define nsCP1252ToUnicode_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 // Class ID for our CP1252ToUnicode charset converter
 // {7C657D15-EC5E-11d2-8AAC-00600811A836}
 #define NS_CP1252TOUNICODE_CID \
   { 0x7c657d15, 0xec5e, 0x11d2, {0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
 
 #define NS_CP1252TOUNICODE_CONTRACTID "@mozilla.org/intl/unicode/decoder;1?charset=windows-1252"
 
--- a/intl/uconv/src/nsCharsetConverterManager.cpp
+++ b/intl/uconv/src/nsCharsetConverterManager.cpp
@@ -1,32 +1,28 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsCOMPtr.h"
 #include "nsString.h"
-#include "nsReadableUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsCharsetAlias.h"
-#include "nsIServiceManager.h"
 #include "nsICategoryManager.h"
 #include "nsICharsetConverterManager.h"
 #include "nsEncoderDecoderUtils.h"
 #include "nsIStringBundle.h"
-#include "nsCRT.h"
 #include "nsTArray.h"
 #include "nsStringEnumerator.h"
-#include "nsThreadUtils.h"
 #include "mozilla/Services.h"
 
-#include "nsXPCOM.h"
 #include "nsComponentManagerUtils.h"
 #include "nsISupportsPrimitives.h"
+#include "nsServiceManagerUtils.h"
 
 // just for CONTRACTIDs
 #include "nsCharsetConverterManager.h"
 
 static nsIStringBundle * sDataBundle;
 static nsIStringBundle * sTitleBundle;
 
 // Class nsCharsetConverterManager [implementation]
--- a/intl/uconv/src/nsCharsetConverterManager.h
+++ b/intl/uconv/src/nsCharsetConverterManager.h
@@ -2,19 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsCharsetConverterManager_h__
 #define nsCharsetConverterManager_h__
 
 #include "nsISupports.h"
 #include "nsICharsetConverterManager.h"
-#include "nsIStringBundle.h"
-#include "nsInterfaceHashtable.h"
-#include "mozilla/Mutex.h"
 
 class nsCharsetAlias;
 
 class nsCharsetConverterManager : public nsICharsetConverterManager
 {
   friend class nsCharsetAlias;
 
   NS_DECL_THREADSAFE_ISUPPORTS
--- a/intl/uconv/src/nsConverterInputStream.cpp
+++ b/intl/uconv/src/nsConverterInputStream.cpp
@@ -1,19 +1,19 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsConverterInputStream.h"
 #include "nsIInputStream.h"
 #include "nsICharsetConverterManager.h"
-#include "nsIServiceManager.h"
 #include "nsReadLine.h"
 #include "nsStreamUtils.h"
+#include "nsServiceManagerUtils.h"
 #include <algorithm>
 
 #define CONVERTER_BUFFER_SIZE 8192
 
 NS_IMPL_ISUPPORTS3(nsConverterInputStream, nsIConverterInputStream,
                    nsIUnicharInputStream, nsIUnicharLineInputStream)
     
 static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
--- a/intl/uconv/src/nsConverterInputStream.h
+++ b/intl/uconv/src/nsConverterInputStream.h
@@ -1,17 +1,16 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIInputStream.h"
 #include "nsIConverterInputStream.h"
 #include "nsIUnicharLineInputStream.h"
-#include "nsString.h"
 #include "nsTArray.h"
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsIUnicodeDecoder.h"
 #include "nsReadLine.h"
 
 #define NS_CONVERTERINPUTSTREAM_CONTRACTID "@mozilla.org/intl/converter-input-stream;1"
 
--- a/intl/uconv/src/nsConverterOutputStream.cpp
+++ b/intl/uconv/src/nsConverterOutputStream.cpp
@@ -1,21 +1,20 @@
 /* vim:set expandtab ts=4 sw=4 sts=4 cin: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsCOMPtr.h"
-#include "nsAutoPtr.h"
 
-#include "nsIServiceManager.h"
 #include "nsIOutputStream.h"
 #include "nsICharsetConverterManager.h"
 
 #include "nsConverterOutputStream.h"
+#include "nsServiceManagerUtils.h"
 
 NS_IMPL_ISUPPORTS2(nsConverterOutputStream,
                    nsIUnicharOutputStream,
                    nsIConverterOutputStream)
 
 nsConverterOutputStream::~nsConverterOutputStream()
 {
     Close();
--- a/intl/uconv/src/nsConverterOutputStream.h
+++ b/intl/uconv/src/nsConverterOutputStream.h
@@ -1,17 +1,16 @@
 /* vim:set expandtab ts=4 sw=4 sts=4 cin: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NSCONVERTEROUTPUTSTREAM_H_
 #define NSCONVERTEROUTPUTSTREAM_H_
 
-#include "nsIOutputStream.h"
 #include "nsIConverterOutputStream.h"
 #include "nsCOMPtr.h"
 #include "mozilla/Attributes.h"
 
 class nsIUnicodeEncoder;
 class nsIOutputStream;
 
 /* ff8780a5-bbb1-4bc5-8ee7-057e7bc5c925 */
--- a/intl/uconv/src/nsISO88591ToUnicode.h
+++ b/intl/uconv/src/nsISO88591ToUnicode.h
@@ -1,17 +1,19 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsISO88591ToUnicode_h___
 #define nsISO88591ToUnicode_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 // Class ID for our ISO88591ToUnicode charset converter
 // {A3254CB0-8E20-11d2-8A98-00600811A836}
 #define NS_ISO88591TOUNICODE_CID \
   { 0xa3254cb0, 0x8e20, 0x11d2, {0x8a, 0x98, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
 
 #define NS_ISO88591TOUNICODE_CONTRACTID "@mozilla.org/intl/unicode/decoder;1?charset=ISO-8859-1"
 
--- a/intl/uconv/src/nsMacRomanToUnicode.h
+++ b/intl/uconv/src/nsMacRomanToUnicode.h
@@ -1,17 +1,19 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsMacRomanToUnicode_h___
 #define nsMacRomanToUnicode_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 // Class ID for our MacRomanToUnicode charset converter
 // {7B8556A1-EC79-11d2-8AAC-00600811A836}
 #define NS_MACROMANTOUNICODE_CID \
   { 0x7b8556a1, 0xec79, 0x11d2, {0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
 
 #define NS_MACROMANTOUNICODE_CONTRACTID "@mozilla.org/intl/unicode/decoder;1?charset=macintosh"
 
--- a/intl/uconv/src/nsScriptableUConv.cpp
+++ b/intl/uconv/src/nsScriptableUConv.cpp
@@ -1,23 +1,21 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsString.h"
-#include "nsReadableUtils.h"
-#include "nsIServiceManager.h"
 #include "nsICharsetConverterManager.h"
 #include "nsIScriptableUConv.h"
 #include "nsScriptableUConv.h"
 #include "nsIStringStream.h"
-#include "nsCRT.h"
 #include "nsComponentManagerUtils.h"
 #include "nsCharsetAlias.h"
+#include "nsServiceManagerUtils.h"
 
 /* Implementation file */
 NS_IMPL_ISUPPORTS1(nsScriptableUnicodeConverter, nsIScriptableUnicodeConverter)
 
 nsScriptableUnicodeConverter::nsScriptableUnicodeConverter()
 : mIsInternal(false)
 {
 }
--- a/intl/uconv/src/nsScriptableUConv.h
+++ b/intl/uconv/src/nsScriptableUConv.h
@@ -2,17 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #ifndef __nsScriptableUConv_h_
 #define __nsScriptableUConv_h_
 
-#include "nsICharsetConverterManager.h"
 #include "nsIScriptableUConv.h"
 
 class nsScriptableUnicodeConverter : public nsIScriptableUnicodeConverter
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSISCRIPTABLEUNICODECONVERTER
 
--- a/intl/uconv/src/nsTextToSubURI.cpp
+++ b/intl/uconv/src/nsTextToSubURI.cpp
@@ -1,21 +1,20 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "nsString.h"
 #include "nsIUnicodeEncoder.h"
 #include "nsICharsetConverterManager.h"
-#include "nsReadableUtils.h"
 #include "nsITextToSubURI.h"
-#include "nsIServiceManager.h"
 #include "nsEscape.h"
 #include "nsTextToSubURI.h"
 #include "nsCRT.h"
+#include "nsServiceManagerUtils.h"
 
 static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
 
 nsTextToSubURI::nsTextToSubURI()
 {
 }
 nsTextToSubURI::~nsTextToSubURI()
 {
--- a/intl/uconv/src/nsUConvModule.cpp
+++ b/intl/uconv/src/nsUConvModule.cpp
@@ -1,39 +1,28 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#include "nsCOMPtr.h"
-#include "nsCRT.h"
 #include "mozilla/ModuleUtils.h"
-#include "nsIComponentManager.h"
-#include "nsICategoryManager.h"
 #include "nsICharsetConverterManager.h"
 #include "nsEncoderDecoderUtils.h"
 #include "nsIUnicodeDecoder.h"
 #include "nsIUnicodeEncoder.h"
-#include "nsIServiceManager.h"
-
 
 #include "nsUConvCID.h"
 #include "nsCharsetConverterManager.h"
 #include "nsTextToSubURI.h"
 #include "nsUTF8ConverterService.h"
 #include "nsConverterInputStream.h"
 #include "nsConverterOutputStream.h"
 #include "nsScriptableUConv.h"
-
+#include "nsIOutputStream.h"
 #include "nsITextToSubURI.h"
 
-#include "nsIFile.h"
-
-#include "nsCRT.h"
-
-#include "nsUCSupport.h"
 #include "nsISO88591ToUnicode.h"
 #include "nsCP1252ToUnicode.h"
 #include "nsMacRomanToUnicode.h"
 #include "nsUTF8ToUnicode.h"
 #include "nsUnicodeToISO88591.h"
 #include "nsUnicodeToCP1252.h"
 #include "nsUnicodeToMacRoman.h"
 #include "nsUnicodeToUTF8.h"
@@ -218,17 +207,16 @@
 #include "nsUCvCnCID.h"
 #include "nsHZToUnicode.h"
 #include "nsUnicodeToHZ.h"
 #include "nsGBKToUnicode.h"
 #include "nsUnicodeToGBK.h"
 #include "nsGB2312ToUnicodeV2.h"
 #include "nsUnicodeToGB2312V2.h"
 #include "nsISO2022CNToUnicode.h"
-#include "nsUnicodeToISO2022CN.h"
 #include "gbku.h"
 
 NS_CONVERTER_REGISTRY_START
 NS_UCONV_REG_UNREG("ISO-8859-1", NS_ISO88591TOUNICODE_CID, NS_UNICODETOISO88591_CID)
 NS_UCONV_REG_UNREG("windows-1252", NS_CP1252TOUNICODE_CID, NS_UNICODETOCP1252_CID)
 NS_UCONV_REG_UNREG("macintosh", NS_MACROMANTOUNICODE_CID, NS_UNICODETOMACROMAN_CID)
 NS_UCONV_REG_UNREG("UTF-8", NS_UTF8TOUNICODE_CID, NS_UNICODETOUTF8_CID)
 
--- a/intl/uconv/src/nsUTF8ConverterService.cpp
+++ b/intl/uconv/src/nsUTF8ConverterService.cpp
@@ -1,22 +1,20 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:expandtab:shiftwidth=2:tabstop=4: 
  */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "nsString.h"
-#include "nsIUnicodeEncoder.h"
 #include "nsICharsetConverterManager.h"
-#include "nsReadableUtils.h"
-#include "nsIServiceManager.h"
 #include "nsUTF8ConverterService.h"
 #include "nsEscape.h"
 #include "nsAutoPtr.h"
+#include "nsServiceManagerUtils.h"
 
 NS_IMPL_ISUPPORTS1(nsUTF8ConverterService, nsIUTF8ConverterService)
 
 static nsresult 
 ToUTF8(const nsACString &aString, const char *aCharset,
        bool aAllowSubstitution, nsACString &aResult)
 {
   nsresult rv;
--- a/intl/uconv/src/nsUTF8ToUnicode.cpp
+++ b/intl/uconv/src/nsUTF8ToUnicode.cpp
@@ -1,18 +1,18 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsAlgorithm.h"
 #include "nsUCSupport.h"
 #include "nsUTF8ToUnicode.h"
 #include "mozilla/SSE.h"
+#include "nsCharTraits.h"
 #include <algorithm>
 
 #define UNICODE_BYTE_ORDER_MARK    0xFEFF
 
 static PRUnichar* EmitSurrogatePair(uint32_t ucs4, PRUnichar* aDest)
 {
   NS_ASSERTION(ucs4 > 0xFFFF, "Should be a supplementary character");
   ucs4 -= 0x00010000;
--- a/intl/uconv/src/nsUTF8ToUnicode.h
+++ b/intl/uconv/src/nsUTF8ToUnicode.h
@@ -1,16 +1,18 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsUTF8ToUnicode_h___
 #define nsUTF8ToUnicode_h___
 
+#include "nsUCSupport.h"
+
 // Class ID for our UTF8ToUnicode charset converter
 // {5534DDC0-DD96-11d2-8AAC-00600811A836}
 #define NS_UTF8TOUNICODE_CID \
   { 0x5534ddc0, 0xdd96, 0x11d2, {0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
 
 #define NS_UTF8TOUNICODE_CONTRACTID "@mozilla.org/intl/unicode/decoder;1?charset=UTF-8"
 
 //#define NS_ERROR_UCONV_NOUTF8TOUNICODE  
--- a/intl/uconv/src/nsUnicodeToCP1252.h
+++ b/intl/uconv/src/nsUnicodeToCP1252.h
@@ -1,17 +1,20 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsUnicodeToCP1252_h___
 #define nsUnicodeToCP1252_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
+
 // Class ID for our UnicodeToCP1252 charset converter
 // {7B8556AC-EC79-11d2-8AAC-00600811A836}
 #define NS_UNICODETOCP1252_CID \
   { 0x7b8556ac, 0xec79, 0x11d2, {0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
 
 #define NS_UNICODETOCP1252_CONTRACTID "@mozilla.org/intl/unicode/encoder;1?charset=windows-1252"
 
 //#define NS_ERROR_UCONV_NOUNICODETOCP1252  
--- a/intl/uconv/src/nsUnicodeToISO88591.h
+++ b/intl/uconv/src/nsUnicodeToISO88591.h
@@ -1,17 +1,19 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsUnicodeToISO88591_h___
 #define nsUnicodeToISO88591_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 // {920307B0-C6E8-11d2-8AA8-00600811A836}
 #define NS_UNICODETOISO88591_CID \
   { 0x920307b0, 0xc6e8, 0x11d2, {0x8a, 0xa8, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
 
 #define NS_UNICODETOISO88591_CONTRACTID "@mozilla.org/intl/unicode/encoder;1?charset=ISO-8859-1"
 
 //#define NS_ERROR_UCONV_NOUNICODETOISO88591  
--- a/intl/uconv/src/nsUnicodeToMacRoman.h
+++ b/intl/uconv/src/nsUnicodeToMacRoman.h
@@ -1,17 +1,19 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsUnicodeToMacRoman_h___
 #define nsUnicodeToMacRoman_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 // Class ID for our UnicodeToMacRoman charset converter
 // {7B8556AF-EC79-11d2-8AAC-00600811A836}
 #define NS_UNICODETOMACROMAN_CID \
   { 0x7b8556af, 0xec79, 0x11d2, {0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
 
 #define NS_UNICODETOMACROMAN_CONTRACTID "@mozilla.org/intl/unicode/encoder;1?charset=macintosh"
 
--- a/intl/uconv/src/nsUnicodeToUTF8.cpp
+++ b/intl/uconv/src/nsUnicodeToUTF8.cpp
@@ -1,18 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //----------------------------------------------------------------------
 // Global functions and data [declaration]
-#include "nsUCSupport.h"
 #include "nsUnicodeToUTF8.h"
-#include <string.h>
 
 NS_IMPL_ISUPPORTS1(nsUnicodeToUTF8, nsIUnicodeEncoder)
 
 //----------------------------------------------------------------------
 // nsUnicodeToUTF8 class [implementation]
 
 NS_IMETHODIMP nsUnicodeToUTF8::GetMaxLength(const PRUnichar * aSrc, 
                                               int32_t aSrcLength,
--- a/intl/uconv/src/nsUnicodeToUTF8.h
+++ b/intl/uconv/src/nsUnicodeToUTF8.h
@@ -2,16 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsUnicodeToUTF8_h___
 #define nsUnicodeToUTF8_h___
 
 #include "mozilla/Attributes.h"
+#include "nsIUnicodeEncoder.h"
 
 // Class ID for our UnicodeToUTF8 charset converter
 // {7C657D18-EC5E-11d2-8AAC-00600811A836}
 #define NS_UNICODETOUTF8_CID \
   { 0x7c657d18, 0xec5e, 0x11d2, {0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
 
 #define NS_UNICODETOUTF8_CONTRACTID "@mozilla.org/intl/unicode/encoder;1?charset=UTF-8"
 
--- a/intl/uconv/ucvcn/nsGBKToUnicode.h
+++ b/intl/uconv/ucvcn/nsGBKToUnicode.h
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsGBK2312ToUnicode_h___
 #define nsGBK2312ToUnicode_h___
 
 #include "nsCOMPtr.h"
 #include "nsIUnicodeDecoder.h"
 #include "nsUCSupport.h"
-#include "gbku.h"
+#include "nsGBKConvUtil.h"
 
 //----------------------------------------------------------------------
 // Class nsGBKToUnicode [declaration]
 
 /**
  * A character set converter from GBK to Unicode.
  * 
  *
--- a/intl/uconv/ucvcn/nsHZToUnicode.h
+++ b/intl/uconv/ucvcn/nsHZToUnicode.h
@@ -2,17 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsHZToUnicode_h___
 #define nsHZToUnicode_h___
 
 #include "nsUCSupport.h"
-#include "gbku.h"
+#include "nsGBKConvUtil.h"
 
 //----------------------------------------------------------------------
 // Class nsHZToUnicode [declaration]
 
 /**
  * A character set converter from GBK to Unicode.
  * 
  *
--- a/intl/uconv/ucvcn/nsISO2022CNToUnicode.cpp
+++ b/intl/uconv/ucvcn/nsISO2022CNToUnicode.cpp
@@ -1,16 +1,16 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "nsISO2022CNToUnicode.h"
 #include "nsUCSupport.h"
 #include "nsICharsetConverterManager.h"
-#include "nsIServiceManager.h"
+#include "nsServiceManagerUtils.h"
 
 static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
 
 NS_IMETHODIMP nsISO2022CNToUnicode::GB2312_To_Unicode(unsigned char *aSrc, int32_t aSrcLength, PRUnichar * aDest, int32_t * aDestLength)
 {
     nsresult rv;
 
     if(!mGB2312_Decoder) {
--- a/intl/uconv/ucvcn/nsISO2022CNToUnicode.h
+++ b/intl/uconv/ucvcn/nsISO2022CNToUnicode.h
@@ -1,16 +1,15 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsISO2022CNToUnicode_h__
 #define nsISO2022CNToUnicode_h__
 #include "nsCOMPtr.h"
-#include "nsISupports.h"
 #include "nsUCSupport.h"
 
 #define MBYTE       0x8e
 #undef PMASK
 #define PMASK       0xa0
 
 #define SI          0x0f 
 #define SO          0x0e
--- a/intl/uconv/ucvcn/nsUnicodeToGB2312V2.h
+++ b/intl/uconv/ucvcn/nsUnicodeToGB2312V2.h
@@ -2,17 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsUnicodeToGB2312V2_h___
 #define nsUnicodeToGB2312V2_h___
 
 #include "nsUCSupport.h"
-#include "gbku.h"
+#include "nsGBKConvUtil.h"
 
 //----------------------------------------------------------------------
 // Class nsUnicodeToGB2312V2 [declaration]
 
 /**
  * A character set converter from Unicode to GB2312.
  *
  * @created         06/Apr/1999
--- a/intl/uconv/ucvcn/nsUnicodeToGBK.cpp
+++ b/intl/uconv/ucvcn/nsUnicodeToGBK.cpp
@@ -11,17 +11,17 @@
  * Revision History
  * 04/Oct/1999. Yueheng Xu: used table gUnicodeToGBKTable[0x5200] to make 
  *              Unicode to GB mapping fast 
  */
 
 #include "nsUnicodeToGBK.h"
 #include "gbku.h"
 #include "uconvutil.h"
-#include "nsUnicharUtils.h"
+#include "nsCharTraits.h"
 
 //-------------------------------------------------------------
 // Global table initialization function defined in gbku.h
 //-------------------------------------------------------------
 
 //-----------------------------------------------------------------------
 //  Private class used by nsUnicodeToGB18030 and nsUnicodeToGB18030Font0
 //    nsUnicodeToGB18030Uniq2Bytes
--- a/intl/uconv/ucvcn/nsUnicodeToGBK.h
+++ b/intl/uconv/ucvcn/nsUnicodeToGBK.h
@@ -12,17 +12,17 @@
  */
 
 #ifndef nsUnicodeToGBK_h___
 #define nsUnicodeToGBK_h___
 
 #include "nsUCSupport.h"
 #include "nsCOMPtr.h"
 #include "nsIUnicodeEncoder.h"
-#include "gbku.h"
+#include "nsGBKConvUtil.h"
 //----------------------------------------------------------------------
 // Class nsUnicodeToGBK [declaration]
 
 class nsUnicodeToGBK: public nsEncoderSupport
 {
 public:
 
   /**
--- a/intl/uconv/ucvcn/nsUnicodeToHZ.h
+++ b/intl/uconv/ucvcn/nsUnicodeToHZ.h
@@ -10,17 +10,17 @@
  * @created         08/Sept/1999
  * @author  Yueheng Xu, Yueheng.Xu@intel.com
  */
 
 #ifndef nsUnicodeToHZ_h___
 #define nsUnicodeToHZ_h___
 
 #include "nsUCSupport.h"
-#include "gbku.h"
+#include "nsGBKConvUtil.h"
 //----------------------------------------------------------------------
 // Class nsUnicodeToHZ [declaration]
 
 class nsUnicodeToHZ: public nsEncoderSupport
 {
 public:
 
   /**
--- a/intl/uconv/ucvibm/nsCP850ToUnicode.h
+++ b/intl/uconv/ucvibm/nsCP850ToUnicode.h
@@ -15,17 +15,20 @@
  * Date         Modified by     Description of modification
  * 12/09/1999   IBM Corp.       Support for IBM codepage 850
  *
  */
 
 #ifndef nsCP850ToUnicode_h___
 #define nsCP850ToUnicode_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
+
 /**
  * A character set converter from CP850 to Unicode.
  */
 nsresult
 nsCP850ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
                             void **aResult);
 
 
--- a/intl/uconv/ucvibm/nsCP852ToUnicode.h
+++ b/intl/uconv/ucvibm/nsCP852ToUnicode.h
@@ -15,17 +15,19 @@
  * Date         Modified by     Description of modification
  * 12/09/1999   IBM Corp.       Support for IBM codepage 852
  *
  */
 
 #ifndef nsCP852ToUnicode_h___
 #define nsCP852ToUnicode_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 /**
  * A character set converter from CP852 to Unicode.
  */
 nsresult
 nsCP852ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
                             void **aResult);
 
--- a/intl/uconv/ucvibm/nsCP855ToUnicode.h
+++ b/intl/uconv/ucvibm/nsCP855ToUnicode.h
@@ -15,17 +15,19 @@
  * Date         Modified by     Description of modification
  * 12/09/1999   IBM Corp.       Support for IBM codepage 855
  *
  */
 
 #ifndef nsCP855ToUnicode_h___
 #define nsCP855ToUnicode_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 /**
  * A character set converter from CP855 to Unicode.
  */
 nsresult
 nsCP855ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
                             void **aResult);
 
--- a/intl/uconv/ucvibm/nsCP857ToUnicode.h
+++ b/intl/uconv/ucvibm/nsCP857ToUnicode.h
@@ -15,18 +15,19 @@
  * Date         Modified by     Description of modification
  * 12/09/1999   IBM Corp.       Support for IBM codepage 857
  *
  */
 
 #ifndef nsCP857ToUnicode_h___
 #define nsCP857ToUnicode_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
 
+class nsISupports;
 
 /**
  * A character set converter from CP857 to Unicode.
  */
 nsresult
 nsCP857ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
                             void **aResult);
 
--- a/intl/uconv/ucvibm/nsCP862ToUnicode.h
+++ b/intl/uconv/ucvibm/nsCP862ToUnicode.h
@@ -15,18 +15,19 @@
  * Date         Modified by     Description of modification
  * 12/09/1999   IBM Corp.       Support for IBM codepage 862
  *
  */
 
 #ifndef nsCP862ToUnicode_h___
 #define nsCP862ToUnicode_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
 
+class nsISupports;
 
 /**
  * A character set converter from CP862 to Unicode.
  */
 nsresult
 nsCP862ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
                             void **aResult);
 
--- a/intl/uconv/ucvibm/nsCP864ToUnicode.h
+++ b/intl/uconv/ucvibm/nsCP864ToUnicode.h
@@ -15,18 +15,19 @@
  * Date         Modified by     Description of modification
  * 12/09/1999   IBM Corp.       Support for IBM codepage 864
  *
  */
 
 #ifndef nsCP864ToUnicode_h___
 #define nsCP864ToUnicode_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
 
+class nsISupports;
 
 /**
  * A character set converter from CP864 to Unicode.
  */
 nsresult
 nsCP864ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
                             void **aResult);
 
--- a/intl/uconv/ucvibm/nsUnicodeToCP850.h
+++ b/intl/uconv/ucvibm/nsUnicodeToCP850.h
@@ -15,18 +15,19 @@
  * Date         Modified by     Description of modification
  * 12/09/1999   IBM Corp.       Support for IBM codepages - 850
  *
  */
 
 #ifndef nsUnicodeToCP850_h___
 #define nsUnicodeToCP850_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
 
+class nsISupports;
 
 /**
  * A character set converter from Unicode to CP850.
  */
 nsresult
 nsUnicodeToCP850Constructor(nsISupports *aOuter, REFNSIID aIID,
                             void **aResult);
 
--- a/intl/uconv/ucvibm/nsUnicodeToCP852.h
+++ b/intl/uconv/ucvibm/nsUnicodeToCP852.h
@@ -15,17 +15,19 @@
  * Date         Modified by     Description of modification
  * 12/09/1999   IBM Corp.       Support for IBM codepages - 852
  *
  */
 
 #ifndef nsUnicodeToCP852_h___
 #define nsUnicodeToCP852_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 /**
  * A character set converter from Unicode to CP852.
  */
 nsresult
 nsUnicodeToCP852Constructor(nsISupports *aOuter, REFNSIID aIID,
                             void **aResult);
 
--- a/intl/uconv/ucvibm/nsUnicodeToCP855.h
+++ b/intl/uconv/ucvibm/nsUnicodeToCP855.h
@@ -15,18 +15,19 @@
  * Date         Modified by     Description of modification
  * 12/09/1999   IBM Corp.       Support for IBM codepages - 855
  *
  */
 
 #ifndef nsUnicodeToCP855_h___
 #define nsUnicodeToCP855_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
 
+class nsISupports;
 
 /**
  * A character set converter from Unicode to CP855.
  */
 nsresult
 nsUnicodeToCP855Constructor(nsISupports *aOuter, REFNSIID aIID,
                             void **aResult);
 
--- a/intl/uconv/ucvibm/nsUnicodeToCP857.h
+++ b/intl/uconv/ucvibm/nsUnicodeToCP857.h
@@ -15,17 +15,19 @@
  * Date         Modified by     Description of modification
  * 12/09/1999   IBM Corp.       Support for IBM codepages - 857
  *
  */
 
 #ifndef nsUnicodeToCP857_h___
 #define nsUnicodeToCP857_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 /**
  * A character set converter from Unicode to CP857.
  */
 nsresult
 nsUnicodeToCP857Constructor(nsISupports *aOuter, REFNSIID aIID,
                             void **aResult);
 
--- a/intl/uconv/ucvibm/nsUnicodeToCP862.h
+++ b/intl/uconv/ucvibm/nsUnicodeToCP862.h
@@ -15,17 +15,19 @@
  * Date         Modified by     Description of modification
  * 12/09/1999   IBM Corp.       Support for IBM codepages - 862
  *
  */
 
 #ifndef nsUnicodeToCP862_h___
 #define nsUnicodeToCP862_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 /**
  * A character set converter from Unicode to CP862.
  */
 nsresult
 nsUnicodeToCP862Constructor(nsISupports *aOuter, REFNSIID aIID,
                             void **aResult);
 
--- a/intl/uconv/ucvibm/nsUnicodeToCP864.h
+++ b/intl/uconv/ucvibm/nsUnicodeToCP864.h
@@ -15,17 +15,19 @@
  * Date         Modified by     Description of modification
  * 12/09/1999   IBM Corp.       Support for IBM codepages - 864
  *
  */
 
 #ifndef nsUnicodeToCP864_h___
 #define nsUnicodeToCP864_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 /**
  * A character set converter from Unicode to CP864.
  */
 nsresult
 nsUnicodeToCP864Constructor(nsISupports *aOuter, REFNSIID aIID,
                             void **aResult);
 
--- a/intl/uconv/ucvja/nsJapaneseToUnicode.cpp
+++ b/intl/uconv/ucvja/nsJapaneseToUnicode.cpp
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "nsJapaneseToUnicode.h"
 
 #include "nsUCSupport.h"
 
 #include "japanese.map"
 
 #include "nsICharsetConverterManager.h"
-#include "nsIServiceManager.h"
+#include "nsServiceManagerUtils.h"
 
 #include "mozilla/Assertions.h"
 
 static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
 
 #ifdef XP_OS2
   // HTML5-incompliant behavior for OS/2, see bug 108136
   // This is bogus. The right fix would be working around the font problems
--- a/intl/uconv/ucvja/nsJapaneseToUnicode.h
+++ b/intl/uconv/ucvja/nsJapaneseToUnicode.h
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsShiftJISToUnicode_h__
 #define nsShiftJISToUnicode_h__
-#include "nsISupports.h"
 #include "nsUCSupport.h"
 
 
 class nsShiftJISToUnicode : public nsBasicDecoderSupport
 {
 public:
 
  nsShiftJISToUnicode() 
--- a/intl/uconv/ucvja/nsUnicodeToEUCJP.h
+++ b/intl/uconv/ucvja/nsUnicodeToEUCJP.h
@@ -1,17 +1,19 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsUnicodeToEUCJP_h___
 #define nsUnicodeToEUCJP_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 /**
  * A character set converter from Unicode to EUCJP.
  *
  * @created         17/Feb/1999
  * @author  Catalin Rotaru [CATA]
  */
 nsresult
--- a/intl/uconv/ucvja/nsUnicodeToISO2022JP.cpp
+++ b/intl/uconv/ucvja/nsUnicodeToISO2022JP.cpp
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsUnicodeToISO2022JP.h"
-#include "nsIComponentManager.h"
 #include "nsUCVJADll.h"
 #include "nsUnicodeEncodeHelper.h"
 
 //----------------------------------------------------------------------
 // Global functions and data [declaration]
 
 // Basic mapping from Hankaku to Zenkaku
 // Nigori and Maru are taken care of outside this basic mapping
--- a/intl/uconv/ucvja/nsUnicodeToJISx0201.h
+++ b/intl/uconv/ucvja/nsUnicodeToJISx0201.h
@@ -1,17 +1,19 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsUnicodeToJISx0201_h___
 #define nsUnicodeToJISx0201_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 /**
  * A character set converter from Unicode to JISx0201.
  *
  * @created         17/Feb/1999
  * @author  Catalin Rotaru [CATA]
  */
 nsresult
--- a/intl/uconv/ucvja/nsUnicodeToSJIS.h
+++ b/intl/uconv/ucvja/nsUnicodeToSJIS.h
@@ -1,17 +1,19 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsUnicodeToSJIS_h___
 #define nsUnicodeToSJIS_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 /**
  * A character set converter from Unicode to SJIS.
  *
  * @created         17/Feb/1999
  * @author  Catalin Rotaru [CATA]
  */
 nsresult
--- a/intl/uconv/ucvko/nsCP949ToUnicode.h
+++ b/intl/uconv/ucvko/nsCP949ToUnicode.h
@@ -1,17 +1,19 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsCP949ToUnicode_h___
 #define nsCP949ToUnicode_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 /**
  * A character set converter from CP949 to Unicode.
  *
  * @created         06/Apr/1999
  * @author  Catalin Rotaru [CATA]
  */
 nsresult
--- a/intl/uconv/ucvko/nsISO2022KRToUnicode.cpp
+++ b/intl/uconv/ucvko/nsISO2022KRToUnicode.cpp
@@ -1,16 +1,16 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "nsISO2022KRToUnicode.h"
 #include "nsUCSupport.h"
 #include "nsICharsetConverterManager.h"
-#include "nsIServiceManager.h"
+#include "nsServiceManagerUtils.h"
 
 static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
 
 NS_IMETHODIMP nsISO2022KRToUnicode::Convert(const char * aSrc, int32_t * aSrcLen, PRUnichar * aDest, int32_t * aDestLen)
 {
   const unsigned char* srcEnd = (unsigned char*)aSrc + *aSrcLen;
   const unsigned char* src =(unsigned char*) aSrc;
   PRUnichar* destEnd = aDest + *aDestLen;
--- a/intl/uconv/ucvko/nsISO2022KRToUnicode.h
+++ b/intl/uconv/ucvko/nsISO2022KRToUnicode.h
@@ -1,15 +1,14 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsISO2022KRToUnicode_h__
 #define nsISO2022KRToUnicode_h__
-#include "nsISupports.h"
 #include "nsUCSupport.h"
 
 
  
 class nsISO2022KRToUnicode : public nsBasicDecoderSupport
 {
 public:
   nsISO2022KRToUnicode()
--- a/intl/uconv/ucvko/nsJohabToUnicode.h
+++ b/intl/uconv/ucvko/nsJohabToUnicode.h
@@ -1,17 +1,19 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsJohabToUnicode_h___
 #define nsJohabToUnicode_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 /**
  * A character set converter from Johab to Unicode.
  *
  * @created         06/Apr/1999
  * @author  Catalin Rotaru [CATA]
  */
 nsresult
--- a/intl/uconv/ucvko/nsUnicodeToCP949.h
+++ b/intl/uconv/ucvko/nsUnicodeToCP949.h
@@ -1,17 +1,19 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsUnicodeToCP949_h___
 #define nsUnicodeToCP949_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 /**
  * A character set converter from Unicode to CP949.
  *
  * @created         14/May/2001  (patterned after Unicode to EUCKR converter
  * @author  Jungshik Shin 
  */
 nsresult
--- a/intl/uconv/ucvko/nsUnicodeToJohab.h
+++ b/intl/uconv/ucvko/nsUnicodeToJohab.h
@@ -1,17 +1,19 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsUnicodeToJohab_h___
 #define nsUnicodeToJohab_h___
 
-#include "nsISupports.h"
+#include "nsID.h"
+
+class nsISupports;
 
 /**
  * A character set converter from Unicode to Johab.
  *
  */
 nsresult
 nsUnicodeToJohabConstructor(nsISupports *aOuter, REFNSIID aIID,
                             void **aResult);
--- a/intl/uconv/ucvlatin/nsISO88598EToUnicode.cpp
+++ b/intl/uconv/ucvlatin/nsISO88598EToUnicode.cpp
@@ -1,14 +1,13 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsUCConstructors.h"
 #include "nsISO88598ToUnicode.h"
 #include "nsISO88598EToUnicode.h"
 
 //----------------------------------------------------------------------
 // Global functions and data [declaration]
 
 nsresult
 nsISO88598EToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
--- a/intl/uconv/ucvlatin/nsISO88598IToUnicode.cpp
+++ b/intl/uconv/ucvlatin/nsISO88598IToUnicode.cpp
@@ -1,14 +1,13 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsUCConstructors.h"
 #include "nsISO88598ToUnicode.h"
 #include "nsISO88598IToUnicode.h"
 
 //----------------------------------------------------------------------
 // Global functions and data [declaration]
 
 nsresult
 nsISO88598IToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
--- a/intl/uconv/ucvlatin/nsISO88599ToUnicode.cpp
+++ b/intl/uconv/ucvlatin/nsISO88599ToUnicode.cpp
@@ -1,15 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsUCConstructors.h"
 #include "nsISO88599ToUnicode.h"
+#include "nsCP1254ToUnicode.h"
 
 nsresult
 nsISO88599ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
                                void **aResult) 
 {
   // Just make it an alias to windows-1254 decoder. (bug 712876)
   return nsCP1254ToUnicodeConstructor(aOuter, aIID, aResult);
 }
--- a/intl/uconv/ucvlatin/nsISO88599ToUnicode.h
+++ b/intl/uconv/ucvlatin/nsISO88599ToUnicode.h
@@ -1,16 +1,18 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsISO88599ToUnicode_h___
 #define nsISO88599ToUnicode_h___
 
-#include "nsCP1254ToUnicode.h"
+#include "nsID.h"
+
+class nsISupports;
 
 // Just make it an alias to windows-1254 decoder. (bug 712876)
 nsresult
 nsISO88599ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
                                void **aResult);
 
 #endif /* nsISO88599ToUnicode_h___ */
--- a/intl/uconv/ucvlatin/nsUTF16ToUnicode.cpp
+++ b/intl/uconv/ucvlatin/nsUTF16ToUnicode.cpp
@@ -1,17 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsUCConstructors.h"
 #include "nsUTF16ToUnicode.h"
 #include "nsCharTraits.h"
-#include <string.h>
 
 enum {
   STATE_NORMAL = 0,
   STATE_HALF_CODE_POINT = 1,
   STATE_FIRST_CALL = 2,
   STATE_SECOND_BYTE = STATE_FIRST_CALL | STATE_HALF_CODE_POINT,
   STATE_ODD_SURROGATE_PAIR = 4
 };
--- a/intl/uconv/ucvlatin/nsUnicodeToISO88598I.cpp
+++ b/intl/uconv/ucvlatin/nsUnicodeToISO88598I.cpp
@@ -1,14 +1,13 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsUCConstructors.h"
 #include "nsUnicodeToISO88598.h"
 #include "nsUnicodeToISO88598I.h"
 
 //----------------------------------------------------------------------
 // Global functions and data [declaration]
 
 nsresult
 nsUnicodeToISO88598IConstructor(nsISupports *aOuter, REFNSIID aIID,
--- a/intl/uconv/ucvlatin/nsUnicodeToMUTF7.cpp
+++ b/intl/uconv/ucvlatin/nsUnicodeToMUTF7.cpp
@@ -1,14 +1,13 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsUCConstructors.h"
 #include "nsUnicodeToMUTF7.h"
 
 //----------------------------------------------------------------------
 // Class nsUnicodeToMUTF7 [implementation]
 
 nsUnicodeToMUTF7::nsUnicodeToMUTF7() 
 : nsBasicUTF7Encoder(',', '&')
 {
--- a/intl/uconv/util/nsUCConstructors.h
+++ b/intl/uconv/util/nsUCConstructors.h
@@ -1,20 +1,23 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __nsUCConstructors_h
 #define __nsUCConstructors_h
 
-#include "nsIUnicodeEncoder.h"
-#include "nsIUnicodeDecoder.h"
+#include <stdint.h>
+#include "nscore.h"
+#include "nsID.h"
 #include "uconvutil.h"
 
+class nsISupports;
+
 // all the useful constructors
 NS_METHOD
 CreateMultiTableDecoder(int32_t aTableCount,
                         const uRange * aRangeArray, 
                         uScanClassID * aScanClassArray,
                         uMappingTable ** aMappingTable,
                         uint32_t aMaxLengthFactor,
                         
--- a/intl/uconv/util/nsUCSupport.cpp
+++ b/intl/uconv/util/nsUCSupport.cpp
@@ -1,15 +1,13 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsAlgorithm.h"
-#include "nsIComponentManager.h"
 #include "nsUCSupport.h"
 #include "nsUnicodeDecodeHelper.h"
 #include "nsUnicodeEncodeHelper.h"
 #include <algorithm>
 
 #define DEFAULT_BUFFER_CAPACITY 16
 
 // XXX review the buffer growth limitation code
--- a/intl/uconv/util/nsUnicodeDecodeHelper.cpp
+++ b/intl/uconv/util/nsUnicodeDecodeHelper.cpp
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "unicpriv.h"
-#include "nsIUnicodeDecoder.h"
 #include "nsUnicodeDecodeHelper.h"
 #include "nsAutoPtr.h"
 
 //----------------------------------------------------------------------
 // Class nsUnicodeDecodeHelper [implementation]
 nsresult nsUnicodeDecodeHelper::ConvertByTable(
                                      const char * aSrc, 
                                      int32_t * aSrcLength, 
--- a/intl/uconv/util/nsUnicodeDecodeHelper.h
+++ b/intl/uconv/util/nsUnicodeDecodeHelper.h
@@ -1,16 +1,16 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsUnicodeDecodeHelper_h__
 #define nsUnicodeDecodeHelper_h__
 
-#include "nsIUnicodeDecoder.h"
+#include "nsError.h"
 #include "uconvutil.h"
 //----------------------------------------------------------------------
 // Class nsUnicodeDecodeHelper [declaration]
 
 /**
  *
  * @created         18/Mar/1998
  * @author  Catalin Rotaru [CATA]
--- a/intl/uconv/util/nsUnicodeEncodeHelper.cpp
+++ b/intl/uconv/util/nsUnicodeEncodeHelper.cpp
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "unicpriv.h"
-#include "nsIUnicodeEncoder.h"
 #include "nsUnicodeEncodeHelper.h"
+#include "nsDebug.h"
 
 //----------------------------------------------------------------------
 // Class nsUnicodeEncodeHelper [implementation]
 nsresult nsUnicodeEncodeHelper::ConvertByTable(
                                      const PRUnichar * aSrc, 
                                      int32_t * aSrcLength, 
                                      char * aDest, 
                                      int32_t * aDestLength, 
--- a/intl/uconv/util/nsUnicodeEncodeHelper.h
+++ b/intl/uconv/util/nsUnicodeEncodeHelper.h
@@ -1,16 +1,16 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsUnicodeEncodeHelper_h__
 #define nsUnicodeEncodeHelper_h__
 
-#include "nsIUnicodeEncoder.h"
+#include "nsError.h"
 #include "uconvutil.h"
 //----------------------------------------------------------------------
 // Class nsUnicodeEncodeHelper [declaration]
 
 /**
  *
  * @created         22/Nov/1998
  * @author  Catalin Rotaru [CATA]
--- a/intl/unicharutil/src/nsEntityConverter.cpp
+++ b/intl/unicharutil/src/nsEntityConverter.cpp
@@ -1,24 +1,19 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsEntityConverter.h"
-#include "nsIProperties.h"
-#include "nsIServiceManager.h"
-#include "nsIComponentManager.h"
-#include "nsReadableUtils.h"
+#include "nsLiteralString.h"
+#include "nsString.h"
+#include "mozilla/Services.h"
+#include "nsServiceManagerUtils.h"
 #include "nsCRT.h"
-#include "nsLiteralString.h"
-#include "nsXPIDLString.h"
-#include "nsString.h"
-#include "nsUnicharUtils.h"
-#include "mozilla/Services.h"
 
 //
 // implementation methods
 //
 nsEntityConverter::nsEntityConverter() :
     mVersionList(nullptr),
     mVersionListLength(0)
 {
--- a/intl/unicharutil/src/nsEntityConverter.h
+++ b/intl/unicharutil/src/nsEntityConverter.h
@@ -2,17 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsEntityConverter_h__
 #define nsEntityConverter_h__
 
 #include "nsIEntityConverter.h"
-#include "nsIFactory.h"
 #include "nsIStringBundle.h"
 #include "nsCOMPtr.h"
 
 #define kVERSION_STRING_LEN 128
 
 class nsEntityVersionList
 {
 public:
--- a/intl/unicharutil/src/nsSaveAsCharset.cpp
+++ b/intl/unicharutil/src/nsSaveAsCharset.cpp
@@ -2,24 +2,20 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "prmem.h"
 #include "prprf.h"
-#include "nsIServiceManager.h"
-#include "nsIComponentManager.h"
 #include "nsICharsetConverterManager.h"
 #include "nsSaveAsCharset.h"
-#include "nsCRT.h"
-#include "nsUnicharUtils.h"
-#include "nsReadableUtils.h"
 #include "nsWhitespaceTokenizer.h"
+#include "nsServiceManagerUtils.h"
 
 //
 // nsISupports methods
 //
 NS_IMPL_ISUPPORTS1(nsSaveAsCharset, nsISaveAsCharset)
 
 //
 // nsSaveAsCharset
--- a/intl/unicharutil/src/nsSaveAsCharset.h
+++ b/intl/unicharutil/src/nsSaveAsCharset.h
@@ -1,20 +1,18 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsSaveAsCharset_h__
 #define nsSaveAsCharset_h__
 
-#include "nsIFactory.h"
-#include "nsString.h"
+#include "nsStringFwd.h"
 #include "nsTArray.h"
-#include "nsICharsetConverterManager.h"
 #include "nsISaveAsCharset.h"
 
 
 #define MASK_FALLBACK(a) (nsISaveAsCharset::mask_Fallback & (a))
 #define MASK_ENTITY(a) (nsISaveAsCharset::mask_Entity & (a))
 #define MASK_CHARSET_FALLBACK(a) (nsISaveAsCharset::mask_CharsetFallback & (a))
 #define ATTR_NO_FALLBACK(a) (nsISaveAsCharset::attr_FallbackNone == MASK_FALLBACK(a) && \
                              nsISaveAsCharset::attr_EntityAfterCharsetConv != MASK_ENTITY(a))
--- a/intl/unicharutil/src/nsUnicodeNormalizer.cpp
+++ b/intl/unicharutil/src/nsUnicodeNormalizer.cpp
@@ -46,25 +46,21 @@
  *    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  *    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  *    BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  *    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  *    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  *    ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  */
 
-#include <stdlib.h>
 #include <string.h>
 
-#include "nsUnicharUtils.h"
 #include "nsMemory.h"
-#include "nsCRT.h"
 #include "nsUnicodeNormalizer.h"
 #include "nsString.h"
-#include "nsReadableUtils.h"
 
 NS_IMPL_ISUPPORTS1(nsUnicodeNormalizer, nsIUnicodeNormalizer)
 
 
 nsUnicodeNormalizer::nsUnicodeNormalizer()
 {
 }
 
--- a/intl/unicharutil/tests/NormalizationTest.cpp
+++ b/intl/unicharutil/tests/NormalizationTest.cpp
@@ -1,22 +1,19 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <stdio.h>
-#include "nsISupports.h"
 #include "nsXPCOM.h"
-#include "nsIServiceManager.h"
-#include "nsNetUtil.h"
-#include "nsCOMPtr.h"
 #include "nsIUnicodeNormalizer.h"
 #include "nsStringAPI.h"
 #include "nsCharTraits.h"
+#include "nsServiceManagerUtils.h"
 
 struct testcaseLine {
   wchar_t* c1;
   wchar_t* c2;
   wchar_t* c3;
   wchar_t* c4;
   wchar_t* c5;
   char* description;
--- a/intl/unicharutil/tests/UnicharSelfTest.cpp
+++ b/intl/unicharutil/tests/UnicharSelfTest.cpp
@@ -1,30 +1,24 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <stdio.h>
-#include "nsISupports.h"
 #include "nsXPCOM.h"
-#include "nsIServiceManager.h"
-#include "nsIComponentManager.h"
-#include "nsICaseConversion.h"
 #include "nsIEntityConverter.h"
 #include "nsISaveAsCharset.h"
-#include "nsIUnicodeEncoder.h"
-#include "nsUnicharUtilCIID.h"
-#include "nsIPersistentProperties2.h"
-#include "nsIURL.h"
-#include "nsNetUtil.h"
 #include "nsCOMPtr.h"
 #include "nsIUnicodeNormalizer.h"
 #include "nsStringAPI.h"
 #include "nsUnicharUtils.h"
+#include "nsMemory.h"
+#include "nsComponentManagerUtils.h"
+#include "nsServiceManagerUtils.h"
 
 NS_DEFINE_CID(kEntityConverterCID, NS_ENTITYCONVERTER_CID);
 NS_DEFINE_CID(kSaveAsCharsetCID, NS_SAVEASCHARSET_CID);
 NS_DEFINE_CID(kUnicodeNormalizerCID, NS_UNICODE_NORMALIZER_CID);
 
 #define TESTLEN 32
 #define T2LEN TESTLEN
 #define T3LEN TESTLEN
--- a/intl/unicharutil/util/nsBidiUtils.cpp
+++ b/intl/unicharutil/util/nsBidiUtils.cpp
@@ -1,16 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "nsBidiUtils.h"
-#include "nsCharTraits.h"
-#include "nsUnicodeProperties.h"
 
 #define ARABIC_TO_HINDI_DIGIT_INCREMENT (START_HINDI_DIGITS - START_ARABIC_DIGITS)
 #define PERSIAN_TO_HINDI_DIGIT_INCREMENT (START_HINDI_DIGITS - START_FARSI_DIGITS)
 #define ARABIC_TO_PERSIAN_DIGIT_INCREMENT (START_FARSI_DIGITS - START_ARABIC_DIGITS)
 #define NUM_TO_ARABIC(c) \
   ((((c)>=START_HINDI_DIGITS) && ((c)<=END_HINDI_DIGITS)) ? \
    ((c) - (uint16_t)ARABIC_TO_HINDI_DIGIT_INCREMENT) : \
    ((((c)>=START_FARSI_DIGITS) && ((c)<=END_FARSI_DIGITS)) ? \
--- a/intl/unicharutil/util/nsUnicharUtils.cpp
+++ b/intl/unicharutil/util/nsUnicharUtils.cpp
@@ -1,24 +1,19 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsUnicharUtils.h"
-#include "nsUnicharUtilCIID.h"
-
-#include "nsCRT.h"
-#include "nsICaseConversion.h"
-#include "nsServiceManagerUtils.h"
 #include "nsXPCOMStrings.h"
 #include "nsUTF8Utils.h"
 #include "nsUnicodeProperties.h"
-#include "nsHashKeys.h"
 #include "mozilla/Likely.h"
+#include "mozilla/HashFunctions.h"
 
 // We map x -> x, except for upper-case letters,
 // which we map to their lower-case equivalents.
 static const uint8_t gASCIIToLower [128] = {
     0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
     0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
     0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
     0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
--- a/intl/unicharutil/util/nsUnicodeProperties.cpp
+++ b/intl/unicharutil/util/nsUnicodeProperties.cpp
@@ -2,17 +2,16 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsUnicodeProperties.h"
 #include "nsUnicodePropertyData.cpp"
 
 #include "mozilla/Util.h"
-#include "nsMemory.h"
 #include "nsCharTraits.h"
 
 #define UNICODE_BMP_LIMIT 0x10000
 #define UNICODE_LIMIT     0x110000
 
 
 const nsCharProps1&
 GetCharProps1(uint32_t aCh)