Remove the v1 string ABI compatibility hacks. Replace references of nsTAString_CharT with nsTSubstring_CharT which is the new base class. r=dbaron
authorBenjamin Smedberg <benjamin@smedbergs.us>
Fri, 19 Sep 2008 11:07:22 -0400
changeset 19418 7e95620116b18296ed93fea3e0d53c0428a9d78a
parent 19417 c9695fd22c8b28ecbd1b0a265eef12192f51f032
child 19419 f5f57d874f8d69318e6c0e0103a74a6c51e0e3a6
push idunknown
push userunknown
push dateunknown
reviewersdbaron
milestone1.9.1b1pre
Remove the v1 string ABI compatibility hacks. Replace references of nsTAString_CharT with nsTSubstring_CharT which is the new base class. r=dbaron
config/autoconf.mk.in
configure.in
xpcom/io/nsEscape.h
xpcom/string/public/Makefile.in
xpcom/string/public/nsAString.h
xpcom/string/public/nsObsoleteAString.h
xpcom/string/public/nsStringFwd.h
xpcom/string/public/nsStringIterator.h
xpcom/string/public/nsSubstring.h
xpcom/string/public/nsTAString.h
xpcom/string/public/nsTDependentString.h
xpcom/string/public/nsTDependentSubstring.h
xpcom/string/public/nsTObsoleteAString.h
xpcom/string/public/nsTPromiseFlatString.h
xpcom/string/public/nsTString.h
xpcom/string/public/nsTSubstring.h
xpcom/string/public/nsTSubstringTuple.h
xpcom/string/public/string-template-def-char.h
xpcom/string/public/string-template-def-unichar.h
xpcom/string/public/string-template-undef.h
xpcom/string/src/Makefile.in
xpcom/string/src/nsAString.cpp
xpcom/string/src/nsObsoleteAStringThunk.cpp
xpcom/string/src/nsReadableUtils.cpp
xpcom/string/src/nsSubstring.cpp
xpcom/string/src/nsSubstringTuple.cpp
xpcom/string/src/nsTAString.cpp
xpcom/string/src/nsTDependentSubstring.cpp
xpcom/string/src/nsTObsoleteAStringThunk.cpp
xpcom/string/src/nsTPromiseFlatString.cpp
xpcom/string/src/nsTStringComparator.cpp
xpcom/string/src/nsTSubstring.cpp
xpcom/xpcom-config.h.in
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -634,15 +634,13 @@ GCC_VERSION	= @GCC_VERSION@
 XCODEBUILD_VERSION= @XCODEBUILD_VERSION@
 HAS_XCODE_2_1	= @HAS_XCODE_2_1@
 UNIVERSAL_BINARY= @UNIVERSAL_BINARY@
 HAVE_DTRACE= @HAVE_DTRACE@
 
 VISIBILITY_FLAGS = @VISIBILITY_FLAGS@
 WRAP_SYSTEM_INCLUDES = @WRAP_SYSTEM_INCLUDES@
 
-MOZ_V1_STRING_ABI = @MOZ_V1_STRING_ABI@
-
 MOZ_EMBEDDING_LEVEL_DEFAULT = @MOZ_EMBEDDING_LEVEL_DEFAULT@
 MOZ_EMBEDDING_LEVEL_BASIC = @MOZ_EMBEDDING_LEVEL_BASIC@
 MOZ_EMBEDDING_LEVEL_MINIMAL = @MOZ_EMBEDDING_LEVEL_MINIMAL@
 
 HAVE_ARM_SIMD= @HAVE_ARM_SIMD@
--- a/configure.in
+++ b/configure.in
@@ -4408,17 +4408,16 @@ MOZ_SPELLCHECK=1
 MOZ_STATIC_MAIL_BUILD=
 MOZ_STORAGE=1
 MOZ_SVG=1
 MOZ_TIMELINE=
 MOZ_UI_LOCALE=en-US
 MOZ_UNIVERSALCHARDET=1
 MOZ_URL_CLASSIFIER=
 MOZ_USE_NATIVE_UCONV=
-MOZ_V1_STRING_ABI=
 MOZ_VIEW_SOURCE=1
 MOZ_XPFE_COMPONENTS=1
 MOZ_XPINSTALL=1
 MOZ_XSLT_STANDALONE=
 MOZ_XTF=1
 MOZ_XUL=1
 MOZ_XUL_APP=1
 MOZ_ZIPWRITER=1
