Bug 1332717 - remove MOZILLA_INTERNAL_API. r=mkmelin
authorJorg K <jorgk@jorgk.com>
Wed, 01 Mar 2017 23:43:37 +0100
changeset 27716 f0451b35ac4ab672c0f383f08c56d8fcc099ab00
parent 27715 e0b1fb0cdc2930373a2b694b913f33e62db1ff80
child 27717 417a5d45d130379d57a9b5502c1089e3a6f50d32
push id1918
push userclokep@gmail.com
push dateTue, 18 Apr 2017 16:38:40 +0000
treeherdercomm-beta@6b755b36d0c5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1332717
Bug 1332717 - remove MOZILLA_INTERNAL_API. r=mkmelin
calendar/base/backend/libical/calUtils.h
ldap/xpcom/src/nsLDAPUtils.h
mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
mail/components/shell/nsMailWinIntegration.cpp
mailnews/addrbook/src/nsAbOSXDirectory.mm
mailnews/base/search/src/nsMsgFilter.cpp
mailnews/base/src/nsMessengerWinIntegration.cpp
mailnews/base/src/nsSpamSettings.cpp
mailnews/base/util/nsMsgUtils.cpp
mailnews/base/util/nsMsgUtils.h
mailnews/base/util/nsStopwatch.cpp
mailnews/import/outlook/src/nsOutlookCompose.cpp
mailnews/import/outlook/src/nsOutlookSettings.cpp
mailnews/import/text/src/nsTextAddress.cpp
mailnews/local/src/nsParseMailbox.cpp
mailnews/mapi/mapiDll/moz.build
mailnews/mapi/mapihook/build/moz.build
--- a/calendar/base/backend/libical/calUtils.h
+++ b/calendar/base/backend/libical/calUtils.h
@@ -1,22 +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/. */
 #if !defined(INCLUDED_CAL_UTILS_H)
 #define INCLUDED_CAL_UTILS_H
 
-#if defined(MOZILLA_INTERNAL_API)
 #include "nsCRT.h"
 #include "nsString.h"
-#else
-#include "nsMemory.h"
-#include "nsCRTGlue.h"
-#include "nsStringAPI.h"
-#endif
 
 #include "nsAutoPtr.h"
 #include "nsIStringEnumerator.h"
 
 #include "calITimezone.h"
 #include "calITimezoneProvider.h"
 #include "calIICSService.h"
 #include "nsIConsoleService.h"
--- a/ldap/xpcom/src/nsLDAPUtils.h
+++ b/ldap/xpcom/src/nsLDAPUtils.h
@@ -4,144 +4,12 @@
 
 /* This module contains helper functions and macros for converting directory
    module to frozen linkage.
  */
 #include "nsServiceManagerUtils.h"
 #include "nsString.h"
 #include <ctype.h>
 
-#ifdef MOZILLA_INTERNAL_API
 /* Internal API helper macros */
-
 #define LdapCompressWhitespace(str) \
         (str).CompressWhitespace()
 
-#else // MOZILLA_INTERNAL_API
-/* Frozen linkage helper functions */
-
-/* This macro has been copied from msgcore.h */
-#define IS_SPACE(VAL) \
-  (((((PRIntn)(VAL)) & 0x7f) == ((PRIntn)(VAL))) && isspace((PRIntn)(VAL)))
-
-/* This function has been copied from nsMsgUtils.cpp */
-inline void LdapCompressWhitespace(nsCString& aString)
-{
-  // This code is frozen linkage specific
-  aString.Trim(" \f\n\r\t\v");
-
-  char *start, *end;
-  aString.BeginWriting(&start, &end);
-
-  for (char *cur = start; cur < end; ++cur) {
-    if (!IS_SPACE(*cur))
-      continue;
-
-    *cur = ' ';
-
-    if (!IS_SPACE(*(cur + 1)))
-      continue;
-
-    // Loop through the white space
-    char *wend = cur + 2;
-    while (IS_SPACE(*wend))
-      ++wend;
-
-    uint32_t wlen = wend - cur - 1;
-
-    // fix "end"
-    end -= wlen;
-
-    // move everything forwards a bit
-    for (char *m = cur + 1; m < end; ++m) {
-      *m = *(m + wlen);
-    }
-  }
-
-  // Set the new length.
-  aString.SetLength(end - start);
-}
-
-/*
- * Function copied from nsReadableUtils.
- * Migrating to frozen linkage is the only change done
- */
-inline
-bool IsUTF8(const nsACString& aString)
-{
-  const char *done_reading = aString.EndReading();
-
-  int32_t state = 0;
-  bool overlong = false;
-  bool surrogate = false;
-  bool nonchar = false;
-  uint16_t olupper = 0; // overlong byte upper bound.
-  uint16_t slower = 0;  // surrogate byte lower bound.
-
-  const char *ptr = aString.BeginReading();
-
-  while (ptr < done_reading) {
-    uint8_t c;
-
-    if (0 == state) {
-
-      c = *ptr++;
-
-      if ((c & 0x80) == 0x00)
-        continue;
-
-      if ( c <= 0xC1 ) // [80-BF] where not expected, [C0-C1] for overlong.
-        return false;
-      else if ((c & 0xE0) == 0xC0)
-        state = 1;
-      else if ((c & 0xF0) == 0xE0) {
-        state = 2;
-        if ( c == 0xE0 ) { // to exclude E0[80-9F][80-BF]
-          overlong = true;
-          olupper = 0x9F;
-        } else if ( c == 0xED ) { // ED[A0-BF][80-BF] : surrogate codepoint
-          surrogate = true;
-          slower = 0xA0;
-        } else if ( c == 0xEF ) // EF BF [BE-BF] : non-character
-          nonchar = true;
-      } else if ( c <= 0xF4 ) { // XXX replace /w UTF8traits::is4byte when it's updated to exclude [F5-F7].(bug 199090)
-        state = 3;
-        nonchar = true;
-        if ( c == 0xF0 ) { // to exclude F0[80-8F][80-BF]{2}
-          overlong = true;
-          olupper = 0x8F;
-        }
-        else if ( c == 0xF4 ) { // to exclude F4[90-BF][80-BF]
-          // actually not surrogates but codepoints beyond 0x10FFFF
-          surrogate = true;
-          slower = 0x90;
-        }
-      } else
-        return false; // Not UTF-8 string
-    }
-
-    while (ptr < done_reading && state) {
-      c = *ptr++;
-      --state;
-
-      // non-character : EF BF [BE-BF] or F[0-7] [89AB]F BF [BE-BF]
-      if ( nonchar &&  ( !state &&  c < 0xBE ||
-           state == 1 && c != 0xBF  ||
-           state == 2 && 0x0F != (0x0F & c) ))
-        nonchar = false;
-
-      if ((c & 0xC0) != 0x80 || overlong && c <= olupper ||
-           surrogate && slower <= c || nonchar && !state )
-        return false; // Not UTF-8 string
-      overlong = surrogate = false;
-    }
-  }
-  return !state; // state != 0 at the end indicates an invalid UTF-8 seq.
-}
-
-#define kNotFound -1
-
-#define nsCaseInsensitiveCStringComparator() \
-        CaseInsensitiveCompare
-#define nsCaseInsensitiveStringComparator() \
-        CaseInsensitiveCompare
-
-#endif // MOZILLA_INTERNAL_API
--- a/mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
+++ b/mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
@@ -243,27 +243,20 @@ nsNetscapeProfileMigratorBase::LocateSig
     nsCOMPtr<nsIURI> uri;
     rv = NS_NewFileURI(getter_AddRefs(uri), currFile);
     if (NS_FAILED(rv)) break;
     nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
 
     nsAutoCString extn;
     url->GetFileExtension(extn);
 