@@ -7793,28 +7792,16 @@ MOZ_ARG_DISABLE_BOOL(cookies,
 AC_SUBST(NECKO_COOKIES)
 if test "$NECKO_COOKIES"; then
     AC_DEFINE(NECKO_COOKIES)
 fi
 
 dnl NECKO_ configuration options are not global
 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"
 
-dnl ========================================================
-dnl string api compatibility
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(v1-string-abi,
-[  --disable-v1-string-abi   Disable binary compatibility layer for strings],
-    MOZ_V1_STRING_ABI=,
-    MOZ_V1_STRING_ABI=1)
-AC_SUBST(MOZ_V1_STRING_ABI)
-if test "$MOZ_V1_STRING_ABI"; then
-    AC_DEFINE(MOZ_V1_STRING_ABI)
-fi
-
 dnl Only build Mork if it's required
 AC_SUBST(MOZ_MORK)
 if test "$MOZ_MORK"; then
   AC_DEFINE(MOZ_MORK)
 fi
 
 dnl Build the lightweight Mork reader if required
 AC_SUBST(MOZ_MORKREADER)
@@ -8242,17 +8229,16 @@ NEED_CPP_UNUSED_IMPLEMENTATIONS
 NEW_H
 HAVE_GETPAGESIZE
 HAVE_ICONV
 HAVE_ICONV_WITH_CONST_INPUT
 HAVE_MBRTOWC
 HAVE_SYS_MOUNT_H
 HAVE_SYS_VFS_H
 HAVE_WCRTOMB
-MOZ_V1_STRING_ABI
 "
 
 AC_CONFIG_HEADER(
 netwerk/necko-config.h
 xpcom/xpcom-config.h
 xpcom/xpcom-private.h
 )
 
--- a/xpcom/io/nsEscape.h
+++ b/xpcom/io/nsEscape.h
@@ -179,52 +179,16 @@ NS_EscapeURL(const nsCSubstring &str, PR
 }
 inline const nsCSubstring &
 NS_UnescapeURL(const nsCSubstring &str, PRUint32 flags, nsCSubstring &result) {
     if (NS_UnescapeURL(str.Data(), str.Length(), flags, result))
         return result;
     return str;
 }
 
-// nsACString is nsCSubstring when MOZ_V1_STRING_ABI is undefined.
-#ifdef MOZ_V1_STRING_ABI
-inline const nsACString &
-NS_EscapeURL(const nsACString &str, PRUint32 flags, nsACString &result) {
-    // The iterator version of BeginReading provides us with both the data
-    // pointer and the length with only one function call.
-    nsACString::const_iterator iter;
-    str.BeginReading(iter);
-    if (NS_EscapeURL(iter.get(), iter.size_forward(), flags, result))
-        return result;
-    return str;
-}
-inline const nsACString &
-NS_EscapeURL(const nsCSubstring &str, PRUint32 flags, nsACString &result) {
-    if (NS_EscapeURL(str.Data(), str.Length(), flags, result))
-        return result;
-    return str;
-}
-inline const nsACString &
-NS_UnescapeURL(const nsACString &str, PRUint32 flags, nsACString &result) {
-    // The iterator version of BeginReading provides us with both the data
-    // pointer and the length with only one function call.
-    nsACString::const_iterator iter;
-    str.BeginReading(iter);
-    if (NS_UnescapeURL(iter.get(), iter.size_forward(), flags, result))
-        return result;
-    return str;
-}
-inline const nsACString &
-NS_UnescapeURL(const nsCSubstring &str, PRUint32 flags, nsACString &result) {
-    if (NS_UnescapeURL(str.Data(), str.Length(), flags, result))
-        return result;
-    return str;
-}
-#endif  // MOZ_V1_STRING_ABI
-
 /**
  * CString version of nsEscape. Returns true on success, false
  * on out of memory. To reverse this function, use NS_UnescapeURL.
  */
 inline PRBool
 NS_Escape(const nsCString& aOriginal, nsCString& aEscaped,
           nsEscapeMask aMask)
 {
--- a/xpcom/string/public/Makefile.in
+++ b/xpcom/string/public/Makefile.in
@@ -49,30 +49,27 @@ MODULE		= string
 
 EXPORTS		=				\
 		nsAString.h			\
 		nsAlgorithm.h			\
 		nsCharTraits.h			\
 		nsDependentString.h		\
 		nsDependentSubstring.h		\
 		nsLiteralString.h		\
-		nsObsoleteAString.h		\
 		nsPrintfCString.h		\
 		nsPromiseFlatString.h		\
 		nsReadableUtils.h		\
 		nsString.h			\
 		nsStringBuffer.h		\
 		nsStringFwd.h			\
 		nsStringIterator.h		\
 		nsSubstring.h			\
 		nsSubstringTuple.h		\
-		nsTAString.h			\
 		nsTDependentString.h		\
 		nsTDependentSubstring.h		\
-		nsTObsoleteAString.h		\
 		nsTPromiseFlatString.h		\
 		nsTString.h			\
 		nsTSubstring.h			\
 		nsTSubstringTuple.h		\
 		nsUTF8Utils.h			\
 		nsXPIDLString.h			\
 		string-template-def-unichar.h	\
 		string-template-def-char.h	\
--- a/xpcom/string/public/nsAString.h
+++ b/xpcom/string/public/nsAString.h
@@ -42,41 +42,36 @@
 #ifndef nsStringFwd_h___
 #include "nsStringFwd.h"
 #endif
 
 #ifndef nsStringIterator_h___
 #include "nsStringIterator.h"
 #endif
 
-#ifdef MOZ_V1_STRING_ABI
-#ifndef nsObsoleteAString_h___
-#include "nsObsoleteAString.h"
-#endif
-#endif
-
 // If some platform(s) can't handle our template that matches literal strings,
 // then we'll disable it on those platforms.
 #ifndef NS_DISABLE_LITERAL_TEMPLATE
 #  if (defined(_MSC_VER) && (_MSC_VER < 1310)) || (defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x560)) || (defined(__HP_aCC) && (__HP_aCC <= 012100))
 #    define NS_DISABLE_LITERAL_TEMPLATE
 #  endif
 #endif /* !NS_DISABLE_LITERAL_TEMPLATE */
 
 #include <string.h>
 
+#define kNotFound -1
+
   // declare nsAString
 #include "string-template-def-unichar.h"
-#include "nsTAString.h"
+#include "nsTSubstring.h"
 #include "string-template-undef.h"
 
-
   // declare nsACString
 #include "string-template-def-char.h"
-#include "nsTAString.h"
+#include "nsTSubstring.h"
 #include "string-template-undef.h"
 
 
   /**
    * ASCII case-insensitive comparator.  (for Unicode case-insensitive
    * comparision, see nsUnicharUtils.h)
    */
 class NS_COM nsCaseInsensitiveCStringComparator
deleted file mode 100644
--- a/xpcom/string/public/nsObsoleteAString.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla.
- *
- * The Initial Developer of the Original Code is IBM Corporation.
- * Portions created by IBM Corporation are Copyright (C) 2003
- * IBM Corporation. All Rights Reserved.
- *
- * Contributor(s):
- *   Darin Fisher <darin@meer.net>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef nsObsoleteAString_h___
-#define nsObsoleteAString_h___
-
-/*
-    STRING INTERNALS
-
-    This file defines nsObsoleteAString and nsObsoleteACString.  These are
-    abstract classes (interfaces), containing only virtual functions
-    corresponding to the FROZEN nsA[C]String classes.  They exist to provide
-    the new non-abstract nsA[C]String classes with a mechanism to maintain
-    backwards binary compatability.
-
-    From a binary point-of-view, the new nsA[C]String classes appear to have a
-    vtable pointer to the vtable of nsObsoleteA[C]StringThunk.
-    nsObsoleteA[C]StringThunk is a subclass of nsObsoleteA[C]String that serves
-    as a simple bridge between the virtual functions that make up the FROZEN
-    nsA[C]String contract and the new ns[C]Substring, which is now our only
-    subclass of nsA[C]String.
-
-    The methods on the new nsA[C]String are now all non-virtual.  This reduces
-    codesize at the callsite, and reduces the number of memory dereferences and
-    jumps required to invoke a method on nsA[C]String.  The result is improved
-    performance and reduced codesize.  However, to maintain binary
-    compatibility, each method on nsA[C]String must check the value of its
-    vtable to determine if it corresponds to the built-in implementation of
-    nsObsoleteA[C]String (i.e., the address of the canonical vtable).  If it
-    does, then the vtable can be ignored, and the nsA[C]String object (i.e.,
-    |this|) can be cast to ns[C]Substring directly.  In which case, the
-    nsA[C]String methods can be satisfied by invoking the corresponding methods
-    directly on ns[C]Substring.  If the vtable address does not correspond to
-    the built-in implementation, then the virtual functions on
-    nsObsoleteA[C]String must be invoked instead.
-
-    So, if a nsA[C]String reference corresponds to an external implementation
-    (such as the old nsEmbed[C]String that shipped with previous versions of
-    Mozilla), then methods invoked on that nsA[C]String will still act like
-    virtual function calls.  This ensures binary compatibility while avoiding
-    virtual function calls in most cases.
-
-    Finally, nsObsoleteA[C]String (i.e., the FROZEN nsA[C]String vtable) is
-    now a DEPRECATED interface.  See nsStringAPI.h and nsEmbedString.h for
-    the new preferred way to access nsA[C]String references in an external
-    component or Gecko embedding application.
-                                                                             */
-
-#ifndef nsStringFwd_h___
-#include "nsStringFwd.h"
-#endif
-
-#ifndef nscore_h___
-#include "nscore.h"
-#endif
-
-  // declare nsObsoleteAString
-#include "string-template-def-unichar.h"
-#include "nsTObsoleteAString.h"
-#include "string-template-undef.h"
-
-  // declare nsObsoleteACString
-#include "string-template-def-char.h"
-#include "nsTObsoleteAString.h"
-#include "string-template-undef.h"
-
-#endif // !defined(nsObsoleteAString_h___)
--- a/xpcom/string/public/nsStringFwd.h
+++ b/xpcom/string/public/nsStringFwd.h
@@ -49,59 +49,49 @@
 #error Internal string headers are not available from external-linkage code.
 #endif
 
   /**
    * double-byte (PRUnichar) string types
    */
 
 class nsAString;
-class nsObsoleteAString;
-#ifdef MOZ_V1_STRING_ABI
-class nsSubstring;
-#endif
 class nsSubstringTuple;
 class nsString;
 class nsAutoString;
 class nsDependentString;
 class nsDependentSubstring;
 class nsPromiseFlatString;
 class nsStringComparator;
 class nsDefaultStringComparator;
 class nsXPIDLString;
 
 
   /**
    * single-byte (char) string types
    */
 
 class nsACString;
-class nsObsoleteACString;
-#ifdef MOZ_V1_STRING_ABI
-class nsCSubstring;
-#endif
 class nsCSubstringTuple;
 class nsCString;
 class nsCAutoString;
 class nsDependentCString;
 class nsDependentCSubstring;
 class nsPromiseFlatCString;
 class nsCStringComparator;
 class nsDefaultCStringComparator;
 class nsXPIDLCString;
 
 
   /**
    * typedefs for backwards compatibility
    */
 
-#ifndef MOZ_V1_STRING_ABI
 typedef nsAString             nsSubstring;
 typedef nsACString            nsCSubstring;
-#endif
 
 typedef nsString              nsAFlatString;
 typedef nsSubstring           nsASingleFragmentString;
 
 typedef nsCString             nsAFlatCString;
 typedef nsCSubstring          nsASingleFragmentCString;
 
   
--- a/xpcom/string/public/nsStringIterator.h
+++ b/xpcom/string/public/nsStringIterator.h
@@ -63,20 +63,16 @@ class nsReadingIterator
       typedef ptrdiff_t                   difference_type;
       typedef CharT                       value_type;
       typedef const CharT*                pointer;
       typedef const CharT&                reference;
 
     private:
       friend class nsAString;
       friend class nsACString;
-#ifdef MOZ_V1_STRING_ABI
-      friend class nsSubstring;
-      friend class nsCSubstring;
-#endif
 
         // unfortunately, the API for nsReadingIterator requires that the
         // iterator know its start and end positions.  this was needed when
         // we supported multi-fragment strings, but now it is really just
         // extra baggage.  we should remove mStart and mEnd at some point.
 
       const CharT* mStart;
       const CharT* mEnd;
@@ -201,20 +197,16 @@ class nsWritingIterator
       typedef ptrdiff_t                  difference_type;
       typedef CharT                      value_type;
       typedef CharT*                     pointer;
       typedef CharT&                     reference;
 
     private:
       friend class nsAString;
       friend class nsACString;
-#ifdef MOZ_V1_STRING_ABI
-      friend class nsSubstring;
-      friend class nsCSubstring;
-#endif
 
         // unfortunately, the API for nsWritingIterator requires that the
         // iterator know its start and end positions.  this was needed when
         // we supported multi-fragment strings, but now it is really just
         // extra baggage.  we should remove mStart and mEnd at some point.
 
       CharT* mStart;
       CharT* mEnd;
--- a/xpcom/string/public/nsSubstring.h
+++ b/xpcom/string/public/nsSubstring.h
@@ -31,44 +31,11 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#ifndef nsSubstring_h___
-#define nsSubstring_h___
-
 #ifndef nsAString_h___
 #include "nsAString.h"
 #endif
-
-#define kNotFound -1
-
-// If some platform(s) can't handle our template that matches literal strings,
-// then we'll disable it on those platforms.
-#ifndef NS_DISABLE_LITERAL_TEMPLATE
-#  if (defined(_MSC_VER) && (_MSC_VER < 1310)) || (defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x560)) || (defined(__HP_aCC) && (__HP_aCC <= 012100))
-#    define NS_DISABLE_LITERAL_TEMPLATE
-#  endif
-#endif /* !NS_DISABLE_LITERAL_TEMPLATE */
-
-#include <string.h>
-
-  // declare nsSubstring
-#include "string-template-def-unichar.h"
-#include "nsTSubstring.h"
-#include "string-template-undef.h"
-
-
-  // declare nsCSubstring
-#include "string-template-def-char.h"
-#include "nsTSubstring.h"
-#include "string-template-undef.h"
-
-
-#ifndef nsSubstringTuple_h___
-#include "nsSubstringTuple.h"
-#endif
-
-#endif // !defined(nsSubstring_h___)
deleted file mode 100644
--- a/xpcom/string/public/nsTAString.h
+++ /dev/null
@@ -1,638 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla.
- *
- * The Initial Developer of the Original Code is IBM Corporation.
- * Portions created by IBM Corporation are Copyright (C) 2003
- * IBM Corporation. All Rights Reserved.
- *
- * Contributor(s):
- *   Scott Collins <scc@mozilla.org> (original author)
- *   Darin Fisher <darin@meer.net>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef MOZILLA_INTERNAL_API
-#error Cannot use internal string classes without MOZILLA_INTERNAL_API defined. Use the frozen header nsStringAPI.h instead.
-#endif
-
-  /**
-   * The base for string comparators
-   */
-class NS_COM nsTStringComparator_CharT
-  {
-    public:
-      typedef CharT char_type;
-
-      nsTStringComparator_CharT() {}
-
-      virtual int operator()( const char_type*, const char_type*, PRUint32 length ) const = 0;
-      virtual int operator()( char_type, char_type ) const = 0;
-  };
-
-
-  /**
-   * The default string comparator (case-sensitive comparision)
-   */
-class NS_COM nsTDefaultStringComparator_CharT
-    : public nsTStringComparator_CharT
-  {
-    public:
-      typedef CharT char_type;
-
-      nsTDefaultStringComparator_CharT() {}
-
-      virtual int operator()( const char_type*, const char_type*, PRUint32 length ) const;
-      virtual int operator()( char_type, char_type ) const;
-  };
-
-
-  /**
-   * nsTAString is the most abstract class in the string hierarchy.
-   *
-   * In its original inception, nsTAString was designed to allow the data
-   * storage for a string to be separated into multiple fragments.  This was
-   * intended to enable lazy string flattening or avoid string flattening
-   * altogether in some cases.  This abstraction, however, meant that every
-   * single string operation (including simple operations such as IsEmpty() and
-   * BeginReading()) required virtual function calls.  A virtual destructor was
-   * also required.  This not only meant additional overhead for invoking
-   * string methods but also added to additional codesize at every callsite (to
-   * load the virtual function address).
-   *
-   * Today nsTAString exists mainly for backwards compatibility of the string
-   * API.  It is restricted to representing a contiguous array of characters,
-   * where the character array is not necessarily null-terminated.  Moreover,
-   * since nsTAString's virtual function table was frozen for Mozilla 1.0,
-   * nsTAString necessarily maintains ABI compatibility with older versions of
-   * Gecko.  (nsTObsoleteAString provides that frozen ABI.  See
-   * nsObsoleteAString.h for a description of how we solve the ABI
-   * compatibility requirement while eliminating virtual function calls on
-   * nsTAString.)
-   *
-   * XPIDL still generates C++ header files with references to nsTAStrings, so
-   * nsTAString will still be heavily used in real code.
-   *
-   * If the opportunity to break ABI compatibility with Mozilla 1.0 were to
-   * ever arise, our first move should be to make nsTAString equate to
-   * nsTSubstring.  This may in fact be an option today for some Gecko-based
-   * products.
-   */
-class nsTAString_CharT
-  {
-    public:
-
-      typedef CharT                                  char_type;
-      typedef nsCharTraits<char_type>                char_traits;
-
-      typedef char_traits::incompatible_char_type    incompatible_char_type;
-
-      typedef nsTAString_CharT                       self_type;
-      typedef nsTAString_CharT                       abstract_string_type;
-      typedef nsTObsoleteAString_CharT               obsolete_string_type;
-      typedef nsTSubstring_CharT                     substring_type;
-      typedef nsTSubstringTuple_CharT                substring_tuple_type;
-
-      typedef nsReadingIterator<char_type>           const_iterator;
-      typedef nsWritingIterator<char_type>           iterator;
-
-      typedef nsTStringComparator_CharT              comparator_type;
-
-      typedef PRUint32                               size_type;
-      typedef PRUint32                               index_type;
-
-#ifdef MOZ_V1_STRING_ABI
-    public:
-
-        // this acts like a virtual destructor
-      NS_COM NS_CONSTRUCTOR_FASTCALL ~nsTAString_CharT();
-
-
-        /**
-         * BeginReading/EndReading can be used to get immutable access to the
-         * string's underlying buffer.  EndReading returns a pointer to the
-         * end of the string's buffer.  nsReadableUtils.h provides a collection
-         * of utility functions that work with these iterators.
-         */
-
-      inline const_iterator& BeginReading( const_iterator& iter ) const
-        {
-          size_type len = GetReadableBuffer(&iter.mStart);
-          iter.mEnd = iter.mStart + len;
-          iter.mPosition = iter.mStart;
-          return iter;
-        }
-
-      inline const_iterator& EndReading( const_iterator& iter ) const
-        {
-          size_type len = GetReadableBuffer(&iter.mStart);
-          iter.mEnd = iter.mStart + len;
-          iter.mPosition = iter.mEnd;
-          return iter;
-        }
-
-      inline const char_type* BeginReading() const
-        {
-          const char_type *b;
-          GetReadableBuffer(&b);
-          return b;
-        }
-
-      inline const char_type* EndReading() const
-        {
-          const char_type *b;
-          size_type len = GetReadableBuffer(&b);
-          return b + len;
-        }
-
-
-        /**
-         * BeginWriting/EndWriting can be used to get mutable access to the
-         * string's underlying buffer.  EndWriting returns a pointer to the
-         * end of the string's buffer.
-         *
-         * If these methods are unable to return a mutable buffer, then they
-         * will return a null iterator.
-         */
-
-      inline iterator& BeginWriting( iterator& iter )
-        {
-          size_type len = GetWritableBuffer(&iter.mStart);
-          iter.mEnd = iter.mStart + len;
-          iter.mPosition = iter.mStart;
-          return iter;
-        }
-
-      inline iterator& EndWriting( iterator& iter )
-        {
-          size_type len = GetWritableBuffer(&iter.mStart);
-          iter.mEnd = iter.mStart + len;
-          iter.mPosition = iter.mEnd;
-          return iter;
-        }
-
-      inline char_type* BeginWriting()
-        {
-          char_type *b;
-          GetWritableBuffer(&b);
-          return b;
-        }
-
-      inline char_type* EndWriting()
-        {
-          char_type *b;
-          size_type len = GetWritableBuffer(&b);
-          return b ? b + len : nsnull;
-        }
-
-
-        /**
-         * Get a const pointer to the string's internal buffer.  The caller
-         * MUST NOT modify the characters at the returned address.
-         *
-         * @returns The length of the buffer in characters.
-         */
-      inline size_type GetData( const char_type** data ) const
-        {
-          return GetReadableBuffer(data);
-        }
-
-        /**
-         * Get a pointer to the string's internal buffer, optionally resizing
-         * the buffer first.  If size_type(-1) is passed for newLen, then the
-         * current length of the string is used.  The caller MAY modify the
-         * characters at the returned address (up to but not exceeding the
-         * length of the string).
-         *
-         * @returns The length of the buffer in characters or 0 if unable to
-         * satisfy the request due to low-memory conditions.
-         */
-      inline size_type GetMutableData( char_type** data, size_type newLen = size_type(-1) )
-        {
-          return GetWritableBuffer(data, newLen);
-        }
-
-
-        /**
-         * Length checking functions.  IsEmpty is a helper function to avoid
-         * writing code like: |if (str.Length() == 0)|
-         */
-
-      NS_COM size_type NS_FASTCALL Length() const;
-      PRBool IsEmpty() const { return Length() == 0; }
-
-
-        /**
-         * String equality tests.  Pass a string comparator if you want to
-         * control how the strings are compared.  By default, a binary
-         * "case-sensitive" comparision is performed.
-         */
-
-      NS_COM PRBool NS_FASTCALL Equals( const self_type& ) const;
-      NS_COM PRBool NS_FASTCALL Equals( const self_type&, const comparator_type& ) const;
-      NS_COM PRBool NS_FASTCALL Equals( const char_type* ) const;
-      NS_COM PRBool NS_FASTCALL Equals( const char_type*, const comparator_type& ) const;
-
-        /**
-         * An efficient comparison with ASCII that can be used even
-         * for wide strings. Call this version when you know the
-         * length of 'data'.
-         */
-      NS_COM PRBool NS_FASTCALL EqualsASCII( const char* data, size_type len ) const;
-        /**
-         * An efficient comparison with ASCII that can be used even
-         * for wide strings. Call this version when 'data' is
-         * null-terminated.
-         */
-      NS_COM PRBool NS_FASTCALL EqualsASCII( const char* data ) const;
-
-    // EqualsLiteral must ONLY be applied to an actual literal string.
-    // Do not attempt to use it with a regular char* pointer, or with a char
-    // array variable.
-    // The template trick to acquire the array length at compile time without
-    // using a macro is due to Corey Kosak, with much thanks.
-#ifdef NS_DISABLE_LITERAL_TEMPLATE
-      inline PRBool EqualsLiteral( const char* str ) const
-        {
-          return EqualsASCII(str);
-        }
-#else
-      template<int N>
-      inline PRBool EqualsLiteral( const char (&str)[N] ) const
-        {
-          return EqualsASCII(str, N-1);
-        }
-      template<int N>
-      inline PRBool EqualsLiteral( char (&str)[N] ) const
-        {
-          const char* s = str;
-          return EqualsASCII(s, N-1);
-        }
-#endif
-
-    // The LowerCaseEquals methods compare the lower case version of
-    // this string to some ASCII/Literal string. The ASCII string is
-    // *not* lowercased for you. If you compare to an ASCII or literal
-    // string that contains an uppercase character, it is guaranteed to
-    // return false. We will throw assertions too.
-      NS_COM PRBool NS_FASTCALL LowerCaseEqualsASCII( const char* data, size_type len ) const;
-      NS_COM PRBool NS_FASTCALL LowerCaseEqualsASCII( const char* data ) const;
-
-    // LowerCaseEqualsLiteral must ONLY be applied to an actual
-    // literal string.  Do not attempt to use it with a regular char*
-    // pointer, or with a char array variable. Use
-    // LowerCaseEqualsASCII for them.
-#ifdef NS_DISABLE_LITERAL_TEMPLATE
-      inline PRBool LowerCaseEqualsLiteral( const char* str ) const
-        {
-          return LowerCaseEqualsASCII(str);
-        }
-#else
-      template<int N>
-      inline PRBool LowerCaseEqualsLiteral( const char (&str)[N] ) const
-        {
-          return LowerCaseEqualsASCII(str, N-1);
-        }
-      template<int N>
-      inline PRBool LowerCaseEqualsLiteral( char (&str)[N] ) const
-        {
-          const char* s = str;
-          return LowerCaseEqualsASCII(s, N-1);
-        }
-#endif
-
-        /**
-         * A string always references a non-null data pointer.  In some
-         * applications (e.g., the DOM) it is necessary for a string class
-         * to have some way to distinguish an empty string from a null (or
-         * void) string.  These methods enable support for the concept of
-         * a void string.
-         */
-
-      NS_COM PRBool NS_FASTCALL IsVoid() const;
-      NS_COM void NS_FASTCALL SetIsVoid( PRBool );
-
-
-        /**
-         * This method returns true if the string's underlying buffer is
-         * null-terminated.  This should rarely be needed by applications.
-         * The PromiseFlatTString method should be used to ensure that a
-         * string's underlying buffer is null-terminated.
-         */
-
-      NS_COM PRBool NS_FASTCALL IsTerminated() const;
-
-
-        /**
-         * These are contant time since nsTAString uses flat storage
-         */
-      NS_COM char_type NS_FASTCALL First() const;
-      NS_COM char_type NS_FASTCALL Last() const;
-
-
-        /**
-         * Returns the number of occurrences of the given character.
-         */
-      NS_COM size_type NS_FASTCALL CountChar( char_type ) const;
-
-
-        /**
-         * Locates the offset of the first occurrence of the character.  Pass a
-         * non-zero offset to control where the search begins.
-         */
-
-      NS_COM PRInt32 NS_FASTCALL FindChar( char_type, index_type offset = 0 ) const;
-
-
-        /**
-         * SetCapacity is not required to do anything; however, it can be used
-         * as a hint to the implementation to reduce allocations.
-         *
-         * SetCapacity(0) is a suggestion to discard all associated storage.
-         * 
-         * The |newCapacity| value does not include room for the null
-         * terminator.  The actual allocation size will be one unit larger
-         * than the given value to make room for a null terminator.
-         */
-      NS_COM void NS_FASTCALL SetCapacity( size_type newCapacity );
-
-
-        /**
-         * SetLength is used to resize the string's internal buffer.  It has
-         * the effect of moving the string's null-terminator to the offset
-         * specified by |newLen|, and if the string's internal buffer was
-         * previously readonly or dependent on some other string, then it will
-         * be copied.  If there is insufficient memory to perform the resize,
-         * then the string will not be modified.  If the length of the string
-         * is reduced sufficiently, then the string's internal buffer may be
-         * resized to something smaller.
-         */
-      NS_COM void NS_FASTCALL SetLength( size_type newLen );
-
-
-        /**
-         * Can't use |Truncate| to make a string longer!
-         */
-      void Truncate( size_type newLen = 0 )
-        {
-          NS_ASSERTION(newLen <= Length(), "Truncate cannot make string longer");
-          SetLength(newLen);
-        }
-
-
-        /**
-         * |Assign| and |operator=| make |this| equivalent to the string or
-         * buffer given as an argument.  If possible, they do this by sharing
-         * a reference counted buffer (see |nsTSubstring|).  If not, they copy
-         * the buffer into their own buffer.
-         */
-
-      NS_COM void NS_FASTCALL Assign( const self_type& readable );
-      NS_COM void NS_FASTCALL Assign( const substring_tuple_type& tuple );
-      NS_COM void NS_FASTCALL Assign( const char_type* data );
-      NS_COM void NS_FASTCALL Assign( const char_type* data, size_type length );
-      NS_COM void NS_FASTCALL Assign( char_type c );
-
-      NS_COM void NS_FASTCALL AssignASCII( const char* data, size_type length );
-      NS_COM void NS_FASTCALL AssignASCII( const char* data );
-
-    // AssignLiteral must ONLY be applied to an actual literal string.
-    // Do not attempt to use it with a regular char* pointer, or with a char
-    // array variable. Use AssignASCII for those.
-#ifdef NS_DISABLE_LITERAL_TEMPLATE
-      void AssignLiteral( const char* str )
-                  { AssignASCII(str); }
-#else
-      template<int N>
-      void AssignLiteral( const char (&str)[N] )
-                  { AssignASCII(str, N-1); }
-      template<int N>
-      void AssignLiteral( char (&str)[N] )
-                  { AssignASCII(str, N-1); }
-#endif
-
-        // copy-assignment operator.  I must define my own if I don't want the compiler to make me one
-      self_type& operator=( const self_type& readable )                                             { Assign(readable); return *this; }
-      self_type& operator=( const substring_tuple_type& tuple )                                     { Assign(tuple); return *this; }
-      self_type& operator=( const char_type* data )                                                 { Assign(data); return *this; }
-      self_type& operator=( char_type c )                                                           { Assign(c); return *this; }
-
-
-
-        /**
-         * |Append|, |operator+=| are used to add characters to the end of this string.
-         */ 
-
-      NS_COM void NS_FASTCALL Append( const self_type& readable );
-      NS_COM void NS_FASTCALL Append( const substring_tuple_type& tuple );
-      NS_COM void NS_FASTCALL Append( const char_type* data );
-      NS_COM void NS_FASTCALL Append( const char_type* data, size_type length );
-      NS_COM void NS_FASTCALL Append( char_type c );
-
-      NS_COM void NS_FASTCALL AppendASCII( const char* data, size_type length );
-      NS_COM void NS_FASTCALL AppendASCII( const char* data );
-
-    // AppendLiteral must ONLY be applied to an actual literal string.
-    // Do not attempt to use it with a regular char* pointer, or with a char
-    // array variable. Use AppendASCII for those.
-#ifdef NS_DISABLE_LITERAL_TEMPLATE
-      void AppendLiteral( const char* str )
-                  { AppendASCII(str); }
-#else
-      template<int N>
-      void AppendLiteral( const char (&str)[N] )
-                  { AppendASCII(str, N-1); }
-      template<int N>
-      void AppendLiteral( char (&str)[N] )
-                  { AppendASCII(str, N-1); }
-#endif
-
-      self_type& operator+=( const self_type& readable )                                            { Append(readable); return *this; }
-      self_type& operator+=( const substring_tuple_type& tuple )                                    { Append(tuple); return *this; }
-      self_type& operator+=( const char_type* data )                                                { Append(data); return *this; }
-      self_type& operator+=( char_type c )                                                          { Append(c); return *this; }
-
-
-        /**
-         * |Insert| is used to add characters into this string at a given position.
-         * NOTE: It's a shame the |pos| parameter isn't at the front of the arg list.
-         */ 
-
-      NS_COM void NS_FASTCALL Insert( const self_type& readable, index_type pos );
-      NS_COM void NS_FASTCALL Insert( const substring_tuple_type& tuple, index_type pos );
-      NS_COM void NS_FASTCALL Insert( const char_type* data, index_type pos );
-      NS_COM void NS_FASTCALL Insert( const char_type* data, index_type pos, size_type length );
-      NS_COM void NS_FASTCALL Insert( char_type c, index_type pos );
-
-
-        /**
-         * |Cut| is used to remove a range of characters from this string.
-         */
-
-      NS_COM void NS_FASTCALL Cut( index_type cutStart, size_type cutLength );
-
-      
-        /**
-         * |Replace| is used overwrite a range of characters from this string.
-         */
-
-      NS_COM void NS_FASTCALL Replace( index_type cutStart, size_type cutLength, const self_type& readable );
-      NS_COM void NS_FASTCALL Replace( index_type cutStart, size_type cutLength, const substring_tuple_type& readable );
-
-      
-        /**
-         * this is public to support automatic conversion of tuple to abstract
-         * string, which is necessary to support our API.
-         */
-      nsTAString_CharT(const substring_tuple_type& tuple)
-        : mVTable(obsolete_string_type::sCanonicalVTable)
-        , mData(nsnull)
-        , mLength(0)
-        , mFlags(0)
-        {
-          NS_ASSERTION(mVTable, "mVTable is null! Is this a static string instance?!");
-          Assign(tuple);
-        }
-
-    protected:
-
-      friend class nsTSubstringTuple_CharT;
-
-      // GCC 3.2 erroneously needs these (even though they are subclasses!)
-      friend class nsTSubstring_CharT;
-      friend class nsTDependentSubstring_CharT;
-      friend class nsTPromiseFlatString_CharT;
-
-        /**
-         * the address of our virtual function table.  required for backwards
-         * compatibility with Mozilla 1.0 frozen nsAC?String interface.
-         */
-      const void* mVTable;
-
-        /**
-         * these fields are "here" only when mVTable == sCanonicalVTable.
-         *
-         * they exist to support automatic construction of a nsTAString
-         * from a nsTSubstringTuple.
-         */
-      char_type*  mData;
-      size_type   mLength;
-      PRUint32    mFlags;
-
-        /**
-         * nsTAString must be subclassed before it can be instantiated.
-         */
-      nsTAString_CharT(char_type* data, size_type length, PRUint32 flags)
-        : mVTable(obsolete_string_type::sCanonicalVTable)
-        , mData(data)
-        , mLength(length)
-        , mFlags(flags)
-        {
-          NS_ASSERTION(mVTable, "mVTable is null! Is this a static string instance?!");
-        }
-
-        /**
-         * optional ctor for use by subclasses.
-         *
-         * NOTE: mData and mLength are intentionally left uninitialized.
-         */
-      explicit
-      nsTAString_CharT(PRUint32 flags)
-        : mVTable(obsolete_string_type::sCanonicalVTable)
-        , mFlags(flags)
-        {
-          NS_ASSERTION(mVTable, "mVTable is null! Is this a static string instance?!");
-        }
-
-        /**
-         * get pointer to internal string buffer (may not be null terminated).
-         * return length of buffer.
-         */
-      NS_COM size_type NS_FASTCALL GetReadableBuffer( const char_type **data ) const;
-      NS_COM size_type NS_FASTCALL GetWritableBuffer(       char_type **data, size_type newLen = size_type(-1) );
-
-        /**
-         * returns true if this tuple is dependent on (i.e., overlapping with)
-         * the given char sequence.
-         */
-      PRBool NS_FASTCALL IsDependentOn(const char_type *start, const char_type *end) const;
-
-        /**
-         * we can be converted to a const nsTSubstring (dependent on this)
-         */
-      const substring_type NS_FASTCALL ToSubstring() const;
-
-        /**
-         * type cast helpers
-         */
-
-      const obsolete_string_type* AsObsoleteString() const
-        {
-          return reinterpret_cast<const obsolete_string_type*>(this);
-        }
-
-      obsolete_string_type* AsObsoleteString()
-        {
-          return reinterpret_cast<obsolete_string_type*>(this);
-        }
-
-      const substring_type* AsSubstring() const
-        {
-          return reinterpret_cast<const substring_type*>(this);
-        }
-
-      substring_type* AsSubstring()
-        {
-          return reinterpret_cast<substring_type*>(this);
-        }
-
-    private:
-
-        // GCC 2.95.3, EGCS-2.91.66, Sun Workshop/Forte, and IBM VisualAge C++
-        // require a public copy-constructor in order to support automatic
-        // construction of a nsTAString from a nsTSubstringTuple.  I believe
-        // enabling the default copy-constructor is harmless, but I do not want
-        // it to be enabled by default because that might tempt people into
-        // using it (where it would be invalid).
-#if !defined(__SUNPRO_CC) && \
-   !(defined(_AIX) && defined(__IBMCPP__)) && \
-   (!defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ > 95)
-
-        // NOT TO BE IMPLEMENTED
-      nsTAString_CharT( const self_type& );
-
-#endif
-
-        // NOT TO BE IMPLEMENTED
-      void operator=     ( incompatible_char_type );
-      void Assign        ( incompatible_char_type );
-      void operator+=    ( incompatible_char_type );
-      void Append        ( incompatible_char_type );
-      void Insert        ( incompatible_char_type, index_type );
-#endif
-  };
--- a/xpcom/string/public/nsTDependentString.h
+++ b/xpcom/string/public/nsTDependentString.h
@@ -123,12 +123,9 @@ class nsTDependentString_CharT : public 
         {
           Rebind(start, PRUint32(end - start));
         }
 
     private:
       
       // NOT USED
       nsTDependentString_CharT( const substring_tuple_type& );
-#ifdef MOZ_V1_STRING_ABI
-      nsTDependentString_CharT( const abstract_string_type& );
-#endif
   };
--- a/xpcom/string/public/nsTDependentSubstring.h
+++ b/xpcom/string/public/nsTDependentSubstring.h
@@ -35,40 +35,37 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 
   /**
    * nsTDependentSubstring_CharT
+   *
+   * A string class which wraps an external array of string characters. It
+   * is the client code's responsibility to ensure that the external buffer
+   * remains valid for a long as the string is alive.
+   *
+   * NAMES:
+   *   nsDependentSubstring for wide characters
+   *   nsDependentCSubstring for narrow characters
    */
 class nsTDependentSubstring_CharT : public nsTSubstring_CharT
   {
     public:
 
       typedef nsTDependentSubstring_CharT    self_type;
 
     public:
 
-#ifdef MOZ_V1_STRING_ABI
-      NS_COM void Rebind( const abstract_string_type&, PRUint32 startPos, PRUint32 length = size_type(-1) );
-#endif
       NS_COM void Rebind( const substring_type&, PRUint32 startPos, PRUint32 length = size_type(-1) );
 
       NS_COM void Rebind( const char_type* start, const char_type* end );
 
-#ifdef MOZ_V1_STRING_ABI
-      nsTDependentSubstring_CharT( const abstract_string_type& str, PRUint32 startPos, PRUint32 length = size_type(-1) )
-        : substring_type()
-        {
-          Rebind(str, startPos, length);
-        }
-#endif
-
       nsTDependentSubstring_CharT( const substring_type& str, PRUint32 startPos, PRUint32 length = size_type(-1) )
         : substring_type()
         {
           Rebind(str, startPos, length);
         }
 
       nsTDependentSubstring_CharT( const char_type* start, const char_type* end )
         : substring_type(const_cast<char_type*>(start), PRUint32(end - start), F_NONE) {}
@@ -82,25 +79,16 @@ class nsTDependentSubstring_CharT : publ
 
       // auto-generated copy-constructor OK (XXX really?? what about base class copy-ctor?)
 
     private:
         // NOT USED
       void operator=( const self_type& );        // we're immutable, you can't assign into a substring
   };
 
-#ifdef MOZ_V1_STRING_ABI
-inline
-const nsTDependentSubstring_CharT
-Substring( const nsTAString_CharT& str, PRUint32 startPos, PRUint32 length = PRUint32(-1) )
-  {
-    return nsTDependentSubstring_CharT(str, startPos, length);
-  }
-#endif
-
 inline
 const nsTDependentSubstring_CharT
 Substring( const nsTSubstring_CharT& str, PRUint32 startPos, PRUint32 length = PRUint32(-1) )
   {
     return nsTDependentSubstring_CharT(str, startPos, length);
   }
 
 inline
@@ -112,39 +100,21 @@ Substring( const nsReadingIterator<CharT
 
 inline
 const nsTDependentSubstring_CharT
 Substring( const CharT* start, const CharT* end )
   {
     return nsTDependentSubstring_CharT(start, end);
   }
 
-#ifdef MOZ_V1_STRING_ABI
-inline
-const nsTDependentSubstring_CharT
-StringHead( const nsTAString_CharT& str, PRUint32 count )
-  {
-    return nsTDependentSubstring_CharT(str, 0, count);
-  }
-#endif
-
 inline
 const nsTDependentSubstring_CharT
 StringHead( const nsTSubstring_CharT& str, PRUint32 count )
   {
     return nsTDependentSubstring_CharT(str, 0, count);
   }
 
-#ifdef MOZ_V1_STRING_ABI
-inline
-const nsTDependentSubstring_CharT
-StringTail( const nsTAString_CharT& str, PRUint32 count )
-  {
-    return nsTDependentSubstring_CharT(str, str.Length() - count, count);
-  }
-#endif
-
 inline
 const nsTDependentSubstring_CharT
 StringTail( const nsTSubstring_CharT& str, PRUint32 count )
   {
     return nsTDependentSubstring_CharT(str, str.Length() - count, count);
   }
deleted file mode 100644
--- a/xpcom/string/public/nsTObsoleteAString.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla.
- *
- * The Initial Developer of the Original Code is IBM Corporation.
- * Portions created by IBM Corporation are Copyright (C) 2003
- * IBM Corporation. All Rights Reserved.
- *
- * Contributor(s):
- *   Darin Fisher <darin@meer.net>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-
-  /**
-   * nsTObsoleteAString_CharT : binary compatible with old nsAC?String vtable
-   *
-   * @status FROZEN
-   */
-class nsTObsoleteAString_CharT
-  {
-    public:
-      /**
-       * This is holds the address of the vtable for the canonical string
-       * implementation (i.e., nsTString).
-       */
-      NS_COM static const void *sCanonicalVTable;
-
-        /**
-         * An |nsFragmentRequest| is used to tell |GetReadableFragment| and
-         * |GetWritableFragment| what to do.
-         *
-         * @see GetReadableFragment
-         */
-      enum nsFragmentRequest { kPrevFragment, kFirstFragment, kLastFragment, kNextFragment, kFragmentAt };
-
-        /**
-         * A |nsReadableFragment| provides |const| access to a contiguous hunk of
-         * string of homogenous units, e.g., bytes (|char|).  This doesn't mean it
-         * represents a flat hunk.  It could be a variable length encoding, for
-         * instance UTF-8.  And the fragment itself need not be zero-terminated.
-         *
-         * An |nsReadableFragment| is the underlying machinery that lets
-         * |nsReadingIterator|s work.
-         *
-         * @see nsReadingIterator
-         * @status FROZEN
-         */
-      struct nsReadableFragment
-        {
-          const CharT*  mStart;
-          const CharT*  mEnd;
-          const void*   mFragmentIdentifier;
-
-          nsReadableFragment() : mStart(0), mEnd(0), mFragmentIdentifier(0) {}
-        };
-
-
-        /**
-         * A |nsWritableFragment| provides non-|const| access to a contiguous hunk of
-         * string of homogenous units, e.g., bytes (|char|).  This doesn't mean it
-         * represents a flat hunk.  It could be a variable length encoding, for
-         * instance UTF-8.  And the fragment itself need not be zero-terminated.
-         *
-         * An |nsWritableFragment| is the underlying machinery that lets
-         * |nsWritingIterator|s work.
-         *
-         * @see nsWritingIterator
-         * @status FROZEN
-         */
-      struct nsWritableFragment
-        {
-          CharT*    mStart;
-          CharT*    mEnd;
-          void*     mFragmentIdentifier;
-
-          nsWritableFragment() : mStart(0), mEnd(0), mFragmentIdentifier(0) {}
-        };
-
-    protected:
-
-      typedef CharT                                char_type;
-
-      typedef void                                 buffer_handle_type;
-      typedef void                                 shared_buffer_handle_type;
-      typedef nsReadableFragment                   const_fragment_type;
-      typedef nsWritableFragment                   fragment_type;
-
-      typedef nsTAString_CharT                     abstract_string_type;
-
-      typedef PRUint32                             size_type;
-      typedef PRUint32                             index_type;
-
-    protected:
-
-      friend class nsTAString_CharT;
-      friend class nsTSubstring_CharT;
-
-      /** here's the old nsAC?String vtable **/
-
-      virtual ~nsTObsoleteAString_CharT() { }
-
-      virtual PRUint32                          GetImplementationFlags() const = 0;
-      virtual const        buffer_handle_type*  GetFlatBufferHandle()    const = 0;
-      virtual const        buffer_handle_type*  GetBufferHandle()        const = 0;
-      virtual const shared_buffer_handle_type*  GetSharedBufferHandle()  const = 0;
-
-      virtual size_type Length() const = 0;
-
-      virtual PRBool IsVoid() const = 0;
-      virtual void SetIsVoid( PRBool ) = 0;
-
-      virtual void SetCapacity( size_type ) = 0;
-      virtual void SetLength( size_type ) = 0;
-
-      virtual void Cut( index_type cutStart, size_type cutLength ) = 0;
-
-      virtual void do_AssignFromReadable( const abstract_string_type& ) = 0;
-      virtual void do_AssignFromElementPtr( const char_type* ) = 0;
-      virtual void do_AssignFromElementPtrLength( const char_type*, size_type ) = 0;
-      virtual void do_AssignFromElement( char_type ) = 0;
-
-      virtual void do_AppendFromReadable( const abstract_string_type& ) = 0;
-      virtual void do_AppendFromElementPtr( const char_type* ) = 0;
-      virtual void do_AppendFromElementPtrLength( const char_type*, size_type ) = 0;
-      virtual void do_AppendFromElement( char_type ) = 0;
-
-      virtual void do_InsertFromReadable( const abstract_string_type&, index_type ) = 0;
-      virtual void do_InsertFromElementPtr( const char_type*, index_type ) = 0;
-      virtual void do_InsertFromElementPtrLength( const char_type*, index_type, size_type ) = 0;
-      virtual void do_InsertFromElement( char_type, index_type ) = 0;
-
-      virtual void do_ReplaceFromReadable( index_type, size_type, const abstract_string_type& ) = 0;
-
-      virtual const char_type* GetReadableFragment( const_fragment_type&, nsFragmentRequest, PRUint32 = 0 ) const = 0;
-      virtual       char_type* GetWritableFragment(       fragment_type&, nsFragmentRequest, PRUint32 = 0 ) = 0;
-  };
-
-  // forward declare implementation
-class nsTObsoleteAStringThunk_CharT;
--- a/xpcom/string/public/nsTPromiseFlatString.h
+++ b/xpcom/string/public/nsTPromiseFlatString.h
@@ -95,63 +95,42 @@ class nsTPromiseFlatString_CharT : publi
   {
     public:
 
       typedef nsTPromiseFlatString_CharT    self_type;
 
     private:
 
       NS_COM void Init( const substring_type& );
-#ifdef MOZ_V1_STRING_ABI
-      NS_COM void Init( const abstract_string_type& );
-#endif
 
         // NOT TO BE IMPLEMENTED
       void operator=( const self_type& );
 
         // NOT TO BE IMPLEMENTED
       nsTPromiseFlatString_CharT();
 
     public:
 
       explicit
       nsTPromiseFlatString_CharT( const substring_type& str )
         : string_type()
         {
           Init(str);
         }
 
-#ifdef MOZ_V1_STRING_ABI
-      explicit
-      nsTPromiseFlatString_CharT( const abstract_string_type& readable )
-        : string_type()
-        {
-          Init(readable);
-        }
-#endif
-
       explicit
       nsTPromiseFlatString_CharT( const substring_tuple_type& tuple )
         : string_type()
         {
           // nothing else to do here except assign the value of the tuple
           // into ourselves.
           Assign(tuple);
         }
   };
 
-#ifdef MOZ_V1_STRING_ABI
-inline
-const nsTPromiseFlatString_CharT
-TPromiseFlatString_CharT( const nsTAString_CharT& str )
-  {
-    return nsTPromiseFlatString_CharT(str);
-  }
-#endif
-
   // e.g., PromiseFlatCString(Substring(s))
 inline
 const nsTPromiseFlatString_CharT
 TPromiseFlatString_CharT( const nsTSubstring_CharT& frag )
   {
     return nsTPromiseFlatString_CharT(frag);
   }
 
--- a/xpcom/string/public/nsTString.h
+++ b/xpcom/string/public/nsTString.h
@@ -39,16 +39,20 @@
  * ***** END LICENSE BLOCK ***** */
 
 
   /**
    * This is the canonical null-terminated string class.  All subclasses
    * promise null-terminated storage.  Instances of this class allocate
    * strings on the heap.
    *
+   * NAMES:
+   *   nsString for wide characters
+   *   nsCString for narrow characters
+   * 
    * This class is also known as nsAFlat[C]String, where "flat" is used
    * to denote a null-terminated string.
    */
 class nsTString_CharT : public nsTSubstring_CharT
   {
     public:
 
       typedef nsTString_CharT    self_type;
@@ -84,37 +88,29 @@ class nsTString_CharT : public nsTSubstr
 
       nsTString_CharT( const substring_tuple_type& tuple )
         : substring_type()
         {
           Assign(tuple);
         }
 
       explicit
-#ifdef MOZ_V1_STRING_ABI
-      nsTString_CharT( const abstract_string_type& readable )
-#else
       nsTString_CharT( const substring_type& readable )
-#endif
         : substring_type()
         {
           Assign(readable);
         }
 
 
         // |operator=| does not inherit, so we must define our own
       self_type& operator=( char_type c )                                                       { Assign(c);        return *this; }
       self_type& operator=( const char_type* data )                                             { Assign(data);     return *this; }
       self_type& operator=( const self_type& str )                                              { Assign(str);      return *this; }
       self_type& operator=( const substring_type& str )                                         { Assign(str);      return *this; }
       self_type& operator=( const substring_tuple_type& tuple )                                 { Assign(tuple);    return *this; }
-#ifdef MOZ_V1_STRING_ABI
-      self_type& operator=( const abstract_string_type& readable )                              { Assign(readable); return *this; }
-#endif
-
 
         /**
          * returns the null-terminated string
          */
 
       const char_type* get() const
         {
           return mData;
@@ -452,34 +448,37 @@ class nsTFixedString_CharT : public nsTS
 
       NS_COM nsTFixedString_CharT( char_type* data, size_type storageSize, size_type length );
 
         // |operator=| does not inherit, so we must define our own
       self_type& operator=( char_type c )                                                       { Assign(c);        return *this; }
       self_type& operator=( const char_type* data )                                             { Assign(data);     return *this; }
       self_type& operator=( const substring_type& str )                                         { Assign(str);      return *this; }
       self_type& operator=( const substring_tuple_type& tuple )                                 { Assign(tuple);    return *this; }
-#ifdef MOZ_V1_STRING_ABI
-      self_type& operator=( const abstract_string_type& readable )                              { Assign(readable); return *this; }
-#endif
 
     protected:
 
       friend class nsTSubstring_CharT;
 
       size_type  mFixedCapacity;
       char_type *mFixedBuf;
   };
 
 
   /**
    * nsTAutoString_CharT
    *
    * Subclass of nsTString_CharT that adds support for stack-based string
-   * allocation.  Do not allocate this class on the heap! ;-)
+   * allocation.  It is normally not a good idea to use this class on the
+   * heap, because it will allocate space which may be wasted if the string
+   * it contains is significantly smaller or any larger than 64 characters.
+   *
+   * NAMES:
+   *   nsAutoString for wide characters
+   *   nsCAutoString for narrow characters
    */
 class NS_STACK_CLASS nsTAutoString_CharT : public nsTFixedString_CharT
   {
     public:
 
       typedef nsTAutoString_CharT    self_type;
 
     public:
@@ -520,49 +519,42 @@ class NS_STACK_CLASS nsTAutoString_CharT
         }
 
       nsTAutoString_CharT( const substring_tuple_type& tuple )
         : fixed_string_type(mStorage, kDefaultStorageSize, 0)
         {
           Assign(tuple);
         }
 
-#ifdef MOZ_V1_STRING_ABI
-      explicit
-      nsTAutoString_CharT( const abstract_string_type& readable )
-        : fixed_string_type(mStorage, kDefaultStorageSize, 0)
-        {
-          Assign(readable);
-        }
-#endif
-
         // |operator=| does not inherit, so we must define our own
       self_type& operator=( char_type c )                                                       { Assign(c);        return *this; }
       self_type& operator=( const char_type* data )                                             { Assign(data);     return *this; }
       self_type& operator=( const self_type& str )                                              { Assign(str);      return *this; }
       self_type& operator=( const substring_type& str )                                         { Assign(str);      return *this; }
       self_type& operator=( const substring_tuple_type& tuple )                                 { Assign(tuple);    return *this; }
-#ifdef MOZ_V1_STRING_ABI
-      self_type& operator=( const abstract_string_type& readable )                              { Assign(readable); return *this; }
-#endif
 
       enum { kDefaultStorageSize = 64 };
 
     private:
 
       char_type mStorage[kDefaultStorageSize];
   };
 
 
   /**
    * nsTXPIDLString extends nsTString such that:
    *
    *   (1) mData can be null
    *   (2) objects of this type can be automatically cast to |const CharT*|
-   *   (3) getter_Copies method is supported to adopt data
+   *   (3) getter_Copies method is supported to adopt data allocated with
+   *       NS_Alloc, such as "out string" parameters in XPIDL.
+   *
+   * NAMES:
+   *   nsXPIDLString for wide characters
+   *   nsXPIDLCString for narrow characters
    */
 class nsTXPIDLString_CharT : public nsTString_CharT
   {
     public:
 
       typedef nsTXPIDLString_CharT    self_type;
 
     public:
@@ -597,19 +589,16 @@ class nsTXPIDLString_CharT : public nsTS
         }
 
         // |operator=| does not inherit, so we must define our own
       self_type& operator=( char_type c )                                                       { Assign(c);        return *this; }
       self_type& operator=( const char_type* data )                                             { Assign(data);     return *this; }
       self_type& operator=( const self_type& str )                                              { Assign(str);      return *this; }
       self_type& operator=( const substring_type& str )                                         { Assign(str);      return *this; }
       self_type& operator=( const substring_tuple_type& tuple )                                 { Assign(tuple);    return *this; }
-#ifdef MOZ_V1_STRING_ABI
-      self_type& operator=( const abstract_string_type& readable )                              { Assign(readable); return *this; }
-#endif
   };
 
 
   /**
    * getter_Copies support for use with raw string out params:
    *
    *    NS_IMETHOD GetBlah(char**);
    *    
@@ -680,19 +669,16 @@ class nsTAdoptingString_CharT : public n
       nsTAdoptingString_CharT( const self_type& str )
         {
           *this = str;
         }
 
         // |operator=| does not inherit, so we must define our own
       self_type& operator=( const substring_type& str )                                         { Assign(str);      return *this; }
       self_type& operator=( const substring_tuple_type& tuple )                                 { Assign(tuple);    return *this; }
-#ifdef MOZ_V1_STRING_ABI
-      self_type& operator=( const abstract_string_type& readable )                              { Assign(readable); return *this; }
-#endif
 
         // Adopt(), if possible, when assigning to a self_type&. Note
         // that this violates the constness of str, str is always
         // truncated when this operator is called.
       NS_COM self_type& operator=( const self_type& str );
 
     private:
         // NOT TO BE IMPLEMENTED.
--- a/xpcom/string/public/nsTSubstring.h
+++ b/xpcom/string/public/nsTSubstring.h
@@ -31,54 +31,93 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
+#ifndef MOZILLA_INTERNAL_API
+#error Cannot use internal string classes without MOZILLA_INTERNAL_API defined. Use the frozen header nsStringAPI.h instead.
+#endif
+
+  /**
+   * The base for string comparators
+   */
+class NS_COM nsTStringComparator_CharT
+  {
+    public:
+      typedef CharT char_type;
+
+      nsTStringComparator_CharT() {}
+
+      virtual int operator()( const char_type*, const char_type*, PRUint32 length ) const = 0;
+      virtual int operator()( char_type, char_type ) const = 0;
+  };
+
 
   /**
-   * nsTSubstring
-   *
-   * The base string type.  This type is not instantiated directly.  A sub-
-   * class is instantiated instead.  For example, see nsTString.
+   * The default string comparator (case-sensitive comparision)
+   */
+class NS_COM nsTDefaultStringComparator_CharT
+    : public nsTStringComparator_CharT
+  {
+    public:
+      typedef CharT char_type;
+
+      nsTDefaultStringComparator_CharT() {}
+
+      virtual int operator()( const char_type*, const char_type*, PRUint32 length ) const;
+      virtual int operator()( char_type, char_type ) const;
+  };
+
+  /**
+   * nsTSubstring is the most abstract class in the string hierarchy. It
+   * represents a single contiguous array of characters, which may or may not
+   * be null-terminated. This type is not instantiated directly.  A sub-class
+   * is instantiated instead.  For example, see nsTString.
    *
-   * This type works like nsTAString except that it does not have the ABI
-   * requirements of that interface.  Like nsTAString, nsTSubstring
-   * represents a single contiguous array of characters that may or may not
-   * be null-terminated.
+   * NAMES:
+   *   nsAString for wide characters
+   *   nsACString for narrow characters
    *
    * Many of the accessors on nsTSubstring are inlined as an optimization.
-   *
-   * This class is also known as "nsASingleFragmentC?String".
    */
-class nsTSubstring_CharT : public nsTAString_CharT
+class nsTSubstring_CharT
   {
     public:
+      typedef CharT                               char_type;
 
-      typedef nsTSubstring_CharT    self_type;
-      typedef nsTString_CharT       string_type;
+      typedef nsCharTraits<char_type>             char_traits;
+      typedef char_traits::incompatible_char_type incompatible_char_type;
+
+      typedef nsTSubstring_CharT                  self_type;
+      typedef self_type                           abstract_string_type;
+      typedef self_type                           base_string_type;
 
-      typedef char_type*            char_iterator;
-      typedef const char_type*      const_char_iterator;
+      typedef self_type                           substring_type;
+      typedef nsTSubstringTuple_CharT             substring_tuple_type;
+      typedef nsTString_CharT                     string_type;
+
+      typedef nsReadingIterator<char_type>        const_iterator;
+      typedef nsWritingIterator<char_type>        iterator;
 
-#ifdef MOZ_V1_STRING_ABI
-      typedef nsTAString_CharT      base_string_type;
-#else
-      typedef nsTSubstring_CharT    base_string_type;
-#endif
+      typedef nsTStringComparator_CharT           comparator_type;
+
+      typedef char_type*                          char_iterator;
+      typedef const char_type*                    const_char_iterator;
+
+      typedef PRUint32                            size_type;
+      typedef PRUint32                            index_type;
 
     public:
 
-#ifndef MOZ_V1_STRING_ABI
         // this acts like a virtual destructor
       NS_COM NS_CONSTRUCTOR_FASTCALL ~nsTSubstring_CharT();
-#endif
 
         /**
          * reading iterators
          */
 
       const_char_iterator BeginReading() const { return mData; }
       const_char_iterator EndReading() const { return mData + mLength; }
 
@@ -221,21 +260,16 @@ class nsTSubstring_CharT : public nsTASt
 
         /**
          * equality
          */
 
       NS_COM PRBool NS_FASTCALL Equals( const self_type& ) const;
       NS_COM PRBool NS_FASTCALL Equals( const self_type&, const comparator_type& ) const;
 
-#ifdef MOZ_V1_STRING_ABI
-      NS_COM PRBool NS_FASTCALL Equals( const abstract_string_type& readable ) const;
-      NS_COM PRBool NS_FASTCALL Equals( const abstract_string_type& readable, const comparator_type& comp ) const;
-#endif
-
       NS_COM PRBool NS_FASTCALL Equals( const char_type* data ) const;
       NS_COM PRBool NS_FASTCALL Equals( const char_type* data, const comparator_type& comp ) const;
 
         /**
          * An efficient comparison with ASCII that can be used even
          * for wide strings. Call this version when you know the
          * length of 'data'.
          */
@@ -305,19 +339,16 @@ class nsTSubstring_CharT : public nsTASt
         /**
          * assignment
          */
 
       NS_COM void NS_FASTCALL Assign( char_type c );
       NS_COM void NS_FASTCALL Assign( const char_type* data, size_type length = size_type(-1) );
       NS_COM void NS_FASTCALL Assign( const self_type& );
       NS_COM void NS_FASTCALL Assign( const substring_tuple_type& );
-#ifdef MOZ_V1_STRING_ABI
-      NS_COM void NS_FASTCALL Assign( const abstract_string_type& );
-#endif
 
       NS_COM void NS_FASTCALL AssignASCII( const char* data, size_type length );
       NS_COM void NS_FASTCALL AssignASCII( const char* data );
 
     // AssignLiteral must ONLY be applied to an actual literal string.
     // Do not attempt to use it with a regular char* pointer, or with a char
     // array variable. Use AssignASCII for those.
 #ifdef NS_DISABLE_LITERAL_TEMPLATE
@@ -331,44 +362,35 @@ class nsTSubstring_CharT : public nsTASt
       void AssignLiteral( char (&str)[N] )
                   { AssignASCII(str, N-1); }
 #endif
 
       self_type& operator=( char_type c )                                                       { Assign(c);        return *this; }
       self_type& operator=( const char_type* data )                                             { Assign(data);     return *this; }
       self_type& operator=( const self_type& str )                                              { Assign(str);      return *this; }
       self_type& operator=( const substring_tuple_type& tuple )                                 { Assign(tuple);    return *this; }
-#ifdef MOZ_V1_STRING_ABI
-      self_type& operator=( const abstract_string_type& readable )                              { Assign(readable); return *this; }
-#endif
 
       NS_COM void NS_FASTCALL Adopt( char_type* data, size_type length = size_type(-1) );
 
 
         /**
          * buffer manipulation
          */
 
       NS_COM void NS_FASTCALL Replace( index_type cutStart, size_type cutLength, char_type c );
       NS_COM void NS_FASTCALL Replace( index_type cutStart, size_type cutLength, const char_type* data, size_type length = size_type(-1) );
              void Replace( index_type cutStart, size_type cutLength, const self_type& str )      { Replace(cutStart, cutLength, str.Data(), str.Length()); }
       NS_COM void NS_FASTCALL Replace( index_type cutStart, size_type cutLength, const substring_tuple_type& tuple );
-#ifdef MOZ_V1_STRING_ABI
-      NS_COM void NS_FASTCALL Replace( index_type cutStart, size_type cutLength, const abstract_string_type& readable );
-#endif
 
       NS_COM void NS_FASTCALL ReplaceASCII( index_type cutStart, size_type cutLength, const char* data, size_type length = size_type(-1) );
 
       void Append( char_type c )                                                                 { Replace(mLength, 0, c); }
       void Append( const char_type* data, size_type length = size_type(-1) )                     { Replace(mLength, 0, data, length); }
       void Append( const self_type& str )                                                        { Replace(mLength, 0, str); }
       void Append( const substring_tuple_type& tuple )                                           { Replace(mLength, 0, tuple); }
-#ifdef MOZ_V1_STRING_ABI
-      void Append( const abstract_string_type& readable )                                        { Replace(mLength, 0, readable); }
-#endif
 
       void AppendASCII( const char* data, size_type length = size_type(-1) )                     { ReplaceASCII(mLength, 0, data, length); }
 
     // AppendLiteral must ONLY be applied to an actual literal string.
     // Do not attempt to use it with a regular char* pointer, or with a char
     // array variable. Use AppendASCII for those.
 #ifdef NS_DISABLE_LITERAL_TEMPLATE
       void AppendLiteral( const char* str )
@@ -381,27 +403,21 @@ class nsTSubstring_CharT : public nsTASt
       void AppendLiteral( char (&str)[N] )
                   { AppendASCII(str, N-1); }
 #endif
 
       self_type& operator+=( char_type c )                                                       { Append(c);        return *this; }
       self_type& operator+=( const char_type* data )                                             { Append(data);     return *this; }
       self_type& operator+=( const self_type& str )                                              { Append(str);      return *this; }
       self_type& operator+=( const substring_tuple_type& tuple )                                 { Append(tuple);    return *this; }
-#ifdef MOZ_V1_STRING_ABI
-      self_type& operator+=( const abstract_string_type& readable )                              { Append(readable); return *this; }
-#endif
 
       void Insert( char_type c, index_type pos )                                                 { Replace(pos, 0, c); }
       void Insert( const char_type* data, index_type pos, size_type length = size_type(-1) )     { Replace(pos, 0, data, length); }
       void Insert( const self_type& str, index_type pos )                                        { Replace(pos, 0, str); }
       void Insert( const substring_tuple_type& tuple, index_type pos )                           { Replace(pos, 0, tuple); }
-#ifdef MOZ_V1_STRING_ABI
-      void Insert( const abstract_string_type& readable, index_type pos )                        { Replace(pos, 0, readable); }
-#endif
 
       void Cut( index_type cutStart, size_type cutLength )                                       { Replace(cutStart, cutLength, char_traits::sEmptyBuffer, 0); }
 
 
         /**
          * buffer sizing
          */
 
@@ -491,27 +507,24 @@ class nsTSubstring_CharT : public nsTASt
 #ifdef XP_OS2 /* Workaround for GCC 3.3.x bug. */
        nsTSubstring_CharT( char_type *data, size_type length, PRUint32 flags ) NS_COM;
 #else
        NS_COM nsTSubstring_CharT( char_type *data, size_type length, PRUint32 flags );
 #endif
     protected:
 
       friend class nsTObsoleteAStringThunk_CharT;
-      friend class nsTAString_CharT;
       friend class nsTSubstringTuple_CharT;
 
       // XXX GCC 3.4 needs this :-(
       friend class nsTPromiseFlatString_CharT;
 
-#ifndef MOZ_V1_STRING_ABI
       char_type*  mData;
       size_type   mLength;
       PRUint32    mFlags;
-#endif
 
         // default initialization 
       NS_COM nsTSubstring_CharT();
 
         // version of constructor that leaves mData and mLength uninitialized
       explicit
       NS_COM nsTSubstring_CharT( PRUint32 flags );
 
--- a/xpcom/string/public/nsTSubstringTuple.h
+++ b/xpcom/string/public/nsTSubstringTuple.h
@@ -50,22 +50,17 @@ class nsTSubstringTuple_CharT
   {
     public:
 
       typedef CharT                      char_type;
       typedef nsCharTraits<char_type>    char_traits;
 
       typedef nsTSubstringTuple_CharT    self_type;
       typedef nsTSubstring_CharT         substring_type;
-#ifdef MOZ_V1_STRING_ABI
-      typedef nsTAString_CharT           base_string_type;
-      typedef nsTObsoleteAString_CharT   obsolete_string_type;
-#else
       typedef nsTSubstring_CharT         base_string_type;
-#endif
       typedef PRUint32                   size_type;
 
     public:
 
       nsTSubstringTuple_CharT(const base_string_type* a, const base_string_type* b)
         : mHead(nsnull)
         , mFragA(a)
         , mFragB(b) {}
--- a/xpcom/string/public/string-template-def-char.h
+++ b/xpcom/string/public/string-template-def-char.h
@@ -33,32 +33,21 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #define CharT                               char
 #define CharT_is_char                       1
-#define nsTObsoleteAString_CharT            nsObsoleteACString
-#define nsTObsoleteAStringThunk_CharT       nsObsoleteACStringThunk
-#ifdef MOZ_V1_STRING_ABI
-#define nsTAString_CharT                    nsACString
-#else
-#define nsTAString_CharT                    nsCSubstring_base
-#endif
 #define nsTAString_IncompatibleCharT        nsAString
 #define nsTString_CharT                     nsCString
 #define nsTFixedString_CharT                nsFixedCString
 #define nsTAutoString_CharT                 nsCAutoString
-#ifdef MOZ_V1_STRING_ABI
-#define nsTSubstring_CharT                  nsCSubstring
-#else
 #define nsTSubstring_CharT                  nsACString
-#endif
 #define nsTSubstringTuple_CharT             nsCSubstringTuple
 #define nsTStringComparator_CharT           nsCStringComparator
 #define nsTDefaultStringComparator_CharT    nsDefaultCStringComparator
 #define nsTDependentString_CharT            nsDependentCString
 #define nsTDependentSubstring_CharT         nsDependentCSubstring
 #define nsTXPIDLString_CharT                nsXPIDLCString
 #define nsTGetterCopies_CharT               nsCGetterCopies
 #define nsTAdoptingString_CharT             nsAdoptingCString
--- a/xpcom/string/public/string-template-def-unichar.h
+++ b/xpcom/string/public/string-template-def-unichar.h
@@ -33,32 +33,21 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #define CharT                               PRUnichar
 #define CharT_is_PRUnichar                  1
-#define nsTObsoleteAString_CharT            nsObsoleteAString
-#define nsTObsoleteAStringThunk_CharT       nsObsoleteAStringThunk
-#ifdef MOZ_V1_STRING_ABI
-#define nsTAString_CharT                    nsAString
-#else
-#define nsTAString_CharT                    nsSubstring_base
-#endif
 #define nsTAString_IncompatibleCharT        nsACString
 #define nsTString_CharT                     nsString
 #define nsTFixedString_CharT                nsFixedString
 #define nsTAutoString_CharT                 nsAutoString
-#ifdef MOZ_V1_STRING_ABI
-#define nsTSubstring_CharT                  nsSubstring
-#else
 #define nsTSubstring_CharT                  nsAString
-#endif
 #define nsTSubstringTuple_CharT             nsSubstringTuple
 #define nsTStringComparator_CharT           nsStringComparator
 #define nsTDefaultStringComparator_CharT    nsDefaultStringComparator
 #define nsTDependentString_CharT            nsDependentString
 #define nsTDependentSubstring_CharT         nsDependentSubstring
 #define nsTXPIDLString_CharT                nsXPIDLString
 #define nsTGetterCopies_CharT               nsGetterCopies
 #define nsTAdoptingString_CharT             nsAdoptingString
--- a/xpcom/string/public/string-template-undef.h
+++ b/xpcom/string/public/string-template-undef.h
@@ -34,19 +34,16 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #undef CharT
 #undef CharT_is_PRUnichar
 #undef CharT_is_char
-#undef nsTObsoleteAString_CharT
-#undef nsTObsoleteAStringThunk_CharT
-#undef nsTAString_CharT
 #undef nsTAString_IncompatibleCharT
 #undef nsTString_CharT
 #undef nsTFixedString_CharT
 #undef nsTAutoString_CharT
 #undef nsTSubstring_CharT
 #undef nsTSubstringTuple_CharT
 #undef nsTStringComparator_CharT
 #undef nsTDefaultStringComparator_CharT
--- a/xpcom/string/src/Makefile.in
+++ b/xpcom/string/src/Makefile.in
@@ -60,23 +60,16 @@ CPPSRCS		=				\
 		nsReadableUtils.cpp		\
 		nsSubstring.cpp			\
 		nsSubstringTuple.cpp		\
 		nsString.cpp			\
 		nsStringComparator.cpp		\
 		nsStringObsolete.cpp		\
 		$(NULL)
 
-ifdef MOZ_V1_STRING_ABI
-CPPSRCS		+= 				\
-		nsAString.cpp			\
-		nsObsoleteAStringThunk.cpp	\
-		$(NULL)
-endif
-
 # we don't want the shared lib, but we want to force the creation of a
 # static lib.
 FORCE_STATIC_LIB = 1
 
 # Force use of PIC
 FORCE_USE_PIC	= 1
 
 include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/xpcom/string/src/nsAString.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla.
- *
- * The Initial Developer of the Original Code is IBM Corporation.
- * Portions created by IBM Corporation are Copyright (C) 2003
- * IBM Corporation. All Rights Reserved.
- *
- * Contributor(s):
- *   Darin Fisher <darin@meer.net>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsAString.h"
-#include "nsObsoleteAString.h"
-#include "nsString.h"
-
-  // define nsAString
-#include "string-template-def-unichar.h"
-#include "nsTAString.cpp"
-#include "string-template-undef.h"
-
-  // define nsACString
-#include "string-template-def-char.h"
-#include "nsTAString.cpp"
-#include "string-template-undef.h"
deleted file mode 100644
--- a/xpcom/string/src/nsObsoleteAStringThunk.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla.
- *
- * The Initial Developer of the Original Code is IBM Corporation.
- * Portions created by IBM Corporation are Copyright (C) 2003
- * IBM Corporation. All Rights Reserved.
- *
- * Contributor(s):
- *   Darin Fisher <darin@meer.net>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsObsoleteAString.h"
-#include "nsString.h"
-
-
-  // define nsObsoleteAStringThunk
-#include "string-template-def-unichar.h"
-#include "nsTObsoleteAStringThunk.cpp"
-#include "string-template-undef.h"
-
-
-  // define nsObsoleteACStringThunk
-#include "string-template-def-char.h"
-#include "nsTObsoleteAStringThunk.cpp"
-#include "string-template-undef.h"
--- a/xpcom/string/src/nsReadableUtils.cpp
+++ b/xpcom/string/src/nsReadableUtils.cpp
@@ -647,27 +647,16 @@ class ConvertToUpperCase
             if ((ch >= 'a') && (ch <= 'z'))
               *cp = ch - ('a' - 'A');
             ++cp;
           }
           return aSourceLength;
         }
   };
 