-#ifdef MOZILLA_INTERNAL_API
     if (extn.EqualsIgnoreCase("s")) {
       url->GetFileName(fileName);
       break;
     }
-#else
-    if (extn.Equals("s", CaseInsensitiveCompare)) {
-      url->GetFileName(fileName);
-      break;
-    }
-#endif
   }
   while (1);
 
   *aResult = ToNewCString(fileName);
 
   return NS_OK;
 }
 
--- a/mail/components/shell/nsMailWinIntegration.cpp
+++ b/mail/components/shell/nsMailWinIntegration.cpp
@@ -15,24 +15,16 @@
 #include "nsUnicharUtils.h"
 #include "nsIWinTaskbar.h"
 #include "nsISupportsPrimitives.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIProperties.h"
 #include "nsString.h"
 
-#ifndef MOZILLA_INTERNAL_API
-/**
- * The external API expects CaseInsensitiveCompare. Redefine
- * nsCaseInsensitiveStringComparator() so that Equals works.
- */
-#define nsCaseInsensitiveStringComparator() CaseInsensitiveCompare
-#endif
-
 #ifdef _WIN32_WINNT
 #undef _WIN32_WINNT
 #endif
 #define _WIN32_WINNT 0x0600
 #define INITGUID
 #include <shlobj.h>
 
 #include <mbstring.h>
--- a/mailnews/addrbook/src/nsAbOSXDirectory.mm
+++ b/mailnews/addrbook/src/nsAbOSXDirectory.mm
@@ -1026,23 +1026,18 @@ nsAbOSXDirectory::GetCardFromProperty(co
   for (uint32_t i = 0; i < length && !*aResult; ++i)
   {
     card = do_QueryElementAt(list, i, &rv);
     if (NS_SUCCEEDED(rv))
     {
       rv = card->GetPropertyAsAUTF8String(aProperty, cardValue);
       if (NS_SUCCEEDED(rv))
       {
-#ifdef MOZILLA_INTERNAL_API
         bool equal = aCaseSensitive ? cardValue.Equals(aValue) :
           cardValue.Equals(aValue, nsCaseInsensitiveCStringComparator());
-#else
-        bool equal = aCaseSensitive ? cardValue.Equals(aValue) :
-          cardValue.Equals(aValue, CaseInsensitiveCompare);
-#endif
         if (equal)
           NS_IF_ADDREF(*aResult = card);
       }
     }
   }
   return NS_OK;
 }
 
@@ -1075,23 +1070,18 @@ nsAbOSXDirectory::GetCardsFromProperty(c
   for (uint32_t i = 0; i < length; ++i)
   {
     card = do_QueryElementAt(list, i, &rv);
     if (NS_SUCCEEDED(rv))
     {
       rv = card->GetPropertyAsAUTF8String(aProperty, cardValue);
       if (NS_SUCCEEDED(rv))
       {
-#ifdef MOZILLA_INTERNAL_API
         bool equal = aCaseSensitive ? cardValue.Equals(aValue) :
           cardValue.Equals(aValue, nsCaseInsensitiveCStringComparator());
-#else
-        bool equal = aCaseSensitive ? cardValue.Equals(aValue) :
-          cardValue.Equals(aValue, CaseInsensitiveCompare);
-#endif
         if (equal)
           resultArray.AppendObject(card);
       }
     }
   }
 
   return NS_NewArrayEnumerator(aResult, resultArray);
 }
--- a/mailnews/base/search/src/nsMsgFilter.cpp
+++ b/mailnews/base/search/src/nsMsgFilter.cpp
@@ -535,21 +535,19 @@ nsMsgFilter::LogRuleHitGeneric(nsIMsgRul
                                                   kTimeFormatSeconds,
                                                   &exploded,
                                                   dateValue);
 
     (void)aMsgHdr->GetMime2DecodedAuthor(authorValue);
     (void)aMsgHdr->GetMime2DecodedSubject(subjectValue);
 
     nsCString buffer;
-#ifdef MOZILLA_INTERNAL_API
     // this is big enough to hold a log entry.
     // do this so we avoid growing and copying as we append to the log.
     buffer.SetCapacity(512);
-#endif
 
     nsCOMPtr<nsIStringBundleService> bundleService =
       mozilla::services::GetStringBundleService();
     NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
 
     nsCOMPtr<nsIStringBundle> bundle;
     rv = bundleService->CreateBundle("chrome://messenger/locale/filter.properties",
       getter_AddRefs(bundle));
--- a/mailnews/base/src/nsMessengerWinIntegration.cpp
+++ b/mailnews/base/src/nsMessengerWinIntegration.cpp
@@ -38,19 +38,17 @@
 #include "nsIPrefBranch.h"
 #include "nsIProperties.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIWeakReferenceUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsNativeCharsetUtils.h"
 #include "nsMsgUtils.h"
-#ifdef MOZILLA_INTERNAL_API
 #include "mozilla/LookAndFeel.h"
-#endif
 #include "mozilla/Services.h"
 #include "nsIMutableArray.h"
 #include "nsArrayUtils.h"
 
 #include "nsToolkitCompsCID.h"
 #include <stdlib.h>
 #define PROFILE_COMMANDLINE_ARG " -profile "
 
@@ -80,23 +78,16 @@
 #ifndef NIIF_NOSOUND
 #define NIIF_NOSOUND    0x00000010
 #endif
 
 #ifndef NIN_BALOONUSERCLICK
 #define NIN_BALLOONUSERCLICK (WM_USER + 5)
 #endif
 
-#ifndef MOZILLA_INTERNAL_API
-// from LookAndFeel.h
-#define NS_ALERT_HORIZONTAL 1
-#define NS_ALERT_LEFT       2
-#define NS_ALERT_TOP        4
-#endif
-
 using namespace mozilla;
 
 // begin shameless copying from nsNativeAppSupportWin
 HWND hwndForDOMWindow( mozIDOMWindowProxy *window )
 {
   if ( !window ) {
     return 0;
   }
@@ -522,55 +513,17 @@ nsresult nsMessengerWinIntegration::Show
     rv = argsArray->AppendElement(scriptableUserInitiated, false);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // pass in the alert origin
     nsCOMPtr<nsISupportsPRUint8> scriptableOrigin (do_CreateInstance(NS_SUPPORTS_PRUINT8_CONTRACTID));
     NS_ENSURE_TRUE(scriptableOrigin, NS_ERROR_FAILURE);
     scriptableOrigin->SetData(0);
     int32_t origin = 0;
-#ifdef MOZILLA_INTERNAL_API
     origin = LookAndFeel::GetInt(LookAndFeel::eIntID_AlertNotificationOrigin);
-#else
-    // Get task bar window handle
-    HWND shellWindow = FindWindowW(L"Shell_TrayWnd", NULL);
-
-    rv = prefBranch->GetIntPref(ALERT_ORIGIN_PREF, &origin);
-    if (NS_FAILED(rv) && (shellWindow != NULL))
-    {
-      // Determine position
-      APPBARDATA appBarData;
-      appBarData.hWnd = shellWindow;
-      appBarData.cbSize = sizeof(appBarData);
-      if (SHAppBarMessage(ABM_GETTASKBARPOS, &appBarData))
-      {
-        // Set alert origin as a bit field - see LookAndFeel.h
-        // 0 represents bottom right, sliding vertically.
-        switch(appBarData.uEdge)
-        {
-          case ABE_LEFT:
-            origin = NS_ALERT_HORIZONTAL | NS_ALERT_LEFT;
-            break;
-          case ABE_RIGHT:
-            origin = NS_ALERT_HORIZONTAL;
-            break;
-          case ABE_TOP:
-            origin = NS_ALERT_TOP;
-            // fall through for the right-to-left handling.
-          case ABE_BOTTOM:
-            // If the task bar is right-to-left,
-            // move the origin to the left
-            if (::GetWindowLong(shellWindow, GWL_EXSTYLE) &
-                  WS_EX_LAYOUTRTL)
-              origin |= NS_ALERT_LEFT;
-            break;
-        }
-      }
-    }
-#endif
     scriptableOrigin->SetData(origin);
 
     rv = argsArray->AppendElement(scriptableOrigin, false);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
     nsCOMPtr<mozIDOMWindowProxy> newWindow;
     rv = wwatch->OpenWindow(0, ALERT_CHROME_URL, "_blank",
--- a/mailnews/base/src/nsSpamSettings.cpp
+++ b/mailnews/base/src/nsSpamSettings.cpp
@@ -655,19 +655,17 @@ NS_IMETHODIMP nsSpamSettings::LogJunkHit
                                                 dateValue);
 
   (void)aMsgHdr->GetMime2DecodedAuthor(authorValue);
   (void)aMsgHdr->GetMime2DecodedSubject(subjectValue);
 
   nsCString buffer;
   // this is big enough to hold a log entry.
   // do this so we avoid growing and copying as we append to the log.
-#ifdef MOZILLA_INTERNAL_API
   buffer.SetCapacity(512);
-#endif
 
   nsCOMPtr<nsIStringBundleService> bundleService =
     mozilla::services::GetStringBundleService();
   NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
 
   nsCOMPtr<nsIStringBundle> bundle;
   rv = bundleService->CreateBundle("chrome://messenger/locale/filter.properties",
     getter_AddRefs(bundle));
--- a/mailnews/base/util/nsMsgUtils.cpp
+++ b/mailnews/base/util/nsMsgUtils.cpp
@@ -336,74 +336,37 @@ static uint32_t StringHash(const char *u
 
 inline uint32_t StringHash(const nsAutoString& str)
 {
     const char16_t *strbuf = str.get();
     return StringHash(reinterpret_cast<const char*>(strbuf),
                       str.Length() * 2);
 }
 
-#ifndef MOZILLA_INTERNAL_API
-static int GetFindInSetFilter(const char* aChars)
-{
-  uint8_t filter = 0;
-  while (*aChars)
-    filter |= *aChars++;
-  return ~filter;
-}
-#endif
-
 /* Utility functions used in a few places in mailnews */
 int32_t
 MsgFindCharInSet(const nsCString &aString,
                  const char* aChars, uint32_t aOffset)
 {
-#ifdef MOZILLA_INTERNAL_API
   return aString.FindCharInSet(aChars, aOffset);
-#else
-  const char *str;
-  uint32_t len = aString.BeginReading(&str);
-  int filter = GetFindInSetFilter(aChars);
-  for (uint32_t index = aOffset; index < len; index++) {
-    if (!(str[index] & filter) && strchr(aChars, str[index]))
-      return index;
-  }
-  return -1;
-#endif
 }
 
 int32_t
 MsgFindCharInSet(const nsString &aString,
                  const char* aChars, uint32_t aOffset)
 {
-#ifdef MOZILLA_INTERNAL_API
   return aString.FindCharInSet(aChars, aOffset);
-#else
-  const char16_t *str;
-  uint32_t len = aString.BeginReading(&str);
-  int filter = GetFindInSetFilter(aChars);
-  for (uint32_t index = aOffset; index < len; index++) {
-    if (!(str[index] & filter) && strchr(aChars, str[index]))
-      return index;
-  }
-  return -1;
-#endif
 }
 
 static bool ConvertibleToNative(const nsAutoString& str)
 {
     nsAutoCString native;
     nsAutoString roundTripped;
-#ifdef MOZILLA_INTERNAL_API
     NS_CopyUnicodeToNative(str, native);
     NS_CopyNativeToUnicode(native, roundTripped);
-#else
-    nsMsgI18NConvertFromUnicode(nsMsgI18NFileSystemCharset(), str, native);
-    nsMsgI18NConvertToUnicode(nsMsgI18NFileSystemCharset(), native, roundTripped);
-#endif
     return str.Equals(roundTripped);
 }
 
 #if defined(XP_UNIX)
   const static uint32_t MAX_LEN = 55;
 #elif defined(XP_WIN32)
   const static uint32_t MAX_LEN = 55;
 #else
@@ -647,21 +610,17 @@ nsresult NS_MsgCreatePathStringFromFolde
     endSlashPos = (startSlashPos >= 0)
       ? oldPath.FindChar('/', startSlashPos + 1)  - 1: oldPath.Length() - 1;
     if (endSlashPos < 0)
       endSlashPos = oldPath.Length();
 
     if (startSlashPos >= endSlashPos)
       break;
   }
-#ifdef MOZILLA_INTERNAL_API
   return NS_CopyUnicodeToNative(path, aPathCString);
-#else
-  return nsMsgI18NConvertFromUnicode(nsMsgI18NFileSystemCharset(), path, aPathCString);
-#endif
 }
 
 bool NS_MsgStripRE(const char **stringP, uint32_t *lengthP, char **modifiedSubject)
 {
   const char *s, *s_end;
   uint32_t L;
   bool result = false;
   NS_ASSERTION(stringP, "bad null param");
@@ -1497,28 +1456,21 @@ nsresult MsgNewSafeBufferedFileOutputStr
   nsresult rv = NS_NewSafeLocalFileOutputStream(getter_AddRefs(stream), aFile, aIOFlags, aPerm);
   if (NS_SUCCEEDED(rv))
     rv = NS_NewBufferedOutputStream(aResult, stream, FILE_IO_BUFFER_SIZE);
   return rv;
 }
 
 bool MsgFindKeyword(const nsCString &keyword, nsCString &keywords, int32_t *aStartOfKeyword, int32_t *aLength)
 {
-#ifdef MOZILLA_INTERNAL_API
 // nsTString_CharT::Find(const nsCString& aString,
 //                       bool aIgnoreCase=false,
 //                       int32_t aOffset=0,
 //                       int32_t aCount=-1 ) const;
 #define FIND_KEYWORD(keywords,keyword,offset) ((keywords).Find((keyword), false, (offset)))
-#else
-// nsAString::Find(const self_type& aStr,
-//                 uint32_t aOffset,
-//                 ComparatorFunc c = DefaultComparator) const;
-#define FIND_KEYWORD(keywords,keyword,offset) ((keywords).Find((keyword), static_cast<uint32_t>(offset)))
-#endif
   // 'keyword' is the single keyword we're looking for
   // 'keywords' is a space delimited list of keywords to be searched,
   // which may be just a single keyword or even be empty
   const int32_t kKeywordLen = keyword.Length();
   const char* start = keywords.BeginReading();
   const char* end = keywords.EndReading();
   *aStartOfKeyword = FIND_KEYWORD(keywords, keyword, 0);
   while (*aStartOfKeyword >= 0)
@@ -1596,95 +1548,16 @@ nsresult MsgGetLocalFileFromURI(const ns
   nsCOMPtr<nsIFile> argFile;
   rv = argFileURL->GetFile(getter_AddRefs(argFile));
   NS_ENSURE_SUCCESS(rv, rv);
 
   argFile.forget(aFile);
   return NS_OK;
 }
 
-#ifndef MOZILLA_INTERNAL_API
-/*
- * Function copied from nsReadableUtils.
- * Migrating to frozen linkage is the only change done
- */
-NS_MSG_BASE bool MsgIsUTF8(const nsACString& aString)
-{
-  const char *done_reading = aString.EndReading();
-
-  int32_t state = 0;
-  bool overlong = false;
-  bool surrogate = false;
-  bool nonchar = false;
-  uint16_t olupper = 0; // overlong byte upper bound.
-  uint16_t slower = 0;  // surrogate byte lower bound.
-
-  const char *ptr = aString.BeginReading();
-
-  while (ptr < done_reading) {
-    uint8_t c;
-
-    if (0 == state) {
-
-      c = *ptr++;
-
-      if ((c & 0x80) == 0x00)
-        continue;
-
-      if ( c <= 0xC1 ) // [80-BF] where not expected, [C0-C1] for overlong.
-        return false;
-      else if ((c & 0xE0) == 0xC0)
-        state = 1;
-      else if ((c & 0xF0) == 0xE0) {
-        state = 2;
-        if ( c == 0xE0 ) { // to exclude E0[80-9F][80-BF]
-          overlong = true;
-          olupper = 0x9F;
-        } else if ( c == 0xED ) { // ED[A0-BF][80-BF] : surrogate codepoint
-          surrogate = true;
-          slower = 0xA0;
-        } else if ( c == 0xEF ) // EF BF [BE-BF] : non-character
-          nonchar = true;
-      } else if ( c <= 0xF4 ) { // XXX replace /w UTF8traits::is4byte when it's updated to exclude [F5-F7].(bug 199090)
-        state = 3;
-        nonchar = true;
-        if ( c == 0xF0 ) { // to exclude F0[80-8F][80-BF]{2}
-          overlong = true;
-          olupper = 0x8F;
-        }
-        else if ( c == 0xF4 ) { // to exclude F4[90-BF][80-BF]
-          // actually not surrogates but codepoints beyond 0x10FFFF
-          surrogate = true;
-          slower = 0x90;
-        }
-      } else
-        return false; // Not UTF-8 string
-    }
-
-    while (ptr < done_reading && state) {
-      c = *ptr++;
-      --state;
-
-      // non-character : EF BF [BE-BF] or F[0-7] [89AB]F BF [BE-BF]
-      if ( nonchar &&  ( !state &&  c < 0xBE ||
-           state == 1 && c != 0xBF  ||
-           state == 2 && 0x0F != (0x0F & c) ))
-        nonchar = false;
-
-      if ((c & 0xC0) != 0x80 || overlong && c <= olupper ||
-           surrogate && slower <= c || nonchar && !state )
-        return false; // Not UTF-8 string
-      overlong = surrogate = false;
-    }
-  }
-  return !state; // state != 0 at the end indicates an invalid UTF-8 seq.
-}
-
-#endif
-
 NS_MSG_BASE void MsgStripQuotedPrintable (unsigned char *src)
 {
   // decode quoted printable text in place
 
   if (!*src)
     return;
   unsigned char *dest = src;
   int srcIdx = 0, destIdx = 0;
@@ -1754,288 +1627,16 @@ NS_MSG_BASE nsresult MsgEscapeURL(const 
 {
   nsresult rv;
   nsCOMPtr<nsINetUtil> nu = do_GetService(NS_NETUTIL_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return nu->EscapeURL(aStr, aFlags, aResult);
 }
 
-#ifndef MOZILLA_INTERNAL_API
-
-NS_MSG_BASE char *MsgEscapeHTML(const char *string)
-{
-  char *rv = nullptr;
-  /* XXX Hardcoded max entity len. The +1 is for the trailing null. */
-  uint32_t len = PL_strlen(string);
-  if (len >= (PR_UINT32_MAX / 6))
-    return nullptr;
-
-  rv = (char *)NS_Alloc( (6 * len) + 1 );
-  char *ptr = rv;
-
-  if (rv)
-  {
-    for(; *string != '\0'; string++)
-    {
-      if (*string == '<')
-      {
-        *ptr++ = '&';
-        *ptr++ = 'l';
-        *ptr++ = 't';
-        *ptr++ = ';';
-      }
-      else if (*string == '>')
-      {
-        *ptr++ = '&';
-        *ptr++ = 'g';
-        *ptr++ = 't';
-        *ptr++ = ';';
-      }
-      else if (*string == '&')
-      {
-        *ptr++ = '&';
-        *ptr++ = 'a';
-        *ptr++ = 'm';
-        *ptr++ = 'p';
-        *ptr++ = ';';
-      }
-      else if (*string == '"')
-      {
-        *ptr++ = '&';
-        *ptr++ = 'q';
-        *ptr++ = 'u';
-        *ptr++ = 'o';
-        *ptr++ = 't';
-        *ptr++ = ';';
-      }
-      else if (*string == '\'')
-      {
-        *ptr++ = '&';
-        *ptr++ = '#';
-        *ptr++ = '3';
-        *ptr++ = '9';
-        *ptr++ = ';';
-      }
-      else
-      {
-        *ptr++ = *string;
-      }
-    }
-    *ptr = '\0';
-  }
-  return(rv);
-}
-
-NS_MSG_BASE char16_t *MsgEscapeHTML2(const char16_t *aSourceBuffer,
-                                      int32_t aSourceBufferLen)
-{
-  // if the caller didn't calculate the length
-  if (aSourceBufferLen == -1) {
-    aSourceBufferLen = NS_strlen(aSourceBuffer); // ...then I will
-  }
-
-  /* XXX Hardcoded max entity len. */
-  if (aSourceBufferLen >=
-    ((PR_UINT32_MAX - sizeof(char16_t)) / (6 * sizeof(char16_t))) )
-      return nullptr;
-
-  char16_t *resultBuffer = (char16_t *)moz_xmalloc(aSourceBufferLen *
-                            6 * sizeof(char16_t) + sizeof(char16_t('\0')));
-
-  char16_t *ptr = resultBuffer;
-
-  if (resultBuffer) {
-    int32_t i;
-
-    for(i = 0; i < aSourceBufferLen; i++) {
-      if(aSourceBuffer[i] == '<') {
-        *ptr++ = '&';
-        *ptr++ = 'l';
-        *ptr++ = 't';
-        *ptr++ = ';';
-      } else if(aSourceBuffer[i] == '>') {
-        *ptr++ = '&';
-        *ptr++ = 'g';
-        *ptr++ = 't';
-        *ptr++ = ';';
-      } else if(aSourceBuffer[i] == '&') {
-        *ptr++ = '&';
-        *ptr++ = 'a';
-        *ptr++ = 'm';
-        *ptr++ = 'p';
-        *ptr++ = ';';
-      } else if (aSourceBuffer[i] == '"') {
-        *ptr++ = '&';
-        *ptr++ = 'q';
-        *ptr++ = 'u';
-        *ptr++ = 'o';
-        *ptr++ = 't';
-        *ptr++ = ';';
-      } else if (aSourceBuffer[i] == '\'') {
-        *ptr++ = '&';
-        *ptr++ = '#';
-        *ptr++ = '3';
-        *ptr++ = '9';
-        *ptr++ = ';';
-      } else {
-        *ptr++ = aSourceBuffer[i];
-      }
-    }
-    *ptr = 0;
-  }
-
-  return resultBuffer;
-}
-
-NS_MSG_BASE void MsgCompressWhitespace(nsCString& aString)
-{
-  // This code is frozen linkage specific
-  aString.Trim(" \f\n\r\t\v");
-
-  char *start, *end;
-  aString.BeginWriting(&start, &end);
-
-  for (char *cur = start; cur < end; ++cur) {
-    if (!IS_SPACE(*cur))
-      continue;
-
-    *cur = ' ';
-
-    if (!IS_SPACE(*(cur + 1)))
-      continue;
-
-    // Loop through the white space
-    char *wend = cur + 2;
-    while (IS_SPACE(*wend))
-      ++wend;
-
-    uint32_t wlen = wend - cur - 1;
-
-    // fix "end"
-    end -= wlen;
-
-    // move everything forwards a bit
-    for (char *m = cur + 1; m < end; ++m) {
-      *m = *(m + wlen);
-    }
-  }
-
-  // Set the new length.
-  aString.SetLength(end - start);
-}
-
-
-NS_MSG_BASE void MsgReplaceChar(nsString& str, const char *set, const char16_t replacement)
-{
-  char16_t *c_str = str.BeginWriting();
-  while (*set) {
-    int32_t pos = 0;
-    while ((pos = str.FindChar(*set, pos)) != -1) {
-      c_str[pos++] = replacement;
-    }
-    set++;
-  }
-}
-
-NS_MSG_BASE void MsgReplaceChar(nsCString& str, const char needle, const char replacement)
-{
-  char *c_str = str.BeginWriting();
-  while ((c_str = strchr(c_str, needle))) {
-    *c_str = replacement;
-    c_str++;
-  }
-}
-
-NS_MSG_BASE already_AddRefed<nsIAtom> MsgNewAtom(const char* aString)
-{
-  nsCOMPtr<nsIAtomService> atomService(do_GetService("@mozilla.org/atom-service;1"));
-  nsCOMPtr<nsIAtom> atom;
-
-  if (atomService)
-    atomService->GetAtomUTF8(aString, getter_AddRefs(atom));
-  return atom.forget();
-}
-
-NS_MSG_BASE void MsgReplaceSubstring(nsAString &str, const nsAString &what, const nsAString &replacement)
-{
-  const char16_t* replacement_str;
-  uint32_t replacementLength = replacement.BeginReading(&replacement_str);
-  uint32_t whatLength = what.Length();
-  int32_t i = 0;
-
-  while ((i = str.Find(what, i)) != kNotFound)
-  {
-    str.Replace(i, whatLength, replacement_str, replacementLength);
-    i += replacementLength;
-  }
-}
-
-NS_MSG_BASE void MsgReplaceSubstring(nsACString &str, const char *what, const char *replacement)
-{
-  uint32_t replacementLength = strlen(replacement);
-  uint32_t whatLength = strlen(what);
-  int32_t i = 0;
-
-  /* We have to create nsDependentCString from 'what' because there's no
-   * str.Find(char *what, int offset) but there is only
-   * str.Find(char *what, int length) */
-  nsDependentCString what_dependent(what);
-  while ((i = str.Find(what_dependent, i)) != kNotFound)
-  {
-    str.Replace(i, whatLength, replacement, replacementLength);
-    i += replacementLength;
-  }
-}
-
-/* This class is based on nsInterfaceRequestorAgg from nsInterfaceRequestorAgg.h */
-class MsgInterfaceRequestorAgg : public nsIInterfaceRequestor
-{
-public:
-  NS_DECL_THREADSAFE_ISUPPORTS
-  NS_DECL_NSIINTERFACEREQUESTOR
-
-  MsgInterfaceRequestorAgg(nsIInterfaceRequestor *aFirst,
-                           nsIInterfaceRequestor *aSecond)
-    : mFirst(aFirst)
-    , mSecond(aSecond) {}
-
-  nsCOMPtr<nsIInterfaceRequestor> mFirst, mSecond;
-};
-
-// XXX This needs to support threadsafe refcounting until we fix bug 243591.
-NS_IMPL_ISUPPORTS(MsgInterfaceRequestorAgg, nsIInterfaceRequestor)
-
-NS_IMETHODIMP
-MsgInterfaceRequestorAgg::GetInterface(const nsIID &aIID, void **aResult)
-{
-  nsresult rv = NS_ERROR_NO_INTERFACE;
-  if (mFirst)
-    rv = mFirst->GetInterface(aIID, aResult);
-  if (mSecond && NS_FAILED(rv))
-    rv = mSecond->GetInterface(aIID, aResult);
-  return rv;
-}
-
-/* This function is based on NS_NewInterfaceRequestorAggregation from
- * nsInterfaceRequestorAgg.h */
-NS_MSG_BASE nsresult
-MsgNewInterfaceRequestorAggregation(nsIInterfaceRequestor *aFirst,
-                                    nsIInterfaceRequestor *aSecond,
-                                    nsIInterfaceRequestor **aResult)
-{
-  *aResult = new MsgInterfaceRequestorAgg(aFirst, aSecond);
-  if (!*aResult)
-    return NS_ERROR_OUT_OF_MEMORY;
-  NS_ADDREF(*aResult);
-  return NS_OK;
-}
-
-#endif
-
 NS_MSG_BASE nsresult MsgGetHeadersFromKeys(nsIMsgDatabase *aDB, const nsTArray<nsMsgKey> &aMsgKeys,
                                            nsIMutableArray *aHeaders)
 {
   NS_ENSURE_ARG_POINTER(aDB);
 
   uint32_t count = aMsgKeys.Length();
   nsresult rv = NS_OK;
 
--- a/mailnews/base/util/nsMsgUtils.h
+++ b/mailnews/base/util/nsMsgUtils.h
@@ -315,22 +315,16 @@ NS_MSG_BASE nsresult MsgDetectCharsetFro
  * @param         delsp          Use delsp=yes when flowed
  * @param         formatOutput   Reformat the output?
  & @param         disallowBreaks Disallow breaks when formatting
  */
 NS_MSG_BASE nsresult
 ConvertBufToPlainText(nsString &aConBuf, bool formatFlowed, bool delsp,
                                          bool formatOutput, bool disallowBreaks);
 
-/**
- * The following definitons exist for compatibility between the internal and
- * external APIs. Where possible they just forward to the existing API.
- */
-
-#ifdef MOZILLA_INTERNAL_API
 #include "nsEscape.h"
 
 /**
  * The internal API expects nsCaseInsensitiveC?StringComparator() and true.
  * Redefine CaseInsensitiveCompare so that Find works.
  */
 #define CaseInsensitiveCompare true
 /**
@@ -361,167 +355,16 @@ ConvertBufToPlainText(nsString &aConBuf,
         NS_Atomize(aString)
 #define MsgReplaceChar(aString, aNeedle, aReplacement) \
         (aString).ReplaceChar(aNeedle, aReplacement)
 #define MsgFind(str, what, ignore_case, offset) \
         (str).Find(what, ignore_case, offset)
 #define MsgCountChar(aString, aChar) \
         (aString).CountChar(aChar)
 
-#else
-
-/**
- * The external API expects CaseInsensitiveCompare. Redefine
- * nsCaseInsensitiveC?StringComparator() so that Equals works.
- */
-#define nsCaseInsensitiveCStringComparator() \
-        CaseInsensitiveCompare
-#define nsCaseInsensitiveStringComparator() \
-        CaseInsensitiveCompare
-/// The external API does not provide kNotFound.
-#define kNotFound -1
-/**
- * The external API does not provide the following methods. While we can
- * reasonably easily define them in terms of existing methods, we only want
- * to do this when using the external API.
- */
-#define AppendASCII \
-        AppendLiteral
-#define AppendUTF16toUTF8(source, dest) \
-        (dest).Append(NS_ConvertUTF16toUTF8(source))
-#define AppendUTF8toUTF16(source, dest) \
-        (dest).Append(NS_ConvertUTF8toUTF16(source))
-#define AppendASCIItoUTF16(source, dest) \
-        (dest).Append(NS_ConvertASCIItoUTF16(source))
-#define Compare(str1, str2, comp) \
-        (str1).Compare(str2, comp)
-#define CaseInsensitiveFindInReadable(what, str) \
-        ((str).Find(what, CaseInsensitiveCompare) != kNotFound)
-#define LossyAppendUTF16toASCII(source, dest) \
-        (dest).Append(NS_LossyConvertUTF16toASCII(source))
-#define Last() \
-        EndReading()[-1]
-#define SetCharAt(ch, index) \
-        Replace(index, 1, ch)
-
-/**
- * The internal and external methods expect the parameters in a different order.
- * The internal API also always expects a flag rather than a comparator.
- */
-inline int32_t MsgFind(nsAString &str, const char *what, bool ignore_case, uint32_t offset)
-{
-  return str.Find(what, offset, ignore_case);
-}
-
-inline int32_t MsgFind(nsACString &str, const char *what, bool ignore_case, int32_t offset)
-{
-  /* See Find_ComputeSearchRange from nsStringObsolete.cpp */
-  if (offset < 0) {
-    offset = 0;
-  }
-  if (ignore_case)
-    return str.Find(nsDependentCString(what), offset, CaseInsensitiveCompare);
-  return str.Find(nsDependentCString(what), offset);
-}
-
-inline int32_t MsgFind(nsACString &str, const nsACString &what, bool ignore_case, int32_t offset)
-{
-  /* See Find_ComputeSearchRange from nsStringObsolete.cpp */
-  if (offset < 0) {
-    offset = 0;
-  }
-  if (ignore_case)
-    return str.Find(what, offset, CaseInsensitiveCompare);
-  return str.Find(what, offset);
-}
-
-/**
- * The following methods are not exposed to the external API so we define
- * equivalent versions here.
- */
-/// Equivalent of LowerCaseEqualsLiteral(literal)
-#define MsgLowerCaseEqualsLiteral(str, literal) \
-        (str).Equals(literal, CaseInsensitiveCompare)
-/// Equivalent of RFindChar(ch, len)
-#define MsgRFindChar(str, ch, len) \
-        StringHead(str, len).RFindChar(ch)
-/// Equivalent of aString.CompressWhitespace()
-NS_MSG_BASE void MsgCompressWhitespace(nsCString& aString);
-/// Equivalent of nsEscapeHTML(aString)
-NS_MSG_BASE char *MsgEscapeHTML(const char *aString);
-/// Equivalent of nsEscapeHTML2(aBuffer, aLen)
-NS_MSG_BASE char16_t *MsgEscapeHTML2(const char16_t *aBuffer, int32_t aLen);
-// Existing replacement for IsUTF8
-NS_MSG_BASE bool MsgIsUTF8(const nsACString& aString);
-/// Equivalent of NS_Atomize(aUTF8String)
-NS_MSG_BASE already_AddRefed<nsIAtom> MsgNewAtom(const char* aString);
-/// Equivalent of NS_Atomize(aUTF8String)
-inline already_AddRefed<nsIAtom> MsgGetAtom(const char* aUTF8String)
-{
-  return MsgNewAtom(aUTF8String);
-}
-/// Equivalent of ns(C)String::ReplaceSubstring(what, replacement)
-NS_MSG_BASE void MsgReplaceSubstring(nsAString &str, const nsAString &what, const nsAString &replacement);
-NS_MSG_BASE void MsgReplaceSubstring(nsACString &str, const char *what, const char *replacement);
-/// Equivalent of ns(C)String::ReplaceChar(what, replacement)
-NS_MSG_BASE void MsgReplaceChar(nsString& str, const char *set, const char16_t replacement);
-NS_MSG_BASE void MsgReplaceChar(nsCString& str, const char needle, const char replacement);
-// Equivalent of NS_NewInterfaceRequestorAggregation(aFirst, aSecond, aResult)
-NS_MSG_BASE nsresult MsgNewInterfaceRequestorAggregation(nsIInterfaceRequestor *aFirst,
-                                                         nsIInterfaceRequestor *aSecond,
-                                                         nsIInterfaceRequestor **aResult);
-
-/**
- * This function is based on NS_NewNotificationCallbacksAggregation from
- * nsNetUtil.h
- *
- * This function returns a nsIInterfaceRequestor instance that returns the
- * same result as NS_QueryNotificationCallbacks when queried.
- */
-inline nsresult
-MsgNewNotificationCallbacksAggregation(nsIInterfaceRequestor  *callbacks,
-                                       nsILoadGroup           *loadGroup,
-                                       nsIInterfaceRequestor **result)
-{
-    nsCOMPtr<nsIInterfaceRequestor> cbs;
-    if (loadGroup)
-        loadGroup->GetNotificationCallbacks(getter_AddRefs(cbs));
-    return MsgNewInterfaceRequestorAggregation(callbacks, cbs, result);
-}
-
-/**
- * Count occurences of specified character in string.
- *
- */
-inline
-uint32_t MsgCountChar(nsACString &aString, char16_t aChar) {
-  const char *begin, *end;
-  uint32_t num_chars = 0;
-  aString.BeginReading(&begin, &end);
-  for (const char *current = begin; current < end; ++current) {
-      if (*current == aChar)
-        ++num_chars;
-  }
-  return num_chars;
-}
-
-inline
-uint32_t MsgCountChar(nsAString &aString, char16_t aChar) {
-  const char16_t *begin, *end;
-  uint32_t num_chars = 0;
-  aString.BeginReading(&begin, &end);
-  for (const char16_t *current = begin; current < end; ++current) {
-      if (*current == aChar)
-        ++num_chars;
-  }
-  return num_chars;
-}
-
-#endif
-
 /**
  * Converts a hex string into an integer.
  * Processes up to aNumChars characters or the first non-hex char.
  * It is not an error if less than aNumChars valid hex digits are found.
  */
 NS_MSG_BASE uint64_t MsgUnhex(const char *aHexString, size_t aNumChars);
 
 /**
--- a/mailnews/base/util/nsStopwatch.cpp
+++ b/mailnews/base/util/nsStopwatch.cpp
@@ -31,20 +31,18 @@
 NS_IMPL_ISUPPORTS(nsStopwatch, nsIStopwatch)
 
 #if defined(XP_UNIX)
 /** the number of ticks per second */
 static double gTicks = 0;
 #define MICRO_SECONDS_TO_SECONDS_MULT static_cast<double>(1.0e-6)
 #elif defined(WIN32)
 #ifdef DEBUG
-#ifdef MOZILLA_INTERNAL_API
 #include "nsPrintfCString.h"
 #endif
-#endif
 // 1 tick per 100ns = 10 per us = 10 * 1,000 per ms = 10 * 1,000 * 1,000 per sec.
 #define WIN32_TICK_RESOLUTION static_cast<double>(1.0e-7)
 // subtract off to get to the unix epoch
 #define UNIX_EPOCH_IN_FILE_TIME 116444736000000000L
 #endif // elif defined(WIN32)
 
 nsStopwatch::nsStopwatch()
  : fTotalRealTimeSecs(0.0)
@@ -154,25 +152,18 @@ double nsStopwatch::GetCPUTime()
 
   HANDLE hProcess = GetCurrentProcess();
 #ifdef DEBUG
   BOOL ret =
 #endif
     GetProcessTimes(hProcess, &ftCreate, &ftExit,
                               &ftKernel.ftFileTime, &ftUser.ftFileTime);
 #ifdef DEBUG
-#ifdef MOZILLA_INTERNAL_API
   if (!ret)
     NS_ERROR(nsPrintfCString("GetProcessTimes() failed, error=0x%lx.", GetLastError()).get());
-#else
-  if (!ret) {
-    // nsPrintfCString() is unavailable to report GetLastError().
-    NS_ERROR("GetProcessTimes() failed.");
-  }
-#endif
 #endif
 
   /*
    * Process times are returned in a 64-bit structure, as the number of
    * 100 nanosecond ticks since 1 January 1601.  User mode and kernel mode
    * times for this process are in separate 64-bit structures.
    * Add them and convert the result to seconds.
    */
--- a/mailnews/import/outlook/src/nsOutlookCompose.cpp
+++ b/mailnews/import/outlook/src/nsOutlookCompose.cpp
@@ -553,19 +553,17 @@ void nsOutlookCompose::UpdateHeaders(CMa
 // applies to html &#XXXX; (where XXXX is unicode codepoint).
 // See also Bug 503690, where the same issue in Eudora import is reported.
 // By the way, the root of the Bug 359303 lies in the same place - the nsMsgComposeAndSend::GetBodyFromEditor()
 // changes the 0xA0 codes to 0x20 when it converts the body to plain text.
 // We scan the body here to find all the & and convert them to the safe character sequense to revert later.
 
 void nsOutlookCompose::HackBody(const wchar_t* orig, size_t origLen, nsString& hack)
 {
-#ifdef MOZILLA_INTERNAL_API
   hack.SetCapacity(static_cast<size_t>(origLen*1.4));
-#endif
   hack.Assign(hackBeginW);
   hack.Append(m_hackedPostfix);
 
   while (*orig) {
     if (*orig == L'&') {
       hack.Append(hackAmpersandW);
       hack.Append(m_hackedPostfix);
     } else if ((*orig == L'\x0D') && (*(orig+1) == L'\x0A')) {
@@ -717,21 +715,19 @@ private:
   int m_matchPos;
 };
 
 template <class _OutFn>
 nsresult CCompositionFile::ToDest(_OutFn dest, const char* term, int termSize)
 {
   CTermGuard guard(term, termSize);
 
-#ifdef MOZILLA_INTERNAL_API
   // We already know the required string size, so reduce future reallocations
   if (!guard.IsChecking() && !m_convertCRs)
     dest.SetCapacity(m_fileSize - m_fileReadPos);
-#endif
 
   bool wasCR = false;
   char c = 0;
   nsresult rv;
   while (NS_SUCCEEDED(rv = EnsureHasDataInBuffer())) {
     if (!guard.IsChecking() && !m_convertCRs) { // Use efficient algorithm
       dest.Append(m_fifoBufferReadPos, m_fifoBufferWrittenPos-m_fifoBufferReadPos);
     }
@@ -774,31 +770,27 @@ nsresult CCompositionFile::ToDest(_OutFn
 
   m_lastChar = c;
   return NS_OK;
 }
 
 class dest_nsCString {
 public:
   dest_nsCString(nsCString& str) : m_str(str) { m_str.Truncate(); }
-#ifdef MOZILLA_INTERNAL_API
   void SetCapacity(int32_t sz) { m_str.SetCapacity(sz); }
-#endif
   nsresult Append(const char* buf, uint32_t count) {
     m_str.Append(buf, count); return NS_OK; }
 private:
   nsCString& m_str;
 };
 
 class dest_Stream {
 public:
   dest_Stream(nsIOutputStream *dest) : m_stream(dest) {}
-#ifdef MOZILLA_INTERNAL_API
   void SetCapacity(int32_t) { /*do nothing*/ }
-#endif
   // const_cast here is due to the poor design of the EscapeFromSpaceLine()
   // that requires a non-constant pointer while doesn't modify its data
   nsresult Append(const char* buf, uint32_t count) {
     return EscapeFromSpaceLine(m_stream, const_cast<char*>(buf), buf+count); }
 private:
   nsIOutputStream *m_stream;
 };
 
--- a/mailnews/import/outlook/src/nsOutlookSettings.cpp
+++ b/mailnews/import/outlook/src/nsOutlookSettings.cpp
@@ -26,25 +26,17 @@
 #include "nsISmtpServer.h"
 #include "nsOutlookStringBundle.h"
 #include "OutlookDebugLog.h"
 #include "nsIPop3IncomingServer.h"
 #include "nsMsgI18N.h"
 #include <windows.h>
 #include "nsIWindowsRegKey.h"
 #include "nsComponentManagerUtils.h"
-#ifdef MOZILLA_INTERNAL_API
 #include "nsNativeCharsetUtils.h"
-#else
-#include "nsMsgI18N.h"
-#define NS_CopyNativeToUnicode(source, dest) \
-        nsMsgI18NConvertToUnicode(nsMsgI18NFileSystemCharset(), source, dest)
-#define NS_CopyUnicodeToNative(source, dest) \
-        nsMsgI18NConvertFromUnicode(nsMsgI18NFileSystemCharset(), source, dest)
-#endif
 
 class OutlookSettings {
 public:
   static nsresult FindAccountsKey(nsIWindowsRegKey **aKey);
   static nsresult QueryAccountSubKey(nsIWindowsRegKey **aKey);
   static nsresult GetDefaultMailAccountName(nsAString &aName);
 
   static bool DoImport(nsIMsgAccount **aAccount);
--- a/mailnews/import/text/src/nsTextAddress.cpp
+++ b/mailnews/import/text/src/nsTextAddress.cpp
@@ -18,22 +18,16 @@
 #include "nsIUnicharLineInputStream.h"
 #include "nsMsgUtils.h"
 
 #include "TextDebugLog.h"
 #include "plstr.h"
 #include "msgCore.h"
 #include <algorithm>
 
-#ifndef MOZILLA_INTERNAL_API
-#include "nsMsgI18N.h"
-#define NS_CopyNativeToUnicode(source, dest) \
-        nsMsgI18NConvertToUnicode(nsMsgI18NFileSystemCharset(), source, dest)
-#endif
-
 #define kWhitespace    " \t\b\r\n"
 
 nsTextAddress::nsTextAddress()
 {
     m_database = nullptr;
     m_fieldMap = nullptr;
     m_LFCount = 0;
     m_CRCount = 0;
--- a/mailnews/local/src/nsParseMailbox.cpp
+++ b/mailnews/local/src/nsParseMailbox.cpp
@@ -1047,21 +1047,17 @@ nsresult nsParseMailMessageState::ParseH
         header = &m_priority;
       else if (!PL_strncasecmp(HEADER_X_MOZILLA_KEYWORDS, buf, end - buf)
         && !m_keywords.length)
         header = &m_keywords;
       break;
     }
     if (!header && m_customDBHeaders.Length())
     {
-#ifdef MOZILLA_INTERNAL_API
       nsDependentCSubstring headerStr(buf, end);
-#else
-      nsDependentCSubstring headerStr(buf, end - buf);
-#endif
 
       ToLowerCase(headerStr);
       size_t customHeaderIndex = m_customDBHeaders.IndexOf(headerStr);
       if (customHeaderIndex != m_customDBHeaders.NoIndex)
         header = & m_customDBHeaderValues[customHeaderIndex];
     }
 
     buf = colon + 1;
--- a/mailnews/mapi/mapiDll/moz.build
+++ b/mailnews/mapi/mapiDll/moz.build
@@ -13,11 +13,9 @@ SOURCES += [
 
 OS_LIBS += [
     'ole32',
 ]
 
 DEFINES['UNICODE'] = True
 DEFINES['_UNICODE'] = True
 
-DEFINES['MOZILLA_INTERNAL_API'] = True
-
 DEFFILE	= SRCDIR + '/Mapi32.def'
--- a/mailnews/mapi/mapihook/build/moz.build
+++ b/mailnews/mapi/mapihook/build/moz.build
@@ -10,12 +10,10 @@ OS_LIBS += [
 ]
 
 for var in ('REGISTER_PROXY_DLL', 'UNICODE', '_UNICODE'):
     DEFINES[var] = True
 
 # This produces a compile warning mozilla-config.h(145): warning C4005: '_WIN32_WINNT': macro redefinition
 #DEFINES['_WIN32_WINNT'] = '0x400'
 
-DEFINES['MOZILLA_INTERNAL_API'] = True
-
 DEFFILE = SRCDIR + '/MapiProxy.def'