-#ifdef MOZ_V1_STRING_ABI
-NS_COM
-void
-ToUpperCase( nsACString& aCString )
-  {
-    nsACString::iterator fromBegin, fromEnd;
-    ConvertToUpperCase converter;
-    copy_string(aCString.BeginWriting(fromBegin), aCString.EndWriting(fromEnd), converter);
-  }
-#endif
-
 NS_COM
 void
 ToUpperCase( nsCSubstring& aCString )
   {
     ConvertToUpperCase converter;
     char* start;
     converter.write(aCString.BeginWriting(start), aCString.Length());
   }
@@ -739,27 +728,16 @@ class ConvertToLowerCase
             if ((ch >= 'A') && (ch <= 'Z'))
               *cp = ch + ('a' - 'A');
             ++cp;
           }
           return aSourceLength;
         }
   };
 
-#ifdef MOZ_V1_STRING_ABI
-NS_COM
-void
-ToLowerCase( nsACString& aCString )
-  {
-    nsACString::iterator fromBegin, fromEnd;
-    ConvertToLowerCase converter;
-    copy_string(aCString.BeginWriting(fromBegin), aCString.EndWriting(fromEnd), converter);
-  }
-#endif
-
 NS_COM
 void
 ToLowerCase( nsCSubstring& aCString )
   {
     ConvertToLowerCase converter;
     char* start;
     converter.write(aCString.BeginWriting(start), aCString.Length());
   }
--- a/xpcom/string/src/nsSubstring.cpp
+++ b/xpcom/string/src/nsSubstring.cpp
@@ -133,19 +133,16 @@ ReleaseData( void* data, PRUint32 flags 
 // XXX or we could make nsStringBuffer be a friend of nsTAString
 
 class nsAStringAccessor : public nsAString
   {
     private:
       nsAStringAccessor(); // NOT IMPLEMENTED
 
     public:
-#ifdef MOZ_V1_STRING_ABI
-      const void *vtable() const { return mVTable; }
-#endif
       char_type  *data() const   { return mData; }
       size_type   length() const { return mLength; }
       PRUint32    flags() const  { return mFlags; }
 
       void set(char_type *data, size_type len, PRUint32 flags)
         {
           ReleaseData(mData, mFlags);
           mData = data;
@@ -155,19 +152,16 @@ class nsAStringAccessor : public nsAStri
   };
 
 class nsACStringAccessor : public nsACString
   {
     private:
       nsACStringAccessor(); // NOT IMPLEMENTED
 
     public:
-#ifdef MOZ_V1_STRING_ABI
-      const void *vtable() const { return mVTable; }
-#endif
       char_type  *data() const   { return mData; }
       size_type   length() const { return mLength; }
       PRUint32    flags() const  { return mFlags; }
 
       void set(char_type *data, size_type len, PRUint32 flags)
         {
           ReleaseData(mData, mFlags);
           mData = data;
@@ -244,78 +238,56 @@ nsStringBuffer::Realloc(nsStringBuffer* 
   }
 
 nsStringBuffer*
 nsStringBuffer::FromString(const nsAString& str)
   {
     const nsAStringAccessor* accessor =
         static_cast<const nsAStringAccessor*>(&str);
 
-#ifdef MOZ_V1_STRING_ABI
-    if (accessor->vtable() != nsObsoleteAString::sCanonicalVTable)
-      return nsnull;
-#endif
     if (!(accessor->flags() & nsSubstring::F_SHARED))
       return nsnull;
 
     return FromData(accessor->data());
   }
 
 nsStringBuffer*
 nsStringBuffer::FromString(const nsACString& str)
   {
     const nsACStringAccessor* accessor =
         static_cast<const nsACStringAccessor*>(&str);
 
-#ifdef MOZ_V1_STRING_ABI
-    if (accessor->vtable() != nsObsoleteACString::sCanonicalVTable)
-      return nsnull;
-#endif
     if (!(accessor->flags() & nsCSubstring::F_SHARED))
       return nsnull;
 
     return FromData(accessor->data());
   }
 
 void
 nsStringBuffer::ToString(PRUint32 len, nsAString &str)
   {
     PRUnichar* data = static_cast<PRUnichar*>(Data());
 
     nsAStringAccessor* accessor = static_cast<nsAStringAccessor*>(&str);
-#ifdef MOZ_V1_STRING_ABI
-    if (accessor->vtable() != nsObsoleteAString::sCanonicalVTable)
-      {
-        str.Assign(data, len);
-        return;
-      }
-#endif
     NS_ASSERTION(data[len] == PRUnichar(0), "data should be null terminated");
 
     // preserve class flags
     PRUint32 flags = accessor->flags();
     flags = (flags & 0xFFFF0000) | nsSubstring::F_SHARED | nsSubstring::F_TERMINATED;
 
     AddRef();
     accessor->set(data, len, flags);
   }
 
 void
 nsStringBuffer::ToString(PRUint32 len, nsACString &str)
   {
     char* data = static_cast<char*>(Data());
 
     nsACStringAccessor* accessor = static_cast<nsACStringAccessor*>(&str);
-#ifdef MOZ_V1_STRING_ABI
-    if (accessor->vtable() != nsObsoleteACString::sCanonicalVTable)
-      {
-        str.Assign(data, len);
-        return;
-      }
-#endif
     NS_ASSERTION(data[len] == char(0), "data should be null terminated");
 
     // preserve class flags
     PRUint32 flags = accessor->flags();
     flags = (flags & 0xFFFF0000) | nsCSubstring::F_SHARED | nsCSubstring::F_TERMINATED;
 
     AddRef();
     accessor->set(data, len, flags);
--- a/xpcom/string/src/nsSubstringTuple.cpp
+++ b/xpcom/string/src/nsSubstringTuple.cpp
@@ -33,34 +33,18 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsSubstringTuple.h"
 
-#if 0
-  // convert fragment to |const string_base_type&|
-#define TO_SUBSTRING(_v)                                        \
-    ( (ptrdiff_t(_v) & 0x1)                                     \
-        ? reinterpret_cast<const abstract_string_type*>(        \
-            ((unsigned long)_v & ~0x1))->ToSubstring()          \
-        : *reinterpret_cast<const substring_type*>((_v)) )
-#endif
-
   // convert fragment to |const substring_type&|
-#ifdef MOZ_V1_STRING_ABI
-#define TO_SUBSTRING(_v)                                        \
-    ( (_v)->mVTable == obsolete_string_type::sCanonicalVTable   \
-        ? *(_v)->AsSubstring()                                   \
-        :  (_v)->ToSubstring() )
-#else
 #define TO_SUBSTRING(_v) (*(_v))
-#endif
 
   // define nsSubstringTuple
 #include "string-template-def-unichar.h"
 #include "nsTSubstringTuple.cpp"
 #include "string-template-undef.h"
 
   // define nsCSubstringTuple
 #include "string-template-def-char.h"
deleted file mode 100644
--- a/xpcom/string/src/nsTAString.cpp
+++ /dev/null
@@ -1,524 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla.
- *
- * The Initial Developer of the Original Code is IBM Corporation.
- * Portions created by IBM Corporation are Copyright (C) 2003
- * IBM Corporation. All Rights Reserved.
- *
- * Contributor(s):
- *   Darin Fisher <darin@meer.net>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-
-  /**
-   * Some comments on this implementation...
-   *
-   * This class is a bridge between the old string implementation and the new
-   * string implementation.  If mVTable points to the canonical vtable for the
-   * new string implementation, then we can cast directly to the new string
-   * classes (helped by the AsSubstring() methods).  However, if mVTable is not
-   * ours, then we need to call through the vtable to satisfy the nsTAString
-   * methods.
-   *
-   * In most cases we will avoid the vtable.
-   */
-
-
-nsTAString_CharT::~nsTAString_CharT()
-  {
-    NS_ASSERTION(mVTable, "mVTable is null! Is this a static string instance?!");
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Finalize();
-    else
-      AsObsoleteString()->~nsTObsoleteAString_CharT();
-  }
-
-
-nsTAString_CharT::size_type
-nsTAString_CharT::Length() const
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->Length();
-
-    return AsObsoleteString()->Length();
-  }
-
-PRBool
-nsTAString_CharT::Equals( const self_type& readable ) const
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->Equals(readable);
-
-    return ToSubstring().Equals(readable);
-  }
-
-PRBool
-nsTAString_CharT::Equals( const self_type& readable, const comparator_type& comparator ) const
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->Equals(readable, comparator);
-
-    return ToSubstring().Equals(readable, comparator);
-  }
-
-PRBool
-nsTAString_CharT::Equals( const char_type* data ) const
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->Equals(data);
-
-    return ToSubstring().Equals(data);
-  }
-
-PRBool
-nsTAString_CharT::Equals( const char_type* data, const comparator_type& comparator ) const
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->Equals(data, comparator);
-
-    return ToSubstring().Equals(data, comparator);
-  }
-
-PRBool
-nsTAString_CharT::EqualsASCII( const char* data, size_type len ) const
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->EqualsASCII(data, len);
-
-    return ToSubstring().EqualsASCII(data, len);
-  }
-
-PRBool
-nsTAString_CharT::EqualsASCII( const char* data ) const
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->EqualsASCII(data);
-
-    return ToSubstring().EqualsASCII(data);
-  }
-
-PRBool
-nsTAString_CharT::LowerCaseEqualsASCII( const char* data, size_type len ) const
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->LowerCaseEqualsASCII(data, len);
-
-    return ToSubstring().LowerCaseEqualsASCII(data, len);
-  }
-
-PRBool
-nsTAString_CharT::LowerCaseEqualsASCII( const char* data ) const
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->LowerCaseEqualsASCII(data);
-
-    return ToSubstring().LowerCaseEqualsASCII(data);
-  }
-
-PRBool
-nsTAString_CharT::IsVoid() const
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->IsVoid();
-
-    return AsObsoleteString()->IsVoid();
-  }
-
-void
-nsTAString_CharT::SetIsVoid( PRBool val )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->SetIsVoid(val);
-    else
-      AsObsoleteString()->SetIsVoid(val);
-  }
-
-PRBool
-nsTAString_CharT::IsTerminated() const
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->IsTerminated();
-
-    return AsObsoleteString()->GetFlatBufferHandle() != nsnull;
-  }
-
-CharT
-nsTAString_CharT::First() const
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->First();
-
-    return ToSubstring().First();
-  }
-
-CharT
-nsTAString_CharT::Last() const
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->Last();
-
-    return ToSubstring().Last();
-  }
-
-nsTAString_CharT::size_type
-nsTAString_CharT::CountChar( char_type c ) const
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->CountChar(c);
-
-    return ToSubstring().CountChar(c);
-  }
-
-PRInt32
-nsTAString_CharT::FindChar( char_type c, index_type offset ) const
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->FindChar(c, offset);
-
-    return ToSubstring().FindChar(c, offset);
-  }
-
-void
-nsTAString_CharT::SetCapacity( size_type size )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->SetCapacity(size);
-    else
-      AsObsoleteString()->SetCapacity(size);
-  }
-
-void
-nsTAString_CharT::SetLength( size_type size )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->SetLength(size);
-    else
-      AsObsoleteString()->SetLength(size);
-  }
-
-void
-nsTAString_CharT::Assign( const self_type& readable )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Assign(readable);
-    else
-      AsObsoleteString()->do_AssignFromReadable(readable);
-  }
-
-void
-nsTAString_CharT::Assign( const substring_tuple_type& tuple )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Assign(tuple);
-    else
-      AsObsoleteString()->do_AssignFromReadable(nsTAutoString_CharT(tuple));
-  }
-
-void
-nsTAString_CharT::Assign( const char_type* data )
-  {
-    // null check and SetLength(0) cases needed for backwards compat
-
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Assign(data);
-    else if (data)
-      AsObsoleteString()->do_AssignFromElementPtr(data);
-    else
-      AsObsoleteString()->SetLength(0);
-  }
-
-void
-nsTAString_CharT::Assign( const char_type* data, size_type length )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Assign(data, length);
-    else
-      AsObsoleteString()->do_AssignFromElementPtrLength(data, length);
-  }
-
-void
-nsTAString_CharT::AssignASCII( const char* data )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->AssignASCII(data);
-    else
-      {
-#ifdef CharT_is_char
-        AsObsoleteString()->do_AssignFromElementPtr(data);
-#else
-        nsTAutoString_CharT temp;
-        temp.AssignASCII(data);
-        AsObsoleteString()->do_AssignFromReadable(temp);
-#endif
-      }
-  }
-
-void
-nsTAString_CharT::AssignASCII( const char* data, size_type length )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->AssignASCII(data, length);
-    else
-      {
-#ifdef CharT_is_char
-        AsObsoleteString()->do_AssignFromElementPtrLength(data, length);
-#else
-        nsTAutoString_CharT temp;
-        temp.AssignASCII(data, length);
-        AsObsoleteString()->do_AssignFromReadable(temp);
-#endif
-      }
-  }
-
-void
-nsTAString_CharT::Assign( char_type c )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Assign(c);
-    else
-      AsObsoleteString()->do_AssignFromElement(c);
-  }
-
-void
-nsTAString_CharT::Append( const self_type& readable )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Append(readable);
-    else
-      AsObsoleteString()->do_AppendFromReadable(readable);
-  }
-
-void
-nsTAString_CharT::Append( const substring_tuple_type& tuple )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Append(tuple);
-    else
-      AsObsoleteString()->do_AppendFromReadable(nsTAutoString_CharT(tuple));
-  }
-
-void
-nsTAString_CharT::Append( const char_type* data )
-  {
-    // null check case needed for backwards compat
-
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Append(data);
-    else if (data)
-      AsObsoleteString()->do_AppendFromElementPtr(data);
-  }
-
-void
-nsTAString_CharT::Append( const char_type* data, size_type length )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Append(data, length);
-    else
-      AsObsoleteString()->do_AppendFromElementPtrLength(data, length);
-  }
-
-void
-nsTAString_CharT::AppendASCII( const char* data )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->AppendASCII(data);
-    else
-      {
-#ifdef CharT_is_char
-        AsObsoleteString()->do_AppendFromElementPtr(data);
-#else
-        nsTAutoString_CharT temp;
-        temp.AssignASCII(data);
-        AsObsoleteString()->do_AppendFromReadable(temp);
-#endif
-      }
-  }
-
-void
-nsTAString_CharT::AppendASCII( const char* data, size_type length )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->AppendASCII(data, length);
-    else
-      {
-#ifdef CharT_is_char
-        AsObsoleteString()->do_AppendFromElementPtrLength(data, length);
-#else
-        nsTAutoString_CharT temp;
-        temp.AssignASCII(data, length);
-        AsObsoleteString()->do_AppendFromReadable(temp);
-#endif
-      }
-  }
-
-void
-nsTAString_CharT::Append( char_type c )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Append(c);
-    else
-      AsObsoleteString()->do_AppendFromElement(c);
-  }
-
-void
-nsTAString_CharT::Insert( const self_type& readable, index_type pos )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Insert(readable, pos);
-    else
-      AsObsoleteString()->do_InsertFromReadable(readable, pos);
-  }
-
-void
-nsTAString_CharT::Insert( const substring_tuple_type& tuple, index_type pos )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Insert(tuple, pos);
-    else
-      AsObsoleteString()->do_InsertFromReadable(nsTAutoString_CharT(tuple), pos);
-  }
-
-void
-nsTAString_CharT::Insert( const char_type* data, index_type pos )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Insert(data, pos);
-    else
-      AsObsoleteString()->do_InsertFromElementPtr(data, pos);
-  }
-
-void
-nsTAString_CharT::Insert( const char_type* data, index_type pos, size_type length )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Insert(data, pos, length);
-    else
-      AsObsoleteString()->do_InsertFromElementPtrLength(data, pos, length);
-  }
-
-void
-nsTAString_CharT::Insert( char_type c, index_type pos )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Insert(c, pos);
-    else
-      AsObsoleteString()->do_InsertFromElement(c, pos);
-  }
-
-void
-nsTAString_CharT::Cut( index_type cutStart, size_type cutLength )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Cut(cutStart, cutLength);
-    else
-      AsObsoleteString()->Cut(cutStart, cutLength);
-  }
-
-void
-nsTAString_CharT::Replace( index_type cutStart, size_type cutLength, const self_type& readable )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Replace(cutStart, cutLength, readable);
-    else
-      AsObsoleteString()->do_ReplaceFromReadable(cutStart, cutLength, readable);
-  }
-
-void
-nsTAString_CharT::Replace( index_type cutStart, size_type cutLength, const substring_tuple_type& tuple )
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      AsSubstring()->Replace(cutStart, cutLength, tuple);
-    else
-      AsObsoleteString()->do_ReplaceFromReadable(cutStart, cutLength, nsTAutoString_CharT(tuple));
-  }
-
-nsTAString_CharT::size_type
-nsTAString_CharT::GetReadableBuffer( const char_type **data ) const
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      {
-        const substring_type* str = AsSubstring();
-        *data = str->mData;
-        return str->mLength;
-      }
-
-    obsolete_string_type::const_fragment_type frag;
-    AsObsoleteString()->GetReadableFragment(frag, obsolete_string_type::kFirstFragment, 0);
-    *data = frag.mStart;
-    return (frag.mEnd - frag.mStart);
-  }
-
-nsTAString_CharT::size_type
-nsTAString_CharT::GetWritableBuffer(char_type** data, size_type size)
-  {
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->GetMutableData(data, size);
-    
-    if (size != size_type(-1) && size != AsObsoleteString()->Length())
-      {
-        AsObsoleteString()->SetLength(size);
-        if (AsObsoleteString()->Length() != size) {
-          *data = nsnull;
-          return 0;
-        }
-      }
-
-    size_type len = AsObsoleteString()->Length();
-
-    obsolete_string_type::fragment_type frag;
-    AsObsoleteString()->GetWritableFragment(frag, obsolete_string_type::kFirstFragment, 0);
-
-    if (size_type(frag.mEnd - frag.mStart) != len)
-      {
-        *data = nsnull;
-        return 0;
-      }
-
-    *data = frag.mStart;
-    return len;
-  }
-
-PRBool
-nsTAString_CharT::IsDependentOn(const char_type* start, const char_type *end) const
-  {
-      // this is an optimization...
-    if (mVTable == obsolete_string_type::sCanonicalVTable)
-      return AsSubstring()->IsDependentOn(start, end);
-
-    return ToSubstring().IsDependentOn(start, end);
-  }
-
-const nsTAString_CharT::substring_type
-nsTAString_CharT::ToSubstring() const
-  {
-    const char_type* data;
-    size_type length = GetReadableBuffer(&data);
-    return substring_type(const_cast<char_type*>(data), length, 0);
-  }
--- a/xpcom/string/src/nsTDependentSubstring.cpp
+++ b/xpcom/string/src/nsTDependentSubstring.cpp
@@ -31,35 +31,16 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#ifdef MOZ_V1_STRING_ABI
-void
-nsTDependentSubstring_CharT::Rebind( const abstract_string_type& readable, PRUint32 startPos, PRUint32 length )
-  {
-    // If we currently own a buffer, release it.
-    Finalize();
-
-    size_type strLength = readable.GetReadableBuffer((const char_type**) &mData);
-
-    if (startPos > strLength)
-      startPos = strLength;
-
-    mData += startPos;
-    mLength = NS_MIN(length, strLength - startPos);
-
-    SetDataFlags(F_NONE);
-  }
-#endif
-
 void
 nsTDependentSubstring_CharT::Rebind( const substring_type& str, PRUint32 startPos, PRUint32 length )
   {
     // If we currently own a buffer, release it.
     Finalize();
 
     size_type strLength = str.Length();
 
deleted file mode 100644
--- a/xpcom/string/src/nsTObsoleteAStringThunk.cpp
+++ /dev/null
@@ -1,235 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla.
- *
- * The Initial Developer of the Original Code is IBM Corporation.
- * Portions created by IBM Corporation are Copyright (C) 2003
- * IBM Corporation. All Rights Reserved.
- *
- * Contributor(s):
- *   Darin Fisher <darin@meer.net>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-
-class nsTObsoleteAStringThunk_CharT : public nsTObsoleteAString_CharT
-  {
-    public:
-      typedef nsTObsoleteAStringThunk_CharT    self_type; 
-      typedef nsTSubstring_CharT               substring_type;
-
-    public:
-
-      nsTObsoleteAStringThunk_CharT() {}
-
-
-      static const void* get_vptr()
-        {
-          const void* result;
-          new (&result) self_type();
-          return result;
-        }
-
-
-        /**
-         * we are a nsTSubstring in disguise!
-         */
-
-            substring_type* concrete_self()       { return reinterpret_cast<substring_type*>(this); }
-      const substring_type* concrete_self() const { return reinterpret_cast<const substring_type*>(this); }
-
-
-        /**
-         * all virtual methods need to be redirected to appropriate nsString methods
-         */
-
-      virtual ~nsTObsoleteAStringThunk_CharT()
-        {
-          concrete_self()->Finalize();
-        }
-
-      virtual PRUint32 GetImplementationFlags() const
-        {
-          return 0;
-        }
-
-      virtual const buffer_handle_type* GetFlatBufferHandle() const
-        {
-          return (const buffer_handle_type*) (concrete_self()->IsTerminated() != PR_FALSE);
-        }
-
-      virtual const buffer_handle_type*  GetBufferHandle() const
-        {
-          return 0;
-        }
-
-      virtual const shared_buffer_handle_type* GetSharedBufferHandle() const
-        {
-          return 0;
-        }
-
-      virtual size_type Length() const
-        {
-          return concrete_self()->Length();
-        }
-
-      virtual PRBool IsVoid() const
-        {
-          return concrete_self()->IsVoid();
-        }
-
-      virtual void SetIsVoid(PRBool val)
-        {
-          concrete_self()->SetIsVoid(val);
-        }
-
-      virtual void SetCapacity(size_type size)
-        {
-          concrete_self()->SetCapacity(size);
-        }
-
-      virtual void SetLength(size_type size)
-        {
-          concrete_self()->SetLength(size);
-        }
-
-      virtual void Cut(index_type cutStart, size_type cutLength)
-        {
-          concrete_self()->Cut(cutStart, cutLength);
-        }
-
-      virtual void do_AssignFromReadable(const abstract_string_type &s)
-        {
-          concrete_self()->Assign(s);
-        }
-
-      virtual void do_AssignFromElementPtr(const char_type *data)
-        {
-          concrete_self()->Assign(data);
-        }
-
-      virtual void do_AssignFromElementPtrLength(const char_type *data, size_type length)
-        {
-          concrete_self()->Assign(data, length);
-        }
-
-      virtual void do_AssignFromElement(char_type c)
-        {
-          concrete_self()->Assign(c);
-        }
-
-      virtual void do_AppendFromReadable(const abstract_string_type &s)
-        {
-          concrete_self()->Append(s);
-        }
-
-      virtual void do_AppendFromElementPtr(const char_type *data)
-        {
-          concrete_self()->Append(data);
-        }
-
-      virtual void do_AppendFromElementPtrLength(const char_type *data, size_type length)
-        {
-          concrete_self()->Append(data, length);
-        }
-
-      virtual void do_AppendFromElement(char_type c)
-        {
-          concrete_self()->Append(c);
-        }
-
-      virtual void do_InsertFromReadable(const abstract_string_type &s, index_type pos)
-        {
-          concrete_self()->Insert(s, pos);
-        }
-
-      virtual void do_InsertFromElementPtr(const char_type *data, index_type pos)
-        {
-          concrete_self()->Insert(data, pos);
-        }
-
-      virtual void do_InsertFromElementPtrLength(const char_type *data, index_type pos, size_type length)
-        {
-          concrete_self()->Insert(data, pos, length);
-        }
-
-      virtual void do_InsertFromElement(char_type c, index_type pos)
-        {
-          concrete_self()->Insert(c, pos);
-        }
-
-      virtual void do_ReplaceFromReadable(index_type cutStart, size_type cutLength, const abstract_string_type &s)
-        {
-          concrete_self()->Replace(cutStart, cutLength, s);
-        }
-
-      virtual const char_type *GetReadableFragment(const_fragment_type& frag, nsFragmentRequest which, PRUint32 offset) const
-        {
-          const substring_type* s = concrete_self();
-          switch (which)
-            {
-              case kFirstFragment:
-              case kLastFragment:
-              case kFragmentAt:
-                frag.mStart = s->Data();
-                frag.mEnd = frag.mStart + s->Length();
-                return frag.mStart + offset;
-              case kPrevFragment:
-              case kNextFragment:
-              default:
-                return 0;
-            }
-        }
-
-      virtual char_type *GetWritableFragment(fragment_type& frag, nsFragmentRequest which, PRUint32 offset)
-        {
-          substring_type* s = concrete_self();
-          switch (which)
-            {
-              case kFirstFragment:
-              case kLastFragment:
-              case kFragmentAt:
-                char_type* start;
-                s->BeginWriting(start);
-                frag.mStart = start;
-                frag.mEnd = start + s->Length();
-                return frag.mStart + offset;
-              case kPrevFragment:
-              case kNextFragment:
-              default:
-                return 0;
-            }
-        }
-  };
-
-
-  /**
-   * initialize the pointer to the canonical vtable...
-   */
-
-const void *nsTObsoleteAString_CharT::sCanonicalVTable = nsTObsoleteAStringThunk_CharT::get_vptr();
--- a/xpcom/string/src/nsTPromiseFlatString.cpp
+++ b/xpcom/string/src/nsTPromiseFlatString.cpp
@@ -34,37 +34,19 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 void
 nsTPromiseFlatString_CharT::Init(const substring_type& str)
   {
-#ifdef MOZ_V1_STRING_ABI
-    // we have to manually set this here since we are being called on an
-    // unitialized object.
-    mVTable = nsTObsoleteAString_CharT::sCanonicalVTable;
-#endif
-
     if (str.IsTerminated())
       {
         mData = const_cast<char_type*>(str.Data());
         mLength = str.Length();
         mFlags = F_TERMINATED; // does not promote F_VOIDED
       }
     else
       {
         Assign(str);
       }
   }
-
-  // this function is non-inline to minimize codesize
-#ifdef MOZ_V1_STRING_ABI
-void
-nsTPromiseFlatString_CharT::Init(const abstract_string_type& readable)
-  {
-    if (readable.mVTable == nsTObsoleteAString_CharT::sCanonicalVTable)
-      Init(*readable.AsSubstring());
-    else
-      Init(readable.ToSubstring());
-  }
-#endif
--- a/xpcom/string/src/nsTStringComparator.cpp
+++ b/xpcom/string/src/nsTStringComparator.cpp
@@ -34,22 +34,22 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 NS_COM int NS_FASTCALL
 Compare( const nsTSubstring_CharT::base_string_type& lhs, const nsTSubstring_CharT::base_string_type& rhs, const nsTStringComparator_CharT& comp )
   {
-    typedef nsTAString_CharT::size_type size_type;
+    typedef nsTSubstring_CharT::size_type size_type;
 
     if ( &lhs == &rhs )
       return 0;
 
-    nsTAString_CharT::const_iterator leftIter, rightIter;
+    nsTSubstring_CharT::const_iterator leftIter, rightIter;
     lhs.BeginReading(leftIter);
     rhs.BeginReading(rightIter);
 
     size_type lLength = leftIter.size_forward();
     size_type rLength = rightIter.size_forward();
     size_type lengthToCompare = NS_MIN(lLength, rLength);
 
     int result;
--- a/xpcom/string/src/nsTSubstring.cpp
+++ b/xpcom/string/src/nsTSubstring.cpp
@@ -33,69 +33,48 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 nsTSubstring_CharT::nsTSubstring_CharT( char_type *data, size_type length,
                                         PRUint32 flags)
-#ifdef MOZ_V1_STRING_ABI
-  : abstract_string_type(data, length, flags)
-#else
   : mData(data),
     mLength(length),
     mFlags(flags)
-#endif
   {
     if (flags & F_OWNED) {
       STRING_STAT_INCREMENT(Adopt);
 #ifdef NS_BUILD_REFCNT_LOGGING
       NS_LogCtor(mData, "StringAdopt", 1);
 #endif
     }
   }
 
 nsTSubstring_CharT::nsTSubstring_CharT(const substring_tuple_type& tuple)
-#ifdef MOZ_V1_STRING_ABI
-  : abstract_string_type(nsnull, 0, F_NONE)
-#else
     : mData(nsnull),
       mLength(0),
       mFlags(F_NONE)
-#endif
 {
   Assign(tuple);
 }
 
 nsTSubstring_CharT::nsTSubstring_CharT()
-#ifdef MOZ_V1_STRING_ABI
-  : abstract_string_type(
-      const_cast<char_type*>(char_traits::sEmptyBuffer), 0, F_TERMINATED) {}
-#else
 : mData(const_cast<char_type*>(char_traits::sEmptyBuffer)),
   mLength(0),
   mFlags(F_TERMINATED) {}
-#endif
 
 nsTSubstring_CharT::nsTSubstring_CharT( PRUint32 flags )
-#ifdef MOZ_V1_STRING_ABI
-        : abstract_string_type(flags) {}
-#else
         : mFlags(flags) {}
-#endif
 
 nsTSubstring_CharT::nsTSubstring_CharT( const self_type& str )
-#ifdef MOZ_V1_STRING_ABI
-  : abstract_string_type(str.mData, str.mLength, str.mFlags & (F_TERMINATED | F_VOIDED)) {}
-#else
   : mData(str.mData),
     mLength(str.mLength),
     mFlags(str.mFlags & (F_TERMINATED | F_VOIDED)) {}
-#endif
 
   /**
    * helper function for down-casting a nsTSubstring to a nsTFixedString.
    */
 inline const nsTFixedString_CharT*
 AsFixedString( const nsTSubstring_CharT* s )
   {
     return static_cast<const nsTFixedString_CharT*>(s);
@@ -222,22 +201,20 @@ nsTSubstring_CharT::MutatePrep( size_typ
 
 void
 nsTSubstring_CharT::Finalize()
   {
     ::ReleaseData(mData, mFlags);
     // mData, mLength, and mFlags are purposefully left dangling
   }
 
-#ifndef MOZ_V1_STRING_ABI
 nsTSubstring_CharT::~nsTSubstring_CharT()
   {
     Finalize();
   }
-#endif
 
 PRBool
 nsTSubstring_CharT::ReplacePrep( index_type cutStart, size_type cutLen, size_type fragLen )
   {
     // bound cut length
     cutLen = NS_MIN(cutLen, mLength - cutStart);
 
     PRUint32 newLen = mLength - cutLen + fragLen;
@@ -456,30 +433,16 @@ nsTSubstring_CharT::Assign( const substr
       }
 
     size_type length = tuple.Length();
 
     if (ReplacePrep(0, mLength, length) && length)
       tuple.WriteTo(mData, length);
   }
 
-  // this is non-inline to reduce codesize at the callsite
-#ifdef MOZ_V1_STRING_ABI
-void
-nsTSubstring_CharT::Assign( const abstract_string_type& readable )
-  {
-      // promote to string if possible to take advantage of sharing
-    if (readable.mVTable == nsTObsoleteAString_CharT::sCanonicalVTable)
-      Assign(*readable.AsSubstring());
-    else
-      Assign(readable.ToSubstring());
-  }
-#endif
-
-
 void
 nsTSubstring_CharT::Adopt( char_type* data, size_type length )
   {
     if (data)
       {
         ::ReleaseData(mData, mFlags);
 
         if (length == size_type(-1))
@@ -577,24 +540,16 @@ nsTSubstring_CharT::Replace( index_type 
     size_type length = tuple.Length();
 
     cutStart = PR_MIN(cutStart, Length());
 
     if (ReplacePrep(cutStart, cutLength, length) && length > 0)
       tuple.WriteTo(mData + cutStart, length);
   }
 
-#ifdef MOZ_V1_STRING_ABI
-void
-nsTSubstring_CharT::Replace( index_type cutStart, size_type cutLength, const abstract_string_type& readable )
-  {
-    Replace(cutStart, cutLength, readable.ToSubstring());
-  }
-#endif
-
 void
 nsTSubstring_CharT::SetCapacity( size_type capacity )
   {
     // capacity does not include room for the terminating null char
 
     // if our capacity is reduced to zero, then free our buffer.
     if (capacity == 0)
       {
@@ -671,36 +626,16 @@ nsTSubstring_CharT::Equals( const self_t
   }
 
 PRBool
 nsTSubstring_CharT::Equals( const self_type& str, const comparator_type& comp ) const
   {
     return mLength == str.mLength && comp(mData, str.mData, mLength) == 0;
   }
 
-#ifdef MOZ_V1_STRING_ABI
-PRBool
-nsTSubstring_CharT::Equals( const abstract_string_type& readable ) const
-  {
-    const char_type* data;
-    size_type length = readable.GetReadableBuffer(&data);
-
-    return mLength == length && char_traits::compare(mData, data, mLength) == 0;
-  }
-
-PRBool
-nsTSubstring_CharT::Equals( const abstract_string_type& readable, const comparator_type& comp ) const
-  {
-    const char_type* data;
-    size_type length = readable.GetReadableBuffer(&data);
-
-    return mLength == length && comp(mData, data, mLength) == 0;
-  }
-#endif
-
 PRBool
 nsTSubstring_CharT::Equals( const char_type* data ) const
   {
     // unfortunately, some callers pass null :-(
     if (!data)
       {
         NS_NOTREACHED("null data pointer");
         return mLength == 0;
--- a/xpcom/xpcom-config.h.in
+++ b/xpcom/xpcom-config.h.in
@@ -57,12 +57,9 @@
 /* Define if the c++ compiler requires implementations of 
  * unused virtual methods
  */
 #undef NEED_CPP_UNUSED_IMPLEMENTATIONS
 
 /* Define to either <new> or <new.h> */
 #undef NEW_H
 
-/* Define if binary compatibility with Mozilla 1.x string code is desired */
-#undef MOZ_V1_STRING_ABI
-
 #endif /* _XPCOM_CONFIG_H_ */