Bug 773151: Convert nsCAutoString->nsAutoCString (comm-central) CLOSED TREE r=bsmedberg
authorRandell Jesup <rjesup@jesup.org>
Sat, 01 Sep 2012 22:37:39 -0400
changeset 13592 ff603e79f92ad7b5668d0ad865987b470c2e6749
parent 13591 25cd109a6a33231f5edd66b640ef3eba234e1a75
child 13593 8cd81ff229ebfb46b6e8f25490afd3af09672ad5
push id1
push userhg
push dateTue, 08 Jul 2014 14:20:55 +0000
treeherdercomm-esr31@1665b2be5642 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs773151
Bug 773151: Convert nsCAutoString->nsAutoCString (comm-central) CLOSED TREE r=bsmedberg
calendar/base/src/calDateTime.cpp
calendar/base/src/calICSService.cpp
calendar/base/src/calRecurrenceDate.cpp
calendar/base/src/calRecurrenceRule.cpp
ldap/xpcom/src/nsLDAPConnection.cpp
ldap/xpcom/src/nsLDAPOperation.cpp
ldap/xpcom/src/nsLDAPService.cpp
ldap/xpcom/src/nsLDAPSyncQuery.cpp
ldap/xpcom/src/nsLDAPURL.cpp
mail/components/migration/src/nsMailProfileMigratorUtils.cpp
mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
mail/components/migration/src/nsProfileMigrator.cpp
mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
mail/components/shell/nsMailGNOMEIntegration.cpp
mailnews/addrbook/src/nsAbBSDirectory.cpp
mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.cpp
mailnews/addrbook/src/nsAbContentHandler.cpp
mailnews/addrbook/src/nsAbDirFactoryService.cpp
mailnews/addrbook/src/nsAbLDAPAutoCompFormatter.cpp
mailnews/addrbook/src/nsAbLDAPCard.cpp
mailnews/addrbook/src/nsAbLDAPChangeLogData.cpp
mailnews/addrbook/src/nsAbLDAPChangeLogQuery.cpp
mailnews/addrbook/src/nsAbLDAPDirFactory.cpp
mailnews/addrbook/src/nsAbLDAPDirectory.cpp
mailnews/addrbook/src/nsAbLDAPDirectoryModify.cpp
mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp
mailnews/addrbook/src/nsAbLDAPListenerBase.cpp
mailnews/addrbook/src/nsAbLDAPReplicationData.cpp
mailnews/addrbook/src/nsAbLDAPReplicationQuery.cpp
mailnews/addrbook/src/nsAbLDIFService.cpp
mailnews/addrbook/src/nsAbMDBDirFactory.cpp
mailnews/addrbook/src/nsAbMDBDirectory.cpp
mailnews/addrbook/src/nsAbManager.cpp
mailnews/addrbook/src/nsAbOSXDirectory.mm
mailnews/addrbook/src/nsAbOutlookDirFactory.cpp
mailnews/addrbook/src/nsAbOutlookDirectory.cpp
mailnews/addrbook/src/nsAbQueryStringToExpression.cpp
mailnews/addrbook/src/nsAbWinHelper.cpp
mailnews/addrbook/src/nsAddbookProtocolHandler.cpp
mailnews/addrbook/src/nsAddbookUrl.cpp
mailnews/addrbook/src/nsAddrDatabase.cpp
mailnews/addrbook/src/nsDirPrefs.cpp
mailnews/addrbook/src/nsLDAPAutoCompleteSession.cpp
mailnews/addrbook/src/nsVCardObj.cpp
mailnews/base/search/src/nsMsgBodyHandler.cpp
mailnews/base/search/src/nsMsgFilter.cpp
mailnews/base/search/src/nsMsgFilterList.cpp
mailnews/base/search/src/nsMsgFilterService.cpp
mailnews/base/search/src/nsMsgSearchAdapter.cpp
mailnews/base/search/src/nsMsgSearchNews.cpp
mailnews/base/search/src/nsMsgSearchTerm.cpp
mailnews/base/src/MailNewsDLF.cpp
mailnews/base/src/nsMessenger.cpp
mailnews/base/src/nsMessengerBootstrap.cpp
mailnews/base/src/nsMessengerContentHandler.cpp
mailnews/base/src/nsMsgAccount.cpp
mailnews/base/src/nsMsgAccountManager.cpp
mailnews/base/src/nsMsgAccountManagerDS.cpp
mailnews/base/src/nsMsgContentPolicy.cpp
mailnews/base/src/nsMsgDBView.cpp
mailnews/base/src/nsMsgFolderCache.cpp
mailnews/base/src/nsMsgFolderCacheElement.cpp
mailnews/base/src/nsMsgFolderCompactor.cpp
mailnews/base/src/nsMsgFolderDataSource.cpp
mailnews/base/src/nsMsgFolderDataSource.h
mailnews/base/src/nsMsgMailSession.cpp
mailnews/base/src/nsMsgPrintEngine.cpp
mailnews/base/src/nsMsgPurgeService.cpp
mailnews/base/src/nsMsgSearchDBView.cpp
mailnews/base/src/nsMsgServiceProvider.cpp
mailnews/base/src/nsMsgTagService.cpp
mailnews/base/src/nsMsgXFViewThread.cpp
mailnews/base/src/nsSpamSettings.cpp
mailnews/base/src/nsSubscribableServer.cpp
mailnews/base/util/nsMsgDBFolder.cpp
mailnews/base/util/nsMsgI18N.cpp
mailnews/base/util/nsMsgIdentity.cpp
mailnews/base/util/nsMsgIncomingServer.cpp
mailnews/base/util/nsMsgMailNewsUrl.cpp
mailnews/base/util/nsMsgProtocol.cpp
mailnews/base/util/nsMsgUtils.cpp
mailnews/base/util/nsMsgUtils.h
mailnews/compose/src/nsMsgAppleDoubleEncode.cpp
mailnews/compose/src/nsMsgAppleEncode.cpp
mailnews/compose/src/nsMsgAttachment.cpp
mailnews/compose/src/nsMsgAttachmentHandler.cpp
mailnews/compose/src/nsMsgCompFields.cpp
mailnews/compose/src/nsMsgCompUtils.cpp
mailnews/compose/src/nsMsgCompose.cpp
mailnews/compose/src/nsMsgComposeService.cpp
mailnews/compose/src/nsMsgQuote.cpp
mailnews/compose/src/nsMsgSend.cpp
mailnews/compose/src/nsSmtpProtocol.cpp
mailnews/compose/src/nsSmtpServer.cpp
mailnews/compose/src/nsSmtpService.cpp
mailnews/compose/src/nsSmtpUrl.cpp
mailnews/compose/src/nsURLFetcher.cpp
mailnews/db/msgdb/public/nsMsgHdr.h
mailnews/db/msgdb/src/nsMsgDatabase.cpp
mailnews/db/msgdb/src/nsMsgHdr.cpp
mailnews/db/msgdb/src/nsMsgOfflineImapOperation.cpp
mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
mailnews/extensions/mdn/src/nsMsgMdnGenerator.cpp
mailnews/extensions/smime/src/nsMsgComposeSecure.cpp
mailnews/imap/src/nsAutoSyncState.cpp
mailnews/imap/src/nsImapIncomingServer.cpp
mailnews/imap/src/nsImapIncomingServer.h
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/imap/src/nsImapOfflineSync.cpp
mailnews/imap/src/nsImapProtocol.cpp
mailnews/imap/src/nsImapServerResponseParser.cpp
mailnews/imap/src/nsImapServerResponseParser.h
mailnews/imap/src/nsImapService.cpp
mailnews/imap/src/nsImapUndoTxn.cpp
mailnews/imap/src/nsImapUrl.cpp
mailnews/imap/src/nsImapUtils.cpp
mailnews/import/applemail/src/nsEmlxHelperUtils.mm
mailnews/import/eudora/src/nsEudoraAddress.cpp
mailnews/import/eudora/src/nsEudoraFilters.cpp
mailnews/import/eudora/src/nsEudoraMac.cpp
mailnews/import/eudora/src/nsEudoraMailbox.cpp
mailnews/import/eudora/src/nsEudoraMailbox.h
mailnews/import/eudora/src/nsEudoraWin32.cpp
mailnews/import/oexpress/nsOE5File.cpp
mailnews/import/oexpress/nsOEScanBoxes.cpp
mailnews/import/oexpress/nsOESettings.cpp
mailnews/import/outlook/src/nsOutlookMail.cpp
mailnews/import/outlook/src/nsOutlookSettings.cpp
mailnews/import/src/nsImportAddressBooks.cpp
mailnews/import/text/src/nsTextAddress.cpp
mailnews/import/winlivemail/nsWMSettings.cpp
mailnews/local/src/nsLocalMailFolder.cpp
mailnews/local/src/nsLocalUtils.cpp
mailnews/local/src/nsMailboxProtocol.cpp
mailnews/local/src/nsMailboxService.cpp
mailnews/local/src/nsMailboxUrl.cpp
mailnews/local/src/nsMovemailService.cpp
mailnews/local/src/nsMsgBrkMBoxStore.cpp
mailnews/local/src/nsMsgLocalStoreUtils.cpp
mailnews/local/src/nsMsgMaildirStore.cpp
mailnews/local/src/nsParseMailbox.cpp
mailnews/local/src/nsPop3Protocol.cpp
mailnews/local/src/nsPop3Service.cpp
mailnews/local/src/nsPop3Sink.cpp
mailnews/mapi/mapihook/src/Registry.cpp
mailnews/mapi/mapihook/src/msgMapiHook.cpp
mailnews/mapi/mapihook/src/msgMapiImp.cpp
mailnews/mime/cthandlers/vcard/mimevcrd.cpp
mailnews/mime/emitters/src/nsMimeBaseEmitter.cpp
mailnews/mime/emitters/src/nsMimeHtmlEmitter.cpp
mailnews/mime/src/comi18n.cpp
mailnews/mime/src/mimecms.cpp
mailnews/mime/src/mimedrft.cpp
mailnews/mime/src/mimehdrs.cpp
mailnews/mime/src/mimei.cpp
mailnews/mime/src/mimeiimg.cpp
mailnews/mime/src/mimemcms.cpp
mailnews/mime/src/mimemoz2.cpp
mailnews/mime/src/mimemrel.cpp
mailnews/mime/src/mimemsg.cpp
mailnews/mime/src/mimemult.cpp
mailnews/mime/src/mimeobj.cpp
mailnews/mime/src/mimethsa.cpp
mailnews/mime/src/mimethtm.cpp
mailnews/mime/src/mimetpfl.cpp
mailnews/mime/src/mimetpla.cpp
mailnews/mime/src/nsStreamConverter.cpp
mailnews/news/src/nsNNTPNewsgroupList.cpp
mailnews/news/src/nsNNTPProtocol.cpp
mailnews/news/src/nsNewsFolder.cpp
mailnews/news/src/nsNewsUtils.cpp
mailnews/news/src/nsNntpIncomingServer.cpp
mailnews/news/src/nsNntpService.cpp
mailnews/news/src/nsNntpUrl.cpp
suite/feeds/src/nsFeedSniffer.cpp
suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp
suite/profile/migration/src/nsProfileMigrator.cpp
suite/profile/migration/src/nsSuiteProfileMigratorUtils.cpp
--- a/calendar/base/src/calDateTime.cpp
+++ b/calendar/base/src/calDateTime.cpp
@@ -197,17 +197,17 @@ calDateTime::SubtractDate(calIDateTime *
     CAL_ENSURE_MEMORY(dur);
     NS_ADDREF(*aDuration = dur);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 calDateTime::ToString(nsACString & aResult)
 {
-    nsCAutoString tzid;
+    nsAutoCString tzid;
     char buffer[256];
 
     ensureTimezone();
     mTimezone->GetTzid(tzid);
 
     uint32_t const length = PR_snprintf(
         buffer, sizeof(buffer), "%04hd/%02hd/%02hd %02hd:%02hd:%02hd %s isDate=%01hd nativeTime=%lld",
         mYear, mMonth + 1, mDay, mHour, mMinute, mSecond,
@@ -476,23 +476,23 @@ void calDateTime::FromIcalTime(icaltimet
     } else {
         mTimezone = cal::detectTimezone(t, nullptr);
     }
 #if defined(DEBUG)
     if (mTimezone) {
         if (t.is_utc) {
             NS_ASSERTION(SameCOMIdentity(mTimezone, cal::UTC()), "UTC mismatch!");
         } else if (!t.zone) {
-            nsCAutoString tzid;
+            nsAutoCString tzid;
             mTimezone->GetTzid(tzid);
             if (tzid.EqualsLiteral("floating")) {
                 NS_ASSERTION(SameCOMIdentity(mTimezone, cal::floating()), "floating mismatch!");
             }
         } else {
-            nsCAutoString tzid;
+            nsAutoCString tzid;
             mTimezone->GetTzid(tzid);
             NS_ASSERTION(tzid.Equals(icaltimezone_get_tzid(const_cast<icaltimezone *>(t.zone))),
                          "tzid mismatch!");
         }
     }
 #endif
 
     mWeekday = static_cast<int16_t>(icaltime_day_of_week(t) - 1);
--- a/calendar/base/src/calICSService.cpp
+++ b/calendar/base/src/calICSService.cpp
@@ -468,17 +468,17 @@ calIcalComponent::~calIcalComponent()
         }
     }
 }
 
 NS_IMETHODIMP
 calIcalComponent::AddTimezoneReference(calITimezone *aTimezone)
 {
     NS_ENSURE_ARG_POINTER(aTimezone);
-    nsCAutoString tzid;
+    nsAutoCString tzid;
     nsresult rv = aTimezone->GetTzid(tzid);
     NS_ENSURE_SUCCESS(rv, rv);
     mReferencedTimezones.Put(tzid, aTimezone);
 
     return NS_OK;
 }
 
 static PLDHashOperator
@@ -743,17 +743,17 @@ nsresult calIcalProperty::setDatetime_(c
                 NS_ENSURE_SUCCESS(rv, rv);
                 icalparameter * const param = icalparameter_new_from_value_string(
                     ICAL_TZID_PARAMETER, icaltimezone_get_tzid(const_cast<icaltimezone *>(itt.zone)));
                 icalproperty_set_parameter(prop, param);
             } else { // either floating or phantom:
                 bool b = false;
                 if (NS_FAILED(tz->GetIsFloating(&b)) || !b) {
                     // restore the same phantom TZID:
-                    nsCAutoString tzid;
+                    nsAutoCString tzid;
                     rv = tz->GetTzid(tzid);
                     NS_ENSURE_SUCCESS(rv, rv);
                     icalparameter * const param = icalparameter_new_from_value_string(ICAL_TZID_PARAMETER,
                                                                                       tzid.get());
                     icalproperty_set_parameter(prop, param);
                 }
             }
         }
--- a/calendar/base/src/calRecurrenceDate.cpp
+++ b/calendar/base/src/calRecurrenceDate.cpp
@@ -181,17 +181,17 @@ calRecurrenceDate::GetIcalProperty(calII
     return (*aProp)->SetValueAsDatetime(mDate);
 }
 
 NS_IMETHODIMP
 calRecurrenceDate::SetIcalProperty(calIIcalProperty *aProp)
 {
     NS_ENSURE_ARG_POINTER(aProp);
 
-    nsCAutoString name;
+    nsAutoCString name;
     nsresult rc = aProp->GetPropertyName(name);
     if (NS_FAILED(rc))
         return rc;
     if (name.EqualsLiteral("RDATE")) {
         mIsNegative = false;
         icalvalue * const value = icalproperty_get_value(aProp->GetIcalProperty());
         if (icalvalue_isa(value) == ICAL_PERIOD_VALUE) {
             icalperiodtype const period = icalvalue_get_period(value);
--- a/calendar/base/src/calRecurrenceRule.cpp
+++ b/calendar/base/src/calRecurrenceRule.cpp
@@ -398,17 +398,17 @@ calRecurrenceRule::GetOccurrences(calIDa
     if (!aMaxCount && !aRangeEnd && mIcalRecur.count == 0 && icaltime_is_null_time(mIcalRecur.until))
         return NS_ERROR_INVALID_ARG;
 
     nsCOMArray<calIDateTime> dates;
 
 #ifdef DEBUG_dbo
     {
         char const * const ss = icalrecurrencetype_as_string(&mIcalRecur);
-        nsCAutoString tst, tend;
+        nsAutoCString tst, tend;
         aRangeStart->ToString(tst);
         aRangeEnd->ToString(tend);
         printf("RULE: [%s -> %s, %d]: %s\n", tst.get(), tend.get(), mIcalRecur.count, ss);
     }
 #endif
 
     struct icaltimetype rangestart, dtstart, dtend;
     aRangeStart->ToIcalTime(&rangestart);
@@ -455,17 +455,17 @@ calRecurrenceRule::GetOccurrences(calIDa
         if (!cdt) {
             icalrecur_iterator_free(recur_iter);
             return NS_ERROR_OUT_OF_MEMORY;
         }
 
         dates.AppendObject(cdt);
 #ifdef DEBUG_dbo
         {
-            nsCAutoString str;
+            nsAutoCString str;
             cdt->ToString(str);
             printf("  occ: %s\n", str.get());
         }
 #endif
         count++;
         if (aMaxCount && aMaxCount <= count)
             break;
     }
@@ -510,17 +510,17 @@ calRecurrenceRule::GetIcalProperty(calII
 NS_IMETHODIMP
 calRecurrenceRule::SetIcalProperty(calIIcalProperty *aProp)
 {
     NS_ENSURE_ARG_POINTER(aProp);
 
     if (mImmutable)
         return NS_ERROR_OBJECT_IS_IMMUTABLE;
 
-    nsCAutoString propname;
+    nsAutoCString propname;
     nsresult rv = aProp->GetPropertyName(propname);
     NS_ENSURE_SUCCESS(rv, rv);
     if (propname.EqualsLiteral("RRULE"))
         mIsNegative = false;
     else if (propname.EqualsLiteral("EXRULE"))
         mIsNegative = true;
     else
         return NS_ERROR_INVALID_ARG;
--- a/ldap/xpcom/src/nsLDAPConnection.cpp
+++ b/ldap/xpcom/src/nsLDAPConnection.cpp
@@ -682,17 +682,17 @@ NS_IMETHODIMP nsLDAPConnectionRunnable::
           int32_t errorCode;
           msg->GetErrorCode(&errorCode);
 
           // maybe a version error, e.g., using v3 on a v2 server.
           // if we're using v3, try v2.
           if (errorCode == LDAP_PROTOCOL_ERROR &&
               mConnection->mVersion == nsILDAPConnection::VERSION3)
           {
-            nsCAutoString password;
+            nsAutoCString password;
             mConnection->mVersion = nsILDAPConnection::VERSION2;
             ldap_set_option(mConnection->mConnectionHandle,
                             LDAP_OPT_PROTOCOL_VERSION, &mConnection->mVersion);
 
             if (NS_SUCCEEDED(rv))
             {
               // We don't want to notify callers that we are done, so
               // redispatch the runnable.
--- a/ldap/xpcom/src/nsLDAPOperation.cpp
+++ b/ldap/xpcom/src/nsLDAPOperation.cpp
@@ -164,17 +164,17 @@ nsLDAPOperation::GetMessageListener(nsIL
 }
 
 NS_IMETHODIMP
 nsLDAPOperation::SaslBind(const nsACString &service,
                           const nsACString &mechanism,
                           nsIAuthModule *authModule)
 {
   nsresult rv;
-  nsCAutoString bindName;
+  nsAutoCString bindName;
   struct berval creds;
   unsigned int credlen;
 
   mAuthModule = authModule;
   mMechanism.Assign(mechanism);
 
   rv = mConnection->GetBindName(bindName);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -207,17 +207,17 @@ nsLDAPOperation::SaslBind(const nsACStri
 
   return rv;
 }
 
 NS_IMETHODIMP
 nsLDAPOperation::SaslStep(const char *token, uint32_t tokenLen)
 {
   nsresult rv;
-  nsCAutoString bindName;
+  nsAutoCString bindName;
   struct berval clientCreds;
   struct berval serverCreds;
   unsigned int credlen;
 
   rv = mConnection->RemovePendingOperation(mMsgID);
   NS_ENSURE_SUCCESS(rv, rv);
 
   serverCreds.bv_val = (char *) token;
@@ -256,17 +256,17 @@ nsLDAPOperation::SaslStep(const char *to
 NS_IMETHODIMP
 nsLDAPOperation::SimpleBind(const nsACString& passwd)
 {
     nsRefPtr<nsLDAPConnection> connection = mConnection;
     // There is a possibilty that mConnection can be cleared by another
     // thread. Grabbing a local reference to mConnection may avoid this.
     // See https://bugzilla.mozilla.org/show_bug.cgi?id=557928#c1
     nsresult rv;
-    nsCAutoString bindName;
+    nsAutoCString bindName;
     int32_t originalMsgID = mMsgID;
     // Ugly hack alert:
     // the first time we get called with a passwd, remember it.
     // Then, if we get called again w/o a password, use the
     // saved one. Getting called again means we're trying to
     // fall back to VERSION2.
     // Since LDAP operations are thrown away when done, it won't stay
     // around in memory.
@@ -605,17 +605,17 @@ nsLDAPOperation::AddExt(const char *base
   if (mods && modCount) {
     attrs = static_cast<LDAPMod **>(nsMemory::Alloc((modCount + 1) *
                                                        sizeof(LDAPMod *)));
     if (!attrs) {
       NS_ERROR("nsLDAPOperation::AddExt: out of memory ");
       return NS_ERROR_OUT_OF_MEMORY;
     }
 
-    nsCAutoString type;
+    nsAutoCString type;
     uint32_t index;
     for (index = 0; index < modCount && NS_SUCCEEDED(rv); ++index) {
       attrs[index] = new LDAPMod();
 
       if (!attrs[index])
         return NS_ERROR_OUT_OF_MEMORY;
 
       nsCOMPtr<nsILDAPModification> modif(do_QueryElementAt(mods, index, &rv));
@@ -769,17 +769,17 @@ nsLDAPOperation::ModifyExt(const char *b
   if (modCount && mods) {
     attrs = static_cast<LDAPMod **>(nsMemory::Alloc((modCount + 1) *
                                                        sizeof(LDAPMod *)));
     if (!attrs) {
       NS_ERROR("nsLDAPOperation::ModifyExt: out of memory ");
       return NS_ERROR_OUT_OF_MEMORY;
     }
 
-    nsCAutoString type;
+    nsAutoCString type;
     uint32_t index;
     for (index = 0; index < modCount && NS_SUCCEEDED(rv); ++index) {
       attrs[index] = new LDAPMod();
       if (!attrs[index])
         return NS_ERROR_OUT_OF_MEMORY;
 
       nsCOMPtr<nsILDAPModification> modif(do_QueryElementAt(mods, index, &rv));
       if (NS_FAILED(rv))
--- a/ldap/xpcom/src/nsLDAPService.cpp
+++ b/ldap/xpcom/src/nsLDAPService.cpp
@@ -611,18 +611,18 @@ nsresult
 nsLDAPService::EstablishConnection(nsLDAPServiceEntry *aEntry,
                                    nsILDAPMessageListener *aListener)
 {
     nsCOMPtr<nsILDAPOperation> operation;
     nsCOMPtr<nsILDAPServer> server;
     nsCOMPtr<nsILDAPURL> url;
     nsCOMPtr<nsILDAPConnection> conn, conn2;
     nsCOMPtr<nsILDAPMessage> message;
-    nsCAutoString binddn;
-    nsCAutoString password;
+    nsAutoCString binddn;
+    nsAutoCString password;
     uint32_t protocolVersion;
     nsresult rv;
 
     server = aEntry->GetServer();
     if (!server) {
         return NS_ERROR_FAILURE;
     }
 
@@ -863,17 +863,17 @@ NS_IMETHODIMP nsLDAPService::ParseDn(con
     // count DN components
     if (!*dnComponents || !*(dnComponents + 1)) {
         NS_ERROR("nsLDAPService::ParseDn: DN has too few components");
         ldap_value_free(dnComponents);
         return NS_ERROR_UNEXPECTED;
     }
 
     // get the base DN
-    nsCAutoString baseDn(nsDependentCString(*(dnComponents + 1)));
+    nsAutoCString baseDn(nsDependentCString(*(dnComponents + 1)));
     for (char **component = dnComponents + 2; *component; ++component) {
         baseDn.AppendLiteral(",");
         baseDn.Append(nsDependentCString(*component));
     }
 
     // explode the RDN
     char **rdnComponents = ldap_explode_rdn(*dnComponents, 0);
     if (!rdnComponents) {
--- a/ldap/xpcom/src/nsLDAPSyncQuery.cpp
+++ b/ldap/xpcom/src/nsLDAPSyncQuery.cpp
@@ -235,42 +235,42 @@ nsLDAPSyncQuery::StartLDAPSearch()
         NS_ERROR("nsLDAPSyncQuery::StartLDAPSearch(): couldn't "
                  "initialize LDAP operation");
         FinishLDAPQuery();
         return NS_ERROR_UNEXPECTED;
     }
 
     // get the search filter associated with the directory server url; 
     //
-    nsCAutoString urlFilter;
+    nsAutoCString urlFilter;
     rv = mServerURL->GetFilter(urlFilter);
     if (NS_FAILED(rv)) {
         FinishLDAPQuery();
         return NS_ERROR_UNEXPECTED;
     }
 
     // get the base dn to search
     //
-    nsCAutoString dn;
+    nsAutoCString dn;
     rv = mServerURL->GetDn(dn);
     if (NS_FAILED(rv)) {
         FinishLDAPQuery();
         return NS_ERROR_UNEXPECTED;
     }
 
     // and the scope
     //
     int32_t scope;
     rv = mServerURL->GetScope(&scope);
     if (NS_FAILED(rv)) {
         FinishLDAPQuery();
         return NS_ERROR_UNEXPECTED;
     }
 
-    nsCAutoString attributes;
+    nsAutoCString attributes;
     rv = mServerURL->GetAttributes(attributes);
     if (NS_FAILED(rv)) {
         FinishLDAPQuery();
         return NS_ERROR_UNEXPECTED;
     }
 
     // time to kick off the search.
     rv = mOperation->SearchExt(dn, scope, urlFilter, attributes, 0, 0);
--- a/ldap/xpcom/src/nsLDAPURL.cpp
+++ b/ldap/xpcom/src/nsLDAPURL.cpp
@@ -345,17 +345,17 @@ NS_IMETHODIMP nsLDAPURL::Equals(nsIURI *
 {
   *_retval = false;
   if (other)
   {
     nsresult rv;
     nsCOMPtr<nsILDAPURL> otherURL(do_QueryInterface(other, &rv));
     if (NS_SUCCEEDED(rv))
     {
-      nsCAutoString thisSpec, otherSpec;
+      nsAutoCString thisSpec, otherSpec;
       uint32_t otherOptions;
 
       rv = GetSpec(thisSpec);
       NS_ENSURE_SUCCESS(rv, rv);
 
       rv = otherURL->GetSpec(otherSpec);
       NS_ENSURE_SUCCESS(rv, rv);
 
@@ -509,17 +509,17 @@ NS_IMETHODIMP nsLDAPURL::AddAttribute(co
   {
     mAttributes = ',';
     mAttributes.Append(aAttribute);
     mAttributes.Append(',');
   }
   else
   {
     // Wrap the attribute in commas, so that we can do an exact match.
-    nsCAutoString findAttribute(",");
+    nsAutoCString findAttribute(",");
     findAttribute.Append(aAttribute);
     findAttribute.Append(',');
 
     // Check to see if the attribute is already stored. If it is, then also
     // check to see if it is the last attribute in the string, or if the next
     // character is a comma, this means we won't match substrings.
     int32_t pos = mAttributes.Find(findAttribute, CaseInsensitiveCompare);
     if (pos != -1)
@@ -539,17 +539,17 @@ NS_IMETHODIMP nsLDAPURL::AddAttribute(co
 NS_IMETHODIMP nsLDAPURL::RemoveAttribute(const nsACString &aAttribute)
 {
   if (!mBaseURL)
     return NS_ERROR_NOT_INITIALIZED;
 
   if (mAttributes.IsEmpty())
     return NS_OK;
 
-  nsCAutoString findAttribute(",");
+  nsAutoCString findAttribute(",");
   findAttribute.Append(aAttribute);
   findAttribute.Append(',');
 
   if (mAttributes.Equals(findAttribute, nsCaseInsensitiveCStringComparator()))
     mAttributes.Truncate();
   else
   {
     int32_t pos = mAttributes.Find(findAttribute, CaseInsensitiveCompare);
@@ -567,17 +567,17 @@ NS_IMETHODIMP nsLDAPURL::RemoveAttribute
   return mBaseURL->SetPath(newPath);
 }
 
 NS_IMETHODIMP nsLDAPURL::HasAttribute(const nsACString &aAttribute,
                                       bool *_retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
 
-  nsCAutoString findAttribute(",");
+  nsAutoCString findAttribute(",");
   findAttribute.Append(aAttribute);
   findAttribute.Append(',');
 
   *_retval = mAttributes.Find(findAttribute, CaseInsensitiveCompare) != -1;
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLDAPURL::GetScope(int32_t *_retval)
--- a/mail/components/migration/src/nsMailProfileMigratorUtils.cpp
+++ b/mail/components/migration/src/nsMailProfileMigratorUtils.cpp
@@ -10,21 +10,21 @@
 
 #include "nsServiceManagerUtils.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsXPCOMCID.h"
 
 void SetProxyPref(const nsACString& aHostPort, const char* aPref,
                   const char* aPortPref, nsIPrefBranch* aPrefs)
 {
-  nsCAutoString hostPort(aHostPort);
+  nsAutoCString hostPort(aHostPort);
   int32_t portDelimOffset = hostPort.RFindChar(':');
   if (portDelimOffset > 0) {
-    nsCAutoString host(Substring(hostPort, 0, portDelimOffset));
-    nsCAutoString port(Substring(hostPort, portDelimOffset + 1,
+    nsAutoCString host(Substring(hostPort, 0, portDelimOffset));
+    nsAutoCString port(Substring(hostPort, portDelimOffset + 1,
                                  hostPort.Length() - (portDelimOffset + 1)));
 
     aPrefs->SetCharPref(aPref, host.get());
     nsresult stringErr;
     int32_t portValue = port.ToInteger(&stringErr);
     aPrefs->SetIntPref(aPortPref, portValue);
   }
   else
@@ -32,17 +32,17 @@ void SetProxyPref(const nsACString& aHos
 }
 
 void ParseOverrideServers(const char* aServers, nsIPrefBranch* aBranch)
 {
   // Windows (and Opera) formats its proxy override list in the form:
   // server;server;server where server is a server name or ip address,
   // or "<local>". Mozilla's format is server,server,server, and <local>
   // must be translated to "localhost,127.0.0.1"
-  nsCAutoString override(aServers);
+  nsAutoCString override(aServers);
   int32_t left = 0, right = 0;
   for (;;) {
     right = override.FindChar(';', right);
     const nsACString& host = Substring(override, left,
                                        (right < 0 ? override.Length() : right) - left);
     if (host.Equals("<local>"))
       override.Replace(left, 7, NS_LITERAL_CSTRING("localhost,127.0.0.1"));
     if (right < 0)
--- a/mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
+++ b/mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
@@ -57,23 +57,23 @@ nsNetscapeProfileMigratorBase::GetProfil
 
   if (!profileFileExists)
     return NS_ERROR_FILE_NOT_FOUND;
 
   nsINIParser parser;
   rv = parser.Init(profileIni);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString buffer, filePath;
+  nsAutoCString buffer, filePath;
   bool isRelative;
 
   // This is an infinite loop that is broken when we no longer find profiles
   // for profileID with IsRelative option.
   for (unsigned int c = 0; true; ++c) {
-    nsCAutoString profileID("Profile");
+    nsAutoCString profileID("Profile");
     profileID.AppendInt(c);
 
     if (NS_FAILED(parser.GetString(profileID.get(), "IsRelative", buffer)))
       break;
 
     isRelative = buffer.EqualsLiteral("1");
 
     rv = parser.GetString(profileID.get(), "Path", filePath);
@@ -221,34 +221,34 @@ nsNetscapeProfileMigratorBase::GetSignon
 
 nsresult
 nsNetscapeProfileMigratorBase::LocateSignonsFile(char** aResult)
 {
   nsCOMPtr<nsISimpleEnumerator> entries;
   nsresult rv = mSourceProfile->GetDirectoryEntries(getter_AddRefs(entries));
   if (NS_FAILED(rv)) return rv;
 
-  nsCAutoString fileName;
+  nsAutoCString fileName;
   do {
     bool hasMore = false;
     rv = entries->HasMoreElements(&hasMore);
     if (NS_FAILED(rv) || !hasMore) break;
 
     nsCOMPtr<nsISupports> supp;
     rv = entries->GetNext(getter_AddRefs(supp));
     if (NS_FAILED(rv)) break;
 
     nsCOMPtr<nsIFile> currFile(do_QueryInterface(supp));
 
     nsCOMPtr<nsIURI> uri;
     rv = NS_NewFileURI(getter_AddRefs(uri), currFile);
     if (NS_FAILED(rv)) break;
     nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
 
-    nsCAutoString extn;
+    nsAutoCString extn;
     url->GetFileExtension(extn);
 
 #ifdef MOZILLA_INTERNAL_API
     if (extn.EqualsIgnoreCase("s")) {
       url->GetFileName(fileName);
       break;
     }
 #else
--- a/mail/components/migration/src/nsProfileMigrator.cpp
+++ b/mail/components/migration/src/nsProfileMigrator.cpp
@@ -29,17 +29,17 @@
 NS_IMPL_ISUPPORTS1(nsProfileMigrator, nsIProfileMigrator)
 
 #define MIGRATION_WIZARD_FE_URL "chrome://messenger/content/migration/migration.xul"
 #define MIGRATION_WIZARD_FE_FEATURES "chrome,dialog,modal,centerscreen"
 
 NS_IMETHODIMP
 nsProfileMigrator::Migrate(nsIProfileStartup* aStartup, const nsACString& aKey)
 {
-  nsCAutoString key;
+  nsAutoCString key;
   nsCOMPtr<nsIMailProfileMigrator> mailMigrator;
   nsresult rv = GetDefaultMailMigratorKey(key, mailMigrator);
   NS_ENSURE_SUCCESS(rv, rv); // abort migration if we failed to get a mailMigrator (if we were supposed to)
 
   nsCOMPtr<nsISupportsCString> cstr (do_CreateInstance("@mozilla.org/supports-cstring;1"));
   NS_ENSURE_TRUE(cstr, NS_ERROR_OUT_OF_MEMORY);
   cstr->SetData(key);
 
@@ -83,17 +83,17 @@ nsProfileMigrator::GetDefaultMailMigrato
 
   nsCString forceMigrationType;
   prefs->GetCharPref("profile.force.migration", getter_Copies(forceMigrationType));
 
   // if we are being forced to migrate to a particular migration type, then create an instance of that migrator
   // and return it.
   NS_NAMED_LITERAL_CSTRING(migratorPrefix,
                            NS_MAILPROFILEMIGRATOR_CONTRACTID_PREFIX);
-  nsCAutoString migratorID;
+  nsAutoCString migratorID;
   if (!forceMigrationType.IsEmpty())
   {
     bool exists = false;
     migratorID = migratorPrefix;
     migratorID.Append(forceMigrationType);
     mailMigrator = do_CreateInstance(migratorID.get());
     if (!mailMigrator)
       return NS_ERROR_NOT_AVAILABLE;
--- a/mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
+++ b/mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
@@ -447,17 +447,17 @@ nsSeamonkeyProfileMigrator::CopySignatur
       if (exists)
       {
         nsAutoString leafName;
         srcSigFile->GetLeafName(leafName);
         srcSigFile->CopyTo(targetSigFile,leafName); // will fail if we've already copied a sig file here
         targetSigFile->Append(leafName);
 
         // now write out the new descriptor
-        nsCAutoString descriptorString;
+        nsAutoCString descriptorString;
         targetSigFile->GetPersistentDescriptor(descriptorString);
         NS_Free(pref->stringValue);
         pref->stringValue = ToNewCString(descriptorString);
       }
     }
   }
   return NS_OK;
 }
@@ -541,17 +541,17 @@ nsSeamonkeyProfileMigrator::CopyMailFold
         // the accounts into is unique. This protects against the case where the user
         // has multiple servers with the same host name.
         targetMailFolder->CreateUnique(nsIFile::DIRECTORY_TYPE, 0777);
 
         rv = RecursiveCopy(sourceMailFolder, targetMailFolder);
         // now we want to make sure the actual directory pref that gets
         // transformed into the new profile's pref.js has the right file
         // location.
-        nsCAutoString descriptorString;
+        nsAutoCString descriptorString;
         targetMailFolder->GetPersistentDescriptor(descriptorString);
         NS_Free(pref->stringValue);
         pref->stringValue = ToNewCString(descriptorString);
       }
     }
     else if (StringEndsWith(prefName, nsDependentCString(".newsrc.file")))
     {
       // copy the news RC file into \News. this won't work if the user has different newsrc files for each account
@@ -571,17 +571,17 @@ nsSeamonkeyProfileMigrator::CopyMailFold
       if (exists)
       {
         nsAutoString leafName;
         srcNewsRCFile->GetLeafName(leafName);
         srcNewsRCFile->CopyTo(targetNewsRCFile,leafName); // will fail if we've already copied a newsrc file here
         targetNewsRCFile->Append(leafName);
 
         // now write out the new descriptor
-        nsCAutoString descriptorString;
+        nsAutoCString descriptorString;
         targetNewsRCFile->GetPersistentDescriptor(descriptorString);
         NS_Free(pref->stringValue);
         pref->stringValue = ToNewCString(descriptorString);
       }
     }
   }
 
   return NS_OK;
--- a/mail/components/shell/nsMailGNOMEIntegration.cpp
+++ b/mail/components/shell/nsMailGNOMEIntegration.cpp
@@ -203,17 +203,17 @@ nsMailGNOMEIntegration::KeyMatchesAppNam
   return matches;
 }
 
 bool
 nsMailGNOMEIntegration::CheckHandlerMatchesAppName(const nsACString &handler) const
 {
   gint argc;
   gchar **argv;
-  nsCAutoString command(handler);
+  nsAutoCString command(handler);
 
   if (g_shell_parse_argv(command.get(), &argc, &argv, NULL)) {
     command.Assign(argv[0]);
     g_strfreev(argv);
   } else {
     return false;
   }
 
@@ -222,17 +222,17 @@ nsMailGNOMEIntegration::CheckHandlerMatc
 
 bool
 nsMailGNOMEIntegration::checkDefault(const char* const *aProtocols, unsigned int aLength)
 {
   nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
   nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
 
   bool enabled;
-  nsCAutoString handler;
+  nsAutoCString handler;
   nsresult rv;
 
   for (unsigned int i = 0; i < aLength; ++i) {
     if (gconf) {
       handler.Truncate();
       rv = gconf->GetAppForProtocol(nsDependentCString(aProtocols[i]),
                                     &enabled, handler);
       if (NS_SUCCEEDED(rv) && (!CheckHandlerMatchesAppName(handler) || !enabled)) {
@@ -259,17 +259,17 @@ nsMailGNOMEIntegration::checkDefault(con
 }
 
 nsresult
 nsMailGNOMEIntegration::MakeDefault(const char* const *aProtocols,
                                     unsigned int aProtocolsLength,
                                     const char *aMimeType,
                                     const char *aExtensions)
 {
-  nsCAutoString appKeyValue;
+  nsAutoCString appKeyValue;
   nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
   nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
   if(mAppIsInPath) {
     // mAppPath is in the users path, so use only the basename as the launcher
     gchar *tmp = g_path_get_basename(mAppPath.get());
     appKeyValue = tmp;
     g_free(tmp);
   } else {
--- a/mailnews/addrbook/src/nsAbBSDirectory.cpp
+++ b/mailnews/addrbook/src/nsAbBSDirectory.cpp
@@ -125,17 +125,17 @@ nsresult nsAbBSDirectory::EnsureInitiali
     uint32_t fileNameLen = strlen(server->fileName);
     if (((fileNameLen > kABFileName_PreviousSuffixLen) && 
       strcmp(server->fileName + fileNameLen - kABFileName_PreviousSuffixLen,
              kABFileName_PreviousSuffix) == 0) &&
       (server->dirType == PABDirectory))
       continue;
       
     // Set the uri property
-    nsCAutoString URI (server->uri);
+    nsAutoCString URI (server->uri);
     // This is in case the uri is never set
     // in the nsDirPref.cpp code.
     if (!server->uri) 
     {
       URI = NS_LITERAL_CSTRING(kMDBDirectoryRoot);
       URI += nsDependentCString(server->fileName);
     }
       
--- a/mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.cpp
+++ b/mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.cpp
@@ -137,17 +137,17 @@ nsresult nsAbBoolExprToLDAPFilter::Filte
     nsIAbBooleanConditionString* condition,
     nsCString& filter,
     int flags)
 {
     nsCString name;
     nsresult rv = condition->GetName(getter_Copies (name));
     NS_ENSURE_SUCCESS(rv, rv);
 
-    nsCAutoString ldapAttr(name);
+    nsAutoCString ldapAttr(name);
     if (flags & TRANSLATE_CARD_PROPERTY)
     {
         rv = map->GetFirstAttribute (name, ldapAttr);
         if (!(flags & ALLOW_NON_CONVERTABLE_CARD_PROPERTY) && 
             !ATTRMAP_FOUND_ATTR(rv, ldapAttr))
             return NS_OK;
     }
 
--- a/mailnews/addrbook/src/nsAbContentHandler.cpp
+++ b/mailnews/addrbook/src/nsAbContentHandler.cpp
@@ -48,17 +48,17 @@ nsAbContentHandler::HandleContent(const 
   if (PL_strcasecmp(aContentType, "application/x-addvcard") == 0) {
     nsCOMPtr<nsIURI> uri;
     nsCOMPtr<nsIChannel> aChannel = do_QueryInterface(request);
     if (!aChannel) return NS_ERROR_FAILURE;
 
     rv = aChannel->GetURI(getter_AddRefs(uri));
     if (uri)
     {
-        nsCAutoString path;
+        nsAutoCString path;
         rv = uri->GetPath(path);
         NS_ENSURE_SUCCESS(rv,rv);
 
         const char *startOfVCard = strstr(path.get(), "add?vcard=");
         if (startOfVCard)
         {
             nsCString unescapedData;
             
--- a/mailnews/addrbook/src/nsAbDirFactoryService.cpp
+++ b/mailnews/addrbook/src/nsAbDirFactoryService.cpp
@@ -36,19 +36,19 @@ nsAbDirFactoryService::GetDirFactory(con
   nsresult rv;
 
   // Obtain the network IO service
   nsCOMPtr<nsIIOService> nsService =
     mozilla::services::GetIOService();
   NS_ENSURE_TRUE(nsService, NS_ERROR_UNEXPECTED);
     
   // Extract the scheme
-  nsCAutoString scheme;
+  nsAutoCString scheme;
   rv = nsService->ExtractScheme(aURI, scheme);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Try to find a factory using the component manager.
-  nsCAutoString contractID;
+  nsAutoCString contractID;
   contractID.AssignLiteral(NS_AB_DIRECTORY_FACTORY_CONTRACTID_PREFIX);
   contractID.Append(scheme);
 
   return CallCreateInstance(contractID.get(), aDirFactory);
 }
--- a/mailnews/addrbook/src/nsAbLDAPAutoCompFormatter.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPAutoCompFormatter.cpp
@@ -48,27 +48,27 @@ nsAbLDAPAutoCompFormatter::Format(nsILDA
         NS_ERROR("nsAbLDAPAutoCompFormatter::Format(): do_GetService()"
                  " failed trying to obtain"
                  " '@mozilla.org/messenger/headerparser;1'");
         return NS_ERROR_NOT_AVAILABLE;
     }
 
     // generate the appropriate string
     //
-    nsCAutoString name;
+    nsAutoCString name;
     rv = ProcessFormat(mNameFormat, aMsg, &name, 0);
     if (NS_FAILED(rv)) {
         // Something went wrong lower down the stack; a message should
         // have already been logged there.  Return an error, rather
         // than trying to generate a bogus nsIAutoCompleteItem
         //
         return rv;
     }
 
-    nsCAutoString address;
+    nsAutoCString address;
     rv = ProcessFormat(mAddressFormat, aMsg, &address, 0);
     if (NS_FAILED(rv)) {
         // Something went wrong lower down the stack; a message should have 
         // already been logged there.  Return an error, rather than trying to 
         // generate a bogus nsIAutoCompleteItem.
         //
         return rv;
     }
@@ -99,17 +99,17 @@ nsAbLDAPAutoCompFormatter::Format(nsILDA
     if (NS_FAILED(rv)) {
         NS_ERROR("nsAbLDAPAutoCompFormatter::Format(): "
                  "item->SetValue failed");
         return rv;
     }
 
     // generate the appropriate string to appear as a comment off to the side
     //
-    nsCAutoString comment;
+    nsAutoCString comment;
     rv = ProcessFormat(mCommentFormat, aMsg, &comment, 0);
     if (NS_SUCCEEDED(rv)) {
         rv = item->SetComment(NS_ConvertUTF8toUTF16(comment).get());
         if (NS_FAILED(rv)) {
             NS_WARNING("nsAbLDAPAutoCompFormatter::Format():"
                        " item->SetComment() failed");
         }
     }
@@ -322,17 +322,17 @@ nsAbLDAPAutoCompFormatter::FormatExcepti
     //
     NS_IF_ADDREF(*aItem = item);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAbLDAPAutoCompFormatter::GetAttributes(nsACString &aResult)
 {
-    nsCAutoString searchAttrs;
+    nsAutoCString searchAttrs;
     nsresult rv = ProcessFormat(mNameFormat, 0, 0, &searchAttrs);
     if (NS_FAILED(rv)) {
         NS_WARNING("nsAbLDAPAutoCompFormatter::SetNameFormat(): "
                    "ProcessFormat() failed");
         return rv;
     }
     rv = ProcessFormat(mAddressFormat, 0, 0, &searchAttrs);
     if (NS_FAILED(rv)) {
@@ -376,17 +376,17 @@ nsAbLDAPAutoCompFormatter::ProcessFormat
     nsCOMPtr<nsIConsoleService> consoleSvc = 
         do_GetService("@mozilla.org/consoleservice;1", &rv);
     if (NS_FAILED(rv)) {
         NS_WARNING("nsAbLDAPAutoCompFormatter::ProcessFormat(): "
                    "couldn't get console service");
     }
 
     bool attrRequired = false;     // is this attr required or optional?
-    nsCAutoString attrName;             // current attr to get
+    nsAutoCString attrName;             // current attr to get
 
     // parse until we hit the end of the string
     //
     while (iter != iterEnd) {
 
         switch (*iter) {            // process the next char
 
         case PRUnichar('{'):
--- a/mailnews/addrbook/src/nsAbLDAPCard.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPCard.cpp
@@ -63,17 +63,17 @@ NS_IMETHODIMP nsAbLDAPCard::GetLDAPMessa
   nsresult rv;
   nsCOMPtr<nsIMutableArray> modArray =
     do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   
   // Add any missing object classes. We never remove any object
   // classes: if an entry has additional object classes, it's probably
   // for a good reason.
-  nsCAutoString oclass;
+  nsAutoCString oclass;
   for (uint32_t i = 0; i < aClassCount; ++i)
   {
     oclass.Assign(nsDependentCString(aClasses[i]));
     ToLowerCase(oclass);
    
     if (m_objectClass.IndexOf(oclass) == nsTArray<nsCString>::NoIndex)
     {
       m_objectClass.AppendElement(oclass);
@@ -108,17 +108,17 @@ NS_IMETHODIMP nsAbLDAPCard::GetLDAPMessa
   modArray->AppendElement(mod, false);
 
   // Add card properties
   CharPtrArrayGuard props;
   rv = aAttributeMap->GetAllCardProperties(props.GetSizeAddr(),
     props.GetArrayAddr());
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString attr;
+  nsAutoCString attr;
   nsCString propvalue;
   for (uint32_t i = 0; i < props.GetSize(); ++i)
   {
     // Skip some attributes that don't map to LDAP.
     //
     // BirthYear : by default this is mapped to 'birthyear',
     // which is not part of mozillaAbPersonAlpha
     //
@@ -197,17 +197,17 @@ NS_IMETHODIMP nsAbLDAPCard::BuildRdn(nsI
                                      const char **aAttributes,
                                      nsACString &aRdn)
 {
   NS_ENSURE_ARG_POINTER(aAttributeMap);
   NS_ENSURE_ARG_POINTER(aAttributes);
   
   nsresult rv;
   nsCString attr;
-  nsCAutoString prop;
+  nsAutoCString prop;
   nsCString propvalue;
 
   aRdn.Truncate();
   for (uint32_t i = 0; i < aAttrCount; ++i)
   {
     attr.Assign(nsDependentCString(aAttributes[i]));
    
     // Lookup the property corresponding to the attribute
@@ -246,28 +246,28 @@ NS_IMETHODIMP nsAbLDAPCard::SetDn(const 
   return SetPropertyAsAUTF8String(kDNColumn, aDN);
 }
 
 NS_IMETHODIMP nsAbLDAPCard::SetMetaProperties(nsILDAPMessage *aMessage)
 {
   NS_ENSURE_ARG_POINTER(aMessage);
   
   // Get DN
-  nsCAutoString dn;
+  nsAutoCString dn;
   nsresult rv = aMessage->GetDn(dn);
   NS_ENSURE_SUCCESS(rv, rv);
 
   SetDn(dn);
 
   // Get the list of set attributes
   CharPtrArrayGuard attrs;
   rv = aMessage->GetAttributes(attrs.GetSizeAddr(), attrs.GetArrayAddr());
   NS_ENSURE_SUCCESS(rv, rv);
  
-  nsCAutoString attr;
+  nsAutoCString attr;
   m_attributes.Clear();
   for (uint32_t i = 0; i < attrs.GetSize(); ++i)
   {
     attr.Assign(nsDependentCString(attrs[i]));
     ToLowerCase(attr);
     m_attributes.AppendElement(attr);
   }
 
@@ -280,17 +280,17 @@ NS_IMETHODIMP nsAbLDAPCard::SetMetaPrope
   // objectClass is not always included in search result entries and
   // nsILDAPMessage::GetValues returns NS_ERROR_LDAP_DECODING_ERROR if the
   // requested attribute doesn't exist.
   if (rv ==  NS_ERROR_LDAP_DECODING_ERROR)
     return NS_OK;
 
   NS_ENSURE_SUCCESS(rv, rv);
   
-  nsCAutoString oclass;
+  nsAutoCString oclass;
   for (uint32_t i = 0; i < vals.GetSize(); ++i)
   {
     oclass.Assign(NS_LossyConvertUTF16toASCII(nsDependentString(vals[i])));
     ToLowerCase(oclass);
     m_objectClass.AppendElement(oclass);
   }
 
   return NS_OK;
--- a/mailnews/addrbook/src/nsAbLDAPChangeLogData.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPChangeLogData.cpp
@@ -107,17 +107,17 @@ nsresult nsAbLDAPProcessChangeLogData::O
         return NS_ERROR_NOT_INITIALIZED;
 
     nsresult rv = NS_OK;       
 
     switch(mState)
     {
     case kSearchingAuthDN :
         {
-            nsCAutoString authDN;
+            nsAutoCString authDN;
             rv = aMessage->GetDn(authDN);
             if(NS_SUCCEEDED(rv) && !authDN.IsEmpty())
                 mAuthDN = authDN.get();
         }
         break;
     case kSearchingRootDSE:
         rv = ParseRootDSEEntry(aMessage);
         break;
@@ -160,17 +160,17 @@ nsresult nsAbLDAPProcessChangeLogData::O
                 nsCOMPtr<nsIAddrBookSession> abSession = do_GetService(NS_ADDRBOOKSESSION_CONTRACTID, &rv);
                 if (NS_FAILED(rv)) 
                     break;
                 nsCOMPtr<nsIFile> dbPath;
                 rv = abSession->GetUserProfileDirectory(getter_AddRefs(dbPath));
                 if (NS_FAILED(rv)) 
                     break;
 
-                nsCAutoString fileName;
+                nsAutoCString fileName;
                 rv = mDirectory->GetReplicationFileName(fileName);
                 if (NS_FAILED(rv))
                   break;
 
                 rv = dbPath->AppendNative(fileName);
                 if (NS_FAILED(rv)) 
                     break;
 
@@ -242,17 +242,17 @@ nsresult nsAbLDAPProcessChangeLogData::G
     if (!dialog) 
         return NS_ERROR_FAILURE;
 
     nsCOMPtr<nsILDAPURL> url;
     rv = mQuery->GetReplicationURL(getter_AddRefs(url));
     if (NS_FAILED(rv))
         return rv;
 
-    nsCAutoString serverUri;
+    nsAutoCString serverUri;
     rv = url->GetSpec(serverUri);
     if (NS_FAILED(rv)) 
         return rv;
 
     nsCOMPtr<nsIStringBundleService> bundleService =
       mozilla::services::GetStringBundleService();
     NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
     nsCOMPtr<nsIStringBundle> bundle;
--- a/mailnews/addrbook/src/nsAbLDAPChangeLogQuery.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPChangeLogQuery.cpp
@@ -84,24 +84,24 @@ NS_IMETHODIMP nsAbLDAPChangeLogQuery::Qu
 {
   if (!mInitialized)
     return NS_ERROR_NOT_INITIALIZED;
 
   nsCOMPtr<nsIAbLDAPAttributeMap> attrMap;
   nsresult rv = mDirectory->GetAttributeMap(getter_AddRefs(attrMap));
   NS_ENSURE_SUCCESS(rv, rv);
 
-    nsCAutoString filter;
+    nsAutoCString filter;
     rv = attrMap->GetFirstAttribute(NS_LITERAL_CSTRING("PrimaryEmail"), filter);
     NS_ENSURE_SUCCESS(rv, rv);
 
     filter += '=';
     filter += aValueUsedToFindDn;
 
-    nsCAutoString dn;
+    nsAutoCString dn;
     rv = mURL->GetDn(dn);
     if(NS_FAILED(rv)) 
         return rv;
 
     rv = CreateNewLDAPOperation();
     NS_ENSURE_SUCCESS(rv, rv);
 
     // XXX We really should be using LDAP_NO_ATTRS here once its exposed via
@@ -133,17 +133,17 @@ NS_IMETHODIMP nsAbLDAPChangeLogQuery::Qu
 
   int32_t lastChangeNumber;
   nsresult rv = mDirectory->GetLastChangeNumber(&lastChangeNumber);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // make sure that the filter here just have one condition 
   // and should not be enclosed in enclosing brackets.
   // also condition '>' doesnot work, it should be '>='/
-  nsCAutoString filter (NS_LITERAL_CSTRING("changenumber>="));
+  nsAutoCString filter (NS_LITERAL_CSTRING("changenumber>="));
   filter.AppendInt(lastChangeNumber + 1);
 
   rv = CreateNewLDAPOperation();
   NS_ENSURE_SUCCESS(rv, rv);
 
   return mOperation->SearchExt(aChangeLogDN, nsILDAPURL::SCOPE_ONELEVEL, filter, 
                                sizeof(sChangeLogEntryAttribs),
                                sChangeLogEntryAttribs, 0, 0);
@@ -151,17 +151,17 @@ NS_IMETHODIMP nsAbLDAPChangeLogQuery::Qu
 
 NS_IMETHODIMP nsAbLDAPChangeLogQuery::QueryChangedEntries(const nsACString & aChangedEntryDN)
 {
     if(!mInitialized) 
         return NS_ERROR_NOT_INITIALIZED;
     if(aChangedEntryDN.IsEmpty()) 
         return NS_ERROR_UNEXPECTED;
 
-    nsCAutoString urlFilter;
+    nsAutoCString urlFilter;
     nsresult rv = mURL->GetFilter(urlFilter);
     if(NS_FAILED(rv)) 
         return rv;
 
     int32_t scope;
     rv = mURL->GetScope(&scope);
     if(NS_FAILED(rv)) 
         return rv;
--- a/mailnews/addrbook/src/nsAbLDAPDirFactory.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPDirFactory.cpp
@@ -50,17 +50,17 @@ nsAbLDAPDirFactory::GetDirectories(const
      * the same problem that we hit with changing username / hostname
      * for mail servers.  To solve this problem, we add an extra
      * level of indirection.  The URI that we generate
      * (the bridge URI) will be moz-abldapdirectory://<prefName>
      * and when we need the hostname, basedn, port, etc,
      * we'll use the <prefName> to get the necessary prefs.
      * note, <prefName> does not change.
      */
-    nsCAutoString bridgeURI;
+    nsAutoCString bridgeURI;
     bridgeURI = NS_LITERAL_CSTRING(kLDAPDirectoryRoot);
     bridgeURI += aPrefName;
     rv = abManager->GetDirectory(bridgeURI, getter_AddRefs(directory));
   }
   else {
     rv = abManager->GetDirectory(aURI, getter_AddRefs(directory));
   }
   NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/addrbook/src/nsAbLDAPDirectory.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPDirectory.cpp
@@ -59,17 +59,17 @@ NS_IMETHODIMP nsAbLDAPDirectory::GetProp
 {
   aResult.AssignLiteral("chrome://messenger/content/addressbook/pref-directory-add.xul");
   return NS_OK;
 }
 
 NS_IMETHODIMP nsAbLDAPDirectory::Init(const char* aURI)
 {
   // We need to ensure that the m_DirPrefId is initialized properly
-  nsCAutoString uri(aURI);
+  nsAutoCString uri(aURI);
 
   // Find the first ? (of the search params) if there is one.
   // We know we can start at the end of the moz-abldapdirectory:// because
   // that's the URI we should have been passed.
   int32_t searchCharLocation = uri.FindChar('?', kLDAPDirectoryRootLen);
 
   if (searchCharLocation == -1)
     m_DirPrefId = Substring(uri, kLDAPDirectoryRootLen);
@@ -121,17 +121,17 @@ NS_IMETHODIMP nsAbLDAPDirectory::GetChil
       rv = GetReplicationFileName(fileName);
       NS_ENSURE_SUCCESS(rv,rv);
       
       // if there is no fileName, bail out now.
       if (fileName.IsEmpty())
         return NS_OK;
 
       // perform the same query, but on the local directory
-      nsCAutoString localDirectoryURI(NS_LITERAL_CSTRING(kMDBDirectoryRoot));
+      nsAutoCString localDirectoryURI(NS_LITERAL_CSTRING(kMDBDirectoryRoot));
       localDirectoryURI.Append(fileName);
       if (mIsQueryURI) 
       {
         localDirectoryURI.AppendLiteral("?");
         localDirectoryURI.Append(mQueryString);
       }
 
       nsCOMPtr<nsIAbManager> abManager(do_GetService(NS_ABMANAGER_CONTRACTID,
@@ -181,17 +181,17 @@ NS_IMETHODIMP nsAbLDAPDirectory::HasCard
 
 NS_IMETHODIMP nsAbLDAPDirectory::GetLDAPURL(nsILDAPURL** aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
 
   // Rather than using GetURI here we call GetStringValue directly so
   // we can handle the case where the URI isn't specified (see comments
   // below)
-  nsCAutoString URI;
+  nsAutoCString URI;
   nsresult rv = GetStringValue("uri", EmptyCString(), URI);
   if (NS_FAILED(rv) || URI.IsEmpty())
   {
     /*
      * A recent change in Mozilla now means that the LDAP Address Book
      * URI is based on the unique preference name value i.e.
      * [moz-abldapdirectory://prefName]
      * Prior to this valid change it was based on the actual uri i.e. 
@@ -223,17 +223,17 @@ NS_IMETHODIMP nsAbLDAPDirectory::GetLDAP
 
   return CallQueryInterface(result, aResult);
 }
 
 NS_IMETHODIMP nsAbLDAPDirectory::SetLDAPURL(nsILDAPURL *aUrl)
 {
   NS_ENSURE_ARG_POINTER(aUrl);
 
-  nsCAutoString oldUrl;
+  nsAutoCString oldUrl;
   // Note, it doesn't matter if GetStringValue fails - we'll just send an
   // update if its blank (i.e. old value not set).
   GetStringValue("uri", EmptyCString(), oldUrl);
 
   // Actually set the new value.
   nsCString tempLDAPURL;
   nsresult rv = aUrl->GetSpec(tempLDAPURL);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -430,17 +430,17 @@ NS_IMETHODIMP nsAbLDAPDirectory::GetIsRe
   *aIsRemote = true;
   return NS_OK;
 }
 
 NS_IMETHODIMP nsAbLDAPDirectory::GetIsSecure(bool *aIsSecure)
 {
   NS_ENSURE_ARG_POINTER(aIsSecure);
 
-  nsCAutoString URI;
+  nsAutoCString URI;
   nsresult rv = GetStringValue("uri", EmptyCString(), URI);
   NS_ENSURE_SUCCESS(rv, rv);
   
   // to determine if this is a secure directory, check if the uri is ldaps:// or not
   *aIsSecure = (strncmp(URI.get(), "ldaps:", 6) == 0);
   return NS_OK;
 }
 
@@ -557,17 +557,17 @@ NS_IMETHODIMP nsAbLDAPDirectory::GetSear
 NS_IMETHODIMP nsAbLDAPDirectory::SetSearchServerControls(nsIMutableArray *aControls)
 {
   mSearchServerControls = aControls;
   return NS_OK;
 }
 
 NS_IMETHODIMP nsAbLDAPDirectory::GetProtocolVersion(uint32_t *aProtocolVersion)
 {
-  nsCAutoString versionString;
+  nsAutoCString versionString;
 
   nsresult rv = GetStringValue("protocolVersion", NS_LITERAL_CSTRING("3"), versionString);
   NS_ENSURE_SUCCESS(rv, rv);
 
   *aProtocolVersion = versionString.EqualsLiteral("3") ?
     (uint32_t)nsILDAPConnection::VERSION3 :
     (uint32_t)nsILDAPConnection::VERSION2;
 
@@ -719,17 +719,17 @@ NS_IMETHODIMP nsAbLDAPDirectory::AddCard
   // Copy over the card data
   nsCOMPtr<nsIAbCard> copyToCard = do_QueryInterface(card, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = copyToCard->Copy(aUpdatedCard);
   NS_ENSURE_SUCCESS(rv, rv);
   
   // Retrieve preferences
-  nsCAutoString prefString;
+  nsAutoCString prefString;
   rv = GetRdnAttributes(prefString);
   NS_ENSURE_SUCCESS(rv, rv);
 
   CharPtrArrayGuard rdnAttrs;
   rv = SplitStringList(prefString, rdnAttrs.GetSizeAddr(),
     rdnAttrs.GetArrayAddr());
   NS_ENSURE_SUCCESS(rv, rv);
   
@@ -747,49 +747,49 @@ NS_IMETHODIMP nsAbLDAPDirectory::AddCard
     nsILDAPModification::MOD_ADD, getter_AddRefs(modArray));
   NS_ENSURE_SUCCESS(rv, rv);
   
   // For new cards, the base DN is the search base DN
   nsCOMPtr<nsILDAPURL> currentUrl;
   rv = GetLDAPURL(getter_AddRefs(currentUrl));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString baseDN;
+  nsAutoCString baseDN;
   rv = currentUrl->GetDn(baseDN);
   NS_ENSURE_SUCCESS(rv, rv);
  
   // Calculate DN
-  nsCAutoString cardDN;
+  nsAutoCString cardDN;
   rv = card->BuildRdn(attrMap, rdnAttrs.GetSize(), rdnAttrs.GetArray(),
     cardDN);
   NS_ENSURE_SUCCESS(rv, rv);
   cardDN.AppendLiteral(",");
   cardDN.Append(baseDN);
 
   rv = card->SetDn(cardDN);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString ourUuid;
+  nsAutoCString ourUuid;
   GetUuid(ourUuid);
   copyToCard->SetDirectoryId(ourUuid);
 
   // Launch query
   rv = DoModify(this, nsILDAPModification::MOD_ADD, cardDN, modArray,
                 EmptyCString(), EmptyCString());
   NS_ENSURE_SUCCESS(rv, rv);
 
   NS_ADDREF(*aAddedCard = copyToCard);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsAbLDAPDirectory::DeleteCards(nsIArray *aCards)
 {
   uint32_t cardCount;
   uint32_t i;
-  nsCAutoString cardDN;
+  nsAutoCString cardDN;
 
   nsresult rv = aCards->GetLength(&cardCount);
   NS_ENSURE_SUCCESS(rv, rv);
  
   for (i = 0; i < cardCount; ++i)
   {
     nsCOMPtr<nsIAbLDAPCard> card(do_QueryElementAt(aCards, i, &rv));
     if (NS_FAILED(rv))
@@ -828,64 +828,64 @@ NS_IMETHODIMP nsAbLDAPDirectory::ModifyC
   // Get the LDAP card
   nsCOMPtr<nsIAbLDAPCard> card = do_QueryInterface(aUpdatedCard, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = Initiate();
   NS_ENSURE_SUCCESS(rv, rv);
   
   // Retrieve preferences
-  nsCAutoString prefString;
+  nsAutoCString prefString;
   rv = GetObjectClasses(prefString);
   NS_ENSURE_SUCCESS(rv, rv);
   
   CharPtrArrayGuard objClass;
   rv = SplitStringList(prefString, objClass.GetSizeAddr(),
     objClass.GetArrayAddr());
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Process updates
   nsCOMPtr<nsIArray> modArray;
   rv = card->GetLDAPMessageInfo(attrMap, objClass.GetSize(), objClass.GetArray(),
     nsILDAPModification::MOD_REPLACE, getter_AddRefs(modArray));
   NS_ENSURE_SUCCESS(rv, rv);
   
   // Get current DN
-  nsCAutoString oldDN;
+  nsAutoCString oldDN;
   rv = card->GetDn(oldDN);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsILDAPService> ldapSvc = do_GetService(
     "@mozilla.org/network/ldap-service;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Retrieve base DN and RDN attributes
-  nsCAutoString baseDN;
-  nsCAutoString oldRDN;
+  nsAutoCString baseDN;
+  nsAutoCString oldRDN;
   CharPtrArrayGuard rdnAttrs;
   rv = ldapSvc->ParseDn(oldDN.get(), oldRDN, baseDN,
                         rdnAttrs.GetSizeAddr(), rdnAttrs.GetArrayAddr());
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Calculate new RDN and check whether it has changed
-  nsCAutoString newRDN;
+  nsAutoCString newRDN;
   rv = card->BuildRdn(attrMap, rdnAttrs.GetSize(), rdnAttrs.GetArray(),
     newRDN);
   NS_ENSURE_SUCCESS(rv, rv);
       
   if (newRDN.Equals(oldRDN))
   {
     // Launch query
     rv = DoModify(this, nsILDAPModification::MOD_REPLACE, oldDN, modArray,
                   EmptyCString(), EmptyCString());
   }
   else
   {
     // Build and store the new DN
-    nsCAutoString newDN(newRDN);
+    nsAutoCString newDN(newRDN);
     newDN.AppendLiteral(",");
     newDN.Append(baseDN);
     
     rv = card->SetDn(newDN);
     NS_ENSURE_SUCCESS(rv, rv);
     
     // Launch query
     rv = DoModify(this, nsILDAPModification::MOD_REPLACE, oldDN, modArray,
--- a/mailnews/addrbook/src/nsAbLDAPDirectoryModify.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPDirectoryModify.cpp
@@ -235,17 +235,17 @@ nsresult nsAbModifyLDAPMessageListener::
   NS_ENSURE_ARG_POINTER(aMessage);
   
   int32_t errCode;
   rv = aMessage->GetErrorCode(&errCode);
   NS_ENSURE_SUCCESS(rv, rv);
  
   if (errCode != nsILDAPErrors::SUCCESS)
   {
-    nsCAutoString errMessage;
+    nsAutoCString errMessage;
     rv = aMessage->GetErrorMessage(errMessage);
     NS_ENSURE_SUCCESS(rv, rv);
 
     printf("LDAP modification failed (code: %i, message: %s)\n",
            errCode, errMessage.get());
     return NS_ERROR_FAILURE;
   }
   
@@ -259,17 +259,17 @@ nsresult nsAbModifyLDAPMessageListener::
   NS_ENSURE_ARG_POINTER(aMessage);
   
   int32_t errCode;
   rv = aMessage->GetErrorCode(&errCode);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (errCode != nsILDAPErrors::SUCCESS)
   {
-    nsCAutoString errMessage;
+    nsAutoCString errMessage;
     rv = aMessage->GetErrorMessage(errMessage);
     NS_ENSURE_SUCCESS(rv, rv);
 
     printf("LDAP rename failed (code: %i, message: %s)\n",
            errCode, errMessage.get());
     return NS_ERROR_FAILURE;
   }
   
--- a/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp
@@ -202,29 +202,29 @@ nsresult nsAbQueryLDAPMessageListener::D
   mCanceled = mFinished = false;
 
   mOperation = do_CreateInstance(NS_LDAPOPERATION_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = mOperation->Init(mConnection, this, nullptr);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString dn;
+  nsAutoCString dn;
   rv = mSearchUrl->GetDn(dn);
   NS_ENSURE_SUCCESS(rv, rv);
 
   int32_t scope;
   rv = mSearchUrl->GetScope(&scope);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString filter;
+  nsAutoCString filter;
   rv = mSearchUrl->GetFilter(filter);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString attributes;
+  nsAutoCString attributes;
   rv = mSearchUrl->GetAttributes(attributes);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = mOperation->SetServerControls(mServerSearchControls);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = mOperation->SetClientControls(mClientSearchControls);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -325,21 +325,21 @@ NS_IMETHODIMP nsAbLDAPDirectoryQuery::Do
   nsCOMPtr<nsIAbLDAPDirectory> directory(do_QueryInterface(aDirectory, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
   
   // We also need the current URL to check as well...
   nsCOMPtr<nsILDAPURL> currentUrl;
   rv = directory->GetLDAPURL(getter_AddRefs(currentUrl));
   NS_ENSURE_SUCCESS(rv, rv);
   
-  nsCAutoString login;
+  nsAutoCString login;
   rv = directory->GetAuthDn(login);
   NS_ENSURE_SUCCESS(rv, rv);
   
-  nsCAutoString saslMechanism;
+  nsAutoCString saslMechanism;
   rv = directory->GetSaslMechanism(saslMechanism);
   NS_ENSURE_SUCCESS(rv, rv);
   
   uint32_t protocolVersion;
   rv = directory->GetProtocolVersion(&protocolVersion);
   NS_ENSURE_SUCCESS(rv, rv);
   
   // To do:
@@ -403,17 +403,17 @@ NS_IMETHODIMP nsAbLDAPDirectoryQuery::Do
   nsCOMPtr<nsISupports> iSupportsMap;
   rv = aArguments->GetTypeSpecificArg(getter_AddRefs(iSupportsMap));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIAbLDAPAttributeMap> map = do_QueryInterface(iSupportsMap, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Require all attributes that are mapped to card properties
-  nsCAutoString returnAttributes;
+  nsAutoCString returnAttributes;
   rv = map->GetAllCardAttributes(returnAttributes);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = url->SetAttributes(returnAttributes);
   // Now do the error check
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Also require the objectClass attribute, it is used by
@@ -421,17 +421,17 @@ NS_IMETHODIMP nsAbLDAPDirectoryQuery::Do
   rv = url->AddAttribute(NS_LITERAL_CSTRING("objectClass"));
 
   // Get the filter
   nsCOMPtr<nsISupports> supportsExpression;
   rv = aArguments->GetExpression (getter_AddRefs (supportsExpression));
   NS_ENSURE_SUCCESS(rv, rv);
   
   nsCOMPtr<nsIAbBooleanExpression> expression (do_QueryInterface (supportsExpression, &rv));
-  nsCAutoString filter;
+  nsAutoCString filter;
   
   // figure out how we map attribute names to addressbook fields for this
   // query
   rv = nsAbBoolExprToLDAPFilter::Convert(map, expression, filter);
   NS_ENSURE_SUCCESS(rv, rv);
 
   /*
    * Mozilla itself cannot arrive here with a blank filter
@@ -448,23 +448,23 @@ NS_IMETHODIMP nsAbLDAPDirectoryQuery::Do
    */
   if (filter.IsEmpty())
   {
     filter.AssignLiteral("(objectclass=inetorgperson)");
   }
 
   // get the directoryFilter from the directory url and merge it with the user's
   // search filter
-  nsCAutoString urlFilter;
+  nsAutoCString urlFilter;
   rv = mDirectoryUrl->GetFilter(urlFilter);
   
   // if urlFilter is unset (or set to the default "objectclass=*"), there's
   // no need to AND in an empty search term, so leave prefix and suffix empty
   
-  nsCAutoString searchFilter;
+  nsAutoCString searchFilter;
   if (urlFilter.Length() && !urlFilter.EqualsLiteral("(objectclass=*)"))
   {
     // if urlFilter isn't parenthesized, we need to add in parens so that
     // the filter works as a term to &
     //
     if (urlFilter[0] != '(')
     {
       searchFilter = NS_LITERAL_CSTRING("(&(");
--- a/mailnews/addrbook/src/nsAbLDAPListenerBase.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPListenerBase.cpp
@@ -107,17 +107,17 @@ NS_IMETHODIMP nsAbLDAPListenerBase::OnLD
                "'authPromptTitle' string from bundle "
                "chrome://mozldap/locale/ldap.properties");
       InitFailed();
       return rv;
     }
 
     // get the host name for the auth prompt
     //
-    nsCAutoString host;
+    nsAutoCString host;
     rv = mDirectoryUrl->GetAsciiHost(host);
     if (NS_FAILED(rv))
     {
       NS_ERROR("nsAbLDAPListenerBase::OnLDAPInit(): error getting ascii host"
                "name from directory url");
       InitFailed();
       return rv;
     }
@@ -237,17 +237,17 @@ NS_IMETHODIMP nsAbLDAPListenerBase::OnLD
     NS_ERROR("nsAbLDAPMessageBase::OnLDAPInit(): failed to Initialise operation");
     InitFailed();
     return rv;
   }
 
   // Try non-password mechanisms first
   if (mSaslMechanism.EqualsLiteral("GSSAPI"))
   {
-    nsCAutoString service;
+    nsAutoCString service;
     rv = mDirectoryUrl->GetAsciiHost(service);
     NS_ENSURE_SUCCESS(rv, rv);
 
     service.Insert(NS_LITERAL_CSTRING("ldap@"), 0);
 
     nsCOMPtr<nsIAuthModule> authModule =
       do_CreateInstance(NS_AUTH_MODULE_CONTRACTID_PREFIX "sasl-gssapi", &rv);
     NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/addrbook/src/nsAbLDAPReplicationData.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPReplicationData.cpp
@@ -144,17 +144,17 @@ NS_IMETHODIMP nsAbLDAPProcessReplication
     // force close since we need to delete the file.
     mReplicationDB->ForceClosed();
     mDBOpen = false;
 
     // delete the unsaved replication file
     if (mReplicationFile) {
       rv = mReplicationFile->Remove(false);
       if (NS_SUCCEEDED(rv) && mDirectory) {
-        nsCAutoString fileName;
+        nsAutoCString fileName;
         rv = mDirectory->GetReplicationFileName(fileName);
         // now put back the backed up replicated file if aborted
         if (NS_SUCCEEDED(rv) && mBackupReplicationFile)
           rv = mBackupReplicationFile->MoveToNative(nullptr, fileName);
       }
     }
   }
 
@@ -175,35 +175,35 @@ nsresult nsAbLDAPProcessReplicationData:
 
   mOperation = do_CreateInstance(NS_LDAPOPERATION_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = mOperation->Init(mConnection, this, nullptr);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // get the relevant attributes associated with the directory server url
-  nsCAutoString urlFilter;
+  nsAutoCString urlFilter;
   rv = mDirectoryUrl->GetFilter(urlFilter);
   if (NS_FAILED(rv))
     return rv;
 
-  nsCAutoString dn;
+  nsAutoCString dn;
   rv = mDirectoryUrl->GetDn(dn);
   if (NS_FAILED(rv))
     return rv;
 
   if (dn.IsEmpty())
     return NS_ERROR_UNEXPECTED;
 
   int32_t scope;
   rv = mDirectoryUrl->GetScope(&scope);
   if (NS_FAILED(rv))
     return rv;
 
-  nsCAutoString attributes;
+  nsAutoCString attributes;
   rv = mDirectoryUrl->GetAttributes(attributes);
   if (NS_FAILED(rv))
     return rv;
 
   mState = kReplicatingAll;
 
   if (mListener && NS_SUCCEEDED(rv))
     // XXX Cast from bool to nsresult
@@ -253,17 +253,17 @@ nsresult nsAbLDAPProcessReplicationData:
 
     rv = mReplicationDB->CreateNewCardAndAddToDB(newCard, false, nullptr);
     if(NS_FAILED(rv)) {
         Abort();
         return rv;
     }
 
     // now set the attribute for the DN of the entry in the card in the DB
-    nsCAutoString authDN;
+    nsAutoCString authDN;
     rv = aMessage->GetDn(authDN);
     if(NS_SUCCEEDED(rv) && !authDN.IsEmpty())
     {
         newCard->SetPropertyAsAUTF8String("_DN", authDN);
     }
 
     rv = mReplicationDB->EditCard(newCard, false, nullptr);
     if(NS_FAILED(rv)) {
@@ -328,17 +328,17 @@ nsresult nsAbLDAPProcessReplicationData:
         // if error result is returned remove the replicated file
         if(mReplicationFile) {
             rv = mReplicationFile->Remove(false);
             NS_ASSERTION(NS_SUCCEEDED(rv), "Replication File Remove on Failure failed");
             if(NS_SUCCEEDED(rv)) {
                 // now put back the backed up replicated file
                 if(mBackupReplicationFile && mDirectory) 
                 {
-                  nsCAutoString fileName;
+                  nsAutoCString fileName;
                   rv = mDirectory->GetReplicationFileName(fileName);
                   if (NS_SUCCEEDED(rv) && !fileName.IsEmpty())
                   {
                     rv = mBackupReplicationFile->MoveToNative(nullptr, fileName);
                     NS_ASSERTION(NS_SUCCEEDED(rv), "Replication Backup File Move back on Failure failed");
                   }
                 }
             }
--- a/mailnews/addrbook/src/nsAbLDAPReplicationQuery.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPReplicationQuery.cpp
@@ -21,17 +21,17 @@ NS_IMPL_THREADSAFE_ISUPPORTS1(nsAbLDAPRe
 
 nsAbLDAPReplicationQuery::nsAbLDAPReplicationQuery()
     :  mInitialized(false)
 {
 }
 
 nsresult nsAbLDAPReplicationQuery::InitLDAPData()
 {
-  nsCAutoString fileName;
+  nsAutoCString fileName;
   nsresult rv = mDirectory->GetReplicationFileName(fileName);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // this is done here to take care of the problem related to bug # 99124.
   // earlier versions of Mozilla could have the fileName associated with the directory
   // to be abook.mab which is the profile's personal addressbook. If the pref points to
   // it, calls nsDirPrefs to generate a new server filename.
   if (fileName.IsEmpty() || fileName.EqualsLiteral(kPersonalAddressbook))
--- a/mailnews/addrbook/src/nsAbLDIFService.cpp
+++ b/mailnews/addrbook/src/nsAbLDIFService.cpp
@@ -385,18 +385,18 @@ void nsAbLDIFService::AddLdifRowToDataba
   // Clear buffer for next record
   ClearLdifRecordBuffer();
 }
 
 void nsAbLDIFService::AddLdifColToDatabase(nsIAddrDatabase *aDatabase,
                                            nsIMdbRow* newRow, char* typeSlot,
                                            char* valueSlot, bool bIsList)
 {
-  nsCAutoString colType(typeSlot);
-  nsCAutoString column(valueSlot);
+  nsAutoCString colType(typeSlot);
+  nsAutoCString column(valueSlot);
 
   // 4.x exports attributes like "givenname", 
   // mozilla does "givenName" to be compliant with RFC 2798
   ToLowerCase(colType);
 
   mdb_u1 firstByte = (mdb_u1)(colType.get())[0];
   switch ( firstByte )
   {
@@ -617,17 +617,17 @@ void nsAbLDIFService::AddLdifColToDataba
       if (mStoreLocAsHome)
         aDatabase->AddHomeZipCode(newRow, column.get());
       else
         aDatabase->AddWorkZipCode(newRow, column.get());
     }
 
     else if (colType.EqualsLiteral("postofficebox"))
     {
-      nsCAutoString workAddr1, workAddr2;
+      nsAutoCString workAddr1, workAddr2;
       SplitCRLFAddressField(column, workAddr1, workAddr2);
       aDatabase->AddWorkAddress(newRow, workAddr1.get());
       aDatabase->AddWorkAddress2(newRow, workAddr2.get());
     }
     else if (colType.EqualsLiteral("pager") || colType.EqualsLiteral("pagerphone"))
       aDatabase->AddPagerNumber(newRow, column.get());
 
     break; // 'p'
@@ -647,17 +647,17 @@ void nsAbLDIFService::AddLdifColToDataba
     if (colType.EqualsLiteral("sn") || colType.EqualsLiteral("surname"))
       aDatabase->AddLastName(newRow, column.get());
 
     else if (colType.EqualsLiteral("street"))
       aDatabase->AddWorkAddress(newRow, column.get());
 
     else if (colType.EqualsLiteral("streetaddress"))
     {
-      nsCAutoString addr1, addr2;
+      nsAutoCString addr1, addr2;
       SplitCRLFAddressField(column, addr1, addr2);
       if (mStoreLocAsHome)
       {
         aDatabase->AddHomeAddress(newRow, addr1.get());
         aDatabase->AddHomeAddress2(newRow, addr2.get());
       }
       else
       {
--- a/mailnews/addrbook/src/nsAbMDBDirFactory.cpp
+++ b/mailnews/addrbook/src/nsAbMDBDirFactory.cpp
@@ -48,17 +48,17 @@ NS_IMETHODIMP nsAbMDBDirFactory::GetDire
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIFile> dbPath;
   rv = abManager->GetUserProfileDirectory(getter_AddRefs(dbPath));
 
   nsCOMPtr<nsIAddrDatabase> listDatabase;
   if (NS_SUCCEEDED(rv))
   {
-    nsCAutoString fileName;
+    nsAutoCString fileName;
       
     if (StringBeginsWith(aURI, NS_LITERAL_CSTRING(kMDBDirectoryRoot)))
       fileName = Substring(aURI, kMDBDirectoryRootLen, aURI.Length() - kMDBDirectoryRootLen);
 
     rv = dbPath->AppendNative(fileName);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsIAddrDatabase> addrDBFactory = do_GetService(NS_ADDRDATABASE_CONTRACTID, &rv);
--- a/mailnews/addrbook/src/nsAbMDBDirectory.cpp
+++ b/mailnews/addrbook/src/nsAbMDBDirectory.cpp
@@ -59,17 +59,17 @@ NS_IMETHODIMP nsAbMDBDirectory::Init(con
   // Mailing lists don't have their own prefs.
   if (m_DirPrefId.IsEmpty() && !m_IsMailList)
   {
     // Find the first ? (of the search params) if there is one.
     // We know we can start at the end of the moz-abmdbdirectory:// because
     // that's the URI we should have been passed.
     int32_t searchCharLocation = uri.FindChar('?', kMDBDirectoryRootLen);
 
-    nsCAutoString filename;
+    nsAutoCString filename;
 
     // extract the filename from the uri.
     if (searchCharLocation == -1)
       filename = Substring(uri, kMDBDirectoryRootLen);
     else
       filename = Substring(uri, kMDBDirectoryRootLen, searchCharLocation - kMDBDirectoryRootLen);
 
     // Get the pref servers and the address book directory branch
@@ -100,17 +100,17 @@ NS_IMETHODIMP nsAbMDBDirectory::Init(con
         if (NS_SUCCEEDED(prefBranch->GetCharPref(child.get(),
                                                  getter_Copies(childValue))))
         {
           if (childValue == filename)
           {
             dotOffset = child.RFindChar('.');
             if (dotOffset != -1)
             {
-              nsCAutoString prefName(StringHead(child, dotOffset));
+              nsAutoCString prefName(StringHead(child, dotOffset));
               m_DirPrefId.AssignLiteral(PREF_LDAP_SERVER_TREE_NAME ".");
               m_DirPrefId.Append(prefName);
             }
           }
         }
       }
     }     
     NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(childCount, childArray);
@@ -500,17 +500,17 @@ NS_IMETHODIMP nsAbMDBDirectory::DeleteCa
         else
         {
           mDatabase->DeleteCard(card, true, this);
           bool bIsMailList = false;
           card->GetIsMailList(&bIsMailList);
           if (bIsMailList)
           {
             //to do, get mailing list dir side uri and notify nsIAbManager to remove it
-            nsCAutoString listUri(mURI);
+            nsAutoCString listUri(mURI);
             listUri.AppendLiteral("/MailList");
             listUri.AppendInt(rowID);
             if (!listUri.IsEmpty())
             {
               nsresult rv = NS_OK;
 
               nsCOMPtr<nsIAbManager> abManager =
                   do_GetService(NS_ABMANAGER_CONTRACTID, &rv);
@@ -622,17 +622,17 @@ NS_IMETHODIMP nsAbMDBDirectory::AddMailL
   else
     mDatabase->CreateMailListAndAddToDB(list, true, this);
 
   mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
 
   uint32_t dbRowID;
   dblist->GetDbRowID(&dbRowID);
 
-  nsCAutoString listUri(mURI);
+  nsAutoCString listUri(mURI);
   listUri.AppendLiteral("/MailList");
   listUri.AppendInt(dbRowID);
 
   nsCOMPtr<nsIAbDirectory> newList;
   rv = AddDirectory(listUri.get(), getter_AddRefs(newList));
   if (NS_SUCCEEDED(rv) && newList)
   {
     nsCOMPtr<nsIAbMDBDirectory> dbnewList(do_QueryInterface(newList, &rv));
@@ -975,17 +975,17 @@ nsresult nsAbMDBDirectory::GetAbDatabase
   if (mDatabase)
     return NS_OK;
 
   nsresult rv;
 
   if (m_IsMailList)
   {
     // Get the database of the parent directory.
-    nsCAutoString parentURI(mURINoQuery);
+    nsAutoCString parentURI(mURINoQuery);
 
     int32_t pos = parentURI.RFindChar('/');
 
     // If we didn't find a / something really bad has happened
     if (pos == -1)
       return NS_ERROR_FAILURE;
 
     parentURI = StringHead(parentURI, pos);
--- a/mailnews/addrbook/src/nsAbManager.cpp
+++ b/mailnews/addrbook/src/nsAbManager.cpp
@@ -245,25 +245,25 @@ NS_IMETHODIMP nsAbManager::GetDirectory(
   }
 
   // Do we have a copy of this directory already within our look-up table?
   if (!mAbStore.Get(aURI, getter_AddRefs(directory)))
   {
     // The directory wasn't in our look-up table, so we need to instantiate
     // it. First, extract the scheme from the URI...
 
-    nsCAutoString scheme;
+    nsAutoCString scheme;
 
     int32_t colon = aURI.FindChar(':');
     if (colon <= 0)
       return NS_ERROR_MALFORMED_URI;
     scheme = Substring(aURI, 0, colon);
 
     // Construct the appropriate nsIAbDirectory...
-    nsCAutoString contractID;
+    nsAutoCString contractID;
     contractID.AssignLiteral(NS_AB_DIRECTORY_TYPE_CONTRACTID_PREFIX);
     contractID.Append(scheme);
     directory = do_CreateInstance(contractID.get(), &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Init it with the URI
     rv = directory->Init(PromiseFlatCString(aURI).get());
     NS_ENSURE_SUCCESS(rv, rv);
@@ -425,17 +425,17 @@ NS_IMETHODIMP nsAbManager::NotifyDirecto
 
 NS_IMETHODIMP nsAbManager::GetUserProfileDirectory(nsIFile **userDir)
 {
   NS_ENSURE_ARG_POINTER(userDir);
   *userDir = nullptr;
 
   nsresult rv;
   nsCOMPtr<nsIFile> profileDir;
-  nsCAutoString pathBuf;
+  nsAutoCString pathBuf;
 
   rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(profileDir));
   NS_ENSURE_SUCCESS(rv, rv);
 
   return CallQueryInterface(profileDir, userDir);
 }
 
 NS_IMETHODIMP nsAbManager::MailListNameExists(const PRUnichar *name, bool *exist)
@@ -863,17 +863,17 @@ nsAbManager::ExportDirectoryToLDIF(nsIAb
           length = valueCStr.Length();
           rv = outputStream->Write(valueCStr.get(), length, &writeCount);
           NS_ENSURE_SUCCESS(rv,rv);
           if (length != writeCount)
             return NS_ERROR_FAILURE;
 
           valueCStr.Truncate();
 
-          nsCAutoString ldapAttribute;
+          nsAutoCString ldapAttribute;
 
           for (i = 0; i < ArrayLength(EXPORT_ATTRIBUTES_TABLE); i++) {
             if (NS_SUCCEEDED(attrMap->GetFirstAttribute(nsDependentCString(EXPORT_ATTRIBUTES_TABLE[i].abPropertyName),
                                                         ldapAttribute)) &&
                 !ldapAttribute.IsEmpty()) {
 
               rv = card->GetPropertyAsAString(EXPORT_ATTRIBUTES_TABLE[i].abPropertyName, value);
               if (NS_FAILED(rv))
@@ -940,17 +940,17 @@ nsresult nsAbManager::AppendLDIFForMailL
 
   aResult += MSG_LINEBREAK \
              "objectclass: top" MSG_LINEBREAK \
              "objectclass: groupOfNames" MSG_LINEBREAK;
 
   rv = aCard->GetDisplayName(attrValue);
   NS_ENSURE_SUCCESS(rv,rv);
 
-  nsCAutoString ldapAttributeName;
+  nsAutoCString ldapAttributeName;
 
   rv = aAttrMap->GetFirstAttribute(NS_LITERAL_CSTRING(kDisplayNameProperty),
                                   ldapAttributeName);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = AppendProperty(ldapAttributeName.get(), attrValue.get(), aResult);
   NS_ENSURE_SUCCESS(rv,rv);
   aResult += MSG_LINEBREAK;
@@ -1007,17 +1007,17 @@ nsresult nsAbManager::AppendLDIFForMailL
   aResult += MSG_LINEBREAK;
   return NS_OK;
 }
 
 nsresult nsAbManager::AppendDNForCard(const char *aProperty, nsIAbCard *aCard, nsIAbLDAPAttributeMap *aAttrMap, nsACString &aResult)
 {
   nsString email;
   nsString displayName;
-  nsCAutoString ldapAttributeName;
+  nsAutoCString ldapAttributeName;
 
   nsresult rv = aCard->GetPrimaryEmail(email);
   NS_ENSURE_SUCCESS(rv,rv);
 
   rv = aCard->GetDisplayName(displayName);
   NS_ENSURE_SUCCESS(rv,rv);
 
   nsString cnStr;
--- a/mailnews/addrbook/src/nsAbOSXDirectory.mm
+++ b/mailnews/addrbook/src/nsAbOSXDirectory.mm
@@ -36,17 +36,17 @@
  */
 #define OSX_CARD_STORE_INIT 100
 
 static nsresult
 GetOrCreateGroup(NSString *aUid, nsIAbDirectory **aResult)
 {
   NS_ASSERTION(aUid, "No UID for group!.");
 
-  nsCAutoString uri(NS_ABOSXDIRECTORY_URI_PREFIX);
+  nsAutoCString uri(NS_ABOSXDIRECTORY_URI_PREFIX);
   AppendToCString(aUid, uri);
 
   nsresult rv;
   nsCOMPtr<nsIAbManager> abManager = do_GetService(NS_ABMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIAbDirectory> directory;
   rv = abManager->GetDirectory(uri, getter_AddRefs(directory));
@@ -59,17 +59,17 @@ GetOrCreateGroup(NSString *aUid, nsIAbDi
 static nsresult
 GetCard(ABRecord *aRecord, nsIAbCard **aResult, nsIAbOSXDirectory *osxDirectory)
 {
   NSString *uid = [aRecord uniqueId];
   NS_ASSERTION(uid, "No UID for card!.");
   if (!uid)
     return NS_ERROR_FAILURE;
 
-  nsCAutoString uri(NS_ABOSXCARD_URI_PREFIX);
+  nsAutoCString uri(NS_ABOSXCARD_URI_PREFIX);
   AppendToCString(uid, uri);
   nsCOMPtr<nsIAbOSXCard> osxCard;
   nsresult rv = osxDirectory->GetCardByUri(uri, getter_AddRefs(osxCard));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIAbCard> card = do_QueryInterface(osxCard, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -84,17 +84,17 @@ CreateCard(ABRecord *aRecord, nsIAbCard 
   NS_ASSERTION(uid, "No UID for card!.");
   if (!uid)
     return NS_ERROR_FAILURE;
 
   nsresult rv;
   nsCOMPtr<nsIAbOSXCard> osxCard = do_CreateInstance(NS_ABOSXCARD_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString uri(NS_ABOSXCARD_URI_PREFIX);
+  nsAutoCString uri(NS_ABOSXCARD_URI_PREFIX);
   AppendToCString(uid, uri);
 
   rv = osxCard->Init(uri.get());
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIAbCard> card = do_QueryInterface(osxCard, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -214,17 +214,17 @@ Sync(NSString *aUid)
     nsCOMPtr<nsIAbOSXDirectory> osxDirectory =
       do_QueryInterface(directory, &rv);
     NS_ENSURE_SUCCESS(rv, );
 
     unsigned int i, count = [deleted count];
     for (i = 0; i < count; ++i) {
       NSString *deletedUid = [deleted objectAtIndex:i];
 
-      nsCAutoString uid;
+      nsAutoCString uid;
       AppendToCString(deletedUid, uid);
 
       rv = osxDirectory->DeleteUid(uid);
       NS_ENSURE_SUCCESS(rv, );
     }
   }
   
   if (!inserted && !updated && !deleted) {
@@ -499,37 +499,37 @@ nsAbOSXDirectory::Init(const char *aUri)
     else
       rv = mCardList->Clear();
     NS_ENSURE_SUCCESS(rv, rv);
 
     cardList = mCardList;
   }
   else
   {
-    nsCAutoString uid(Substring(mURINoQuery, sizeof(NS_ABOSXDIRECTORY_URI_PREFIX) - 1));
+    nsAutoCString uid(Substring(mURINoQuery, sizeof(NS_ABOSXDIRECTORY_URI_PREFIX) - 1));
     ABRecord *card = [addressBook recordForUniqueId:[NSString stringWithUTF8String:uid.get()]];
     NS_ASSERTION([card isKindOfClass:[ABGroup class]], "Huh.");
 
     m_IsMailList = true;
     AppendToString([card valueForProperty:kABGroupNameProperty], m_ListDirName);
 
-    ABGroup *group = (ABGroup*)[addressBook recordForUniqueId:[NSString stringWithUTF8String:nsCAutoString(Substring(mURINoQuery, 21)).get()]];
+    ABGroup *group = (ABGroup*)[addressBook recordForUniqueId:[NSString stringWithUTF8String:nsAutoCString(Substring(mURINoQuery, 21)).get()]];
     cards = [[group members] arrayByAddingObjectsFromArray:[group subgroups]];
 
     if (!m_AddressList)
       m_AddressList = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
     else
       rv = m_AddressList->Clear();
     NS_ENSURE_SUCCESS(rv, rv);
 
     cardList = m_AddressList;
   }
 
 
-  nsCAutoString ourUuid;
+  nsAutoCString ourUuid;
   GetUuid(ourUuid);
 
   unsigned int nbCards = [cards count];
   nsCOMPtr<nsIAbCard> card;
   nsCOMPtr<nsIAbManager> abManager = do_GetService(NS_ABMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIAbOSXDirectory> rootOSXDirectory;
@@ -588,17 +588,17 @@ nsAbOSXDirectory::GetReadOnly(bool *aRea
 static bool
 CheckRedundantCards(nsIAbManager *aManager, nsIAbDirectory *aDirectory,
                     nsIAbCard *aCard, NSMutableArray *aCardList)
 {
   nsresult rv;
   nsCOMPtr<nsIAbOSXCard> osxCard = do_QueryInterface(aCard, &rv);
   NS_ENSURE_SUCCESS(rv, false);
 
-  nsCAutoString uri;
+  nsAutoCString uri;
   rv = osxCard->GetURI(uri);
   NS_ENSURE_SUCCESS(rv, false);
   NSString *uid = [NSString stringWithUTF8String:(uri.get() + 21)];
   
   unsigned int i, count = [aCardList count];
   for (i = 0; i < count; ++i) {
     if ([[[aCardList objectAtIndex:i] uniqueId] isEqualToString:uid]) {
       [aCardList removeObjectAtIndex:i];
@@ -652,17 +652,17 @@ nsAbOSXDirectory::Update()
   
   ABAddressBook *addressBook = [ABAddressBook sharedAddressBook];
   // Due to the horrible way the address book code works wrt mailing lists
   // we have to use a different list depending on what we are. This pointer
   // holds a reference to that list.
   nsIMutableArray* cardList;
   NSArray *groups, *cards;
   if (m_IsMailList) {
-    ABGroup *group = (ABGroup*)[addressBook recordForUniqueId:[NSString stringWithUTF8String:nsCAutoString(Substring(mURINoQuery, 21)).get()]];
+    ABGroup *group = (ABGroup*)[addressBook recordForUniqueId:[NSString stringWithUTF8String:nsAutoCString(Substring(mURINoQuery, 21)).get()]];
     groups = nil;
     cards = [[group members] arrayByAddingObjectsFromArray:[group subgroups]];
 
     if (!m_AddressList)
     {
       m_AddressList = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
       NS_ENSURE_SUCCESS(rv, rv);
     }
@@ -708,17 +708,17 @@ nsAbOSXDirectory::Update()
   {
     rv = GetCard(card, getter_AddRefs(abCard), rootOSXDirectory);
     if (NS_FAILED(rv))
       rv = CreateCard(card, getter_AddRefs(abCard));
     NS_ENSURE_SUCCESS(rv, rv);
     AssertCard(abManager, abCard);
   }
   
-  card = (ABRecord*)[addressBook recordForUniqueId:[NSString stringWithUTF8String:nsCAutoString(Substring(mURINoQuery, 21)).get()]];
+  card = (ABRecord*)[addressBook recordForUniqueId:[NSString stringWithUTF8String:nsAutoCString(Substring(mURINoQuery, 21)).get()]];
   NSString * stringValue = [card valueForProperty:kABGroupNameProperty];
   if (![stringValue isEqualToString:WrapString(m_ListDirName)])
   {
     nsAutoString oldValue(m_ListDirName);
     AssignToString(stringValue, m_ListDirName);
     nsCOMPtr<nsISupports> supports = do_QueryInterface(static_cast<nsIAbDirectory *>(this), &rv);
     NS_ENSURE_SUCCESS(rv, rv);
     abManager->NotifyItemPropertyChanged(supports, "DirName",
@@ -737,17 +737,17 @@ nsAbOSXDirectory::Update()
       NS_ENSURE_SUCCESS(rv, rv);
 
       while (addressCount--)
       {
         directory = do_QueryElementAt(m_AddressList, addressCount, &rv);
         if (NS_FAILED(rv))
           continue;
 
-        nsCAutoString uri;
+        nsAutoCString uri;
         directory->GetURI(uri);
         uri.Cut(0, 21);
         NSString *uid = [NSString stringWithUTF8String:uri.get()];
         
         unsigned int j, arrayCount = [mutableArray count];
         for (j = 0; j < arrayCount; ++j) {
           if ([[[mutableArray objectAtIndex:j] uniqueId] isEqualToString:uid]) {
             [mutableArray removeObjectAtIndex:j];
@@ -829,17 +829,17 @@ nsAbOSXDirectory::AssertDirectory(nsIAbM
 
   return aManager->NotifyDirectoryItemAdded(this, aDirectory);
 }
 
 nsresult
 nsAbOSXDirectory::AssertCard(nsIAbManager *aManager,
                              nsIAbCard *aCard)
 {
-  nsCAutoString ourUuid;
+  nsAutoCString ourUuid;
   GetUuid(ourUuid);
   aCard->SetDirectoryId(ourUuid);
 
   nsresult rv = m_IsMailList ? m_AddressList->AppendElement(aCard, false) :
                                mCardList->AppendElement(aCard, false);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Get the card's URI and add it to our card store
@@ -918,17 +918,17 @@ nsAbOSXDirectory::GetChildCards(nsISimpl
 
     if (!mCardList)
       mCardList = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
     else
       mCardList->Clear();
     NS_ENSURE_SUCCESS(rv, rv);
   
     // The uuid for initializing cards
-    nsCAutoString ourUuid;
+    nsAutoCString ourUuid;
     GetUuid(ourUuid);
 
     // Fill the results array and update the card list
     unsigned int nbCards = [cards count];
   
     unsigned int i;
     nsCOMPtr<nsIAbCard> card;
     nsCOMPtr<nsIAbOSXDirectory> rootOSXDirectory;
@@ -1025,17 +1025,17 @@ nsAbOSXDirectory::GetCardFromProperty(co
   if (!list)
     return NS_OK;
 
   uint32_t length;
   nsresult rv = list->GetLength(&length);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIAbCard> card;
-  nsCAutoString cardValue;
+  nsAutoCString cardValue;
 
   for (uint32_t i = 0; i < length && !*aResult; ++i)
   {
     card = do_QueryElementAt(list, i, &rv);
     if (NS_SUCCEEDED(rv))
     {
       rv = card->GetPropertyAsAUTF8String(aProperty, cardValue);
       if (NS_SUCCEEDED(rv))
@@ -1074,17 +1074,17 @@ nsAbOSXDirectory::GetCardsFromProperty(c
     return NS_NewEmptyEnumerator(aResult);
 
   uint32_t length;
   nsresult rv = list->GetLength(&length);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMArray<nsIAbCard> resultArray;
   nsCOMPtr<nsIAbCard> card;
-  nsCAutoString cardValue;
+  nsAutoCString cardValue;
 
   for (uint32_t i = 0; i < length; ++i)
   {
     card = do_QueryElementAt(list, i, &rv);
     if (NS_SUCCEEDED(rv))
     {
       rv = card->GetPropertyAsAUTF8String(aProperty, cardValue);
       if (NS_SUCCEEDED(rv))
@@ -1200,17 +1200,17 @@ nsAbOSXDirectory::OnSearchFoundCard(nsIA
   }
 
   rv = m_AddressList->AppendElement(aCard, false);
   NS_ENSURE_SUCCESS(rv, rv);
   
   rv = mCardList->AppendElement(aCard, false);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString ourUuid;
+  nsAutoCString ourUuid;
   GetUuid(ourUuid);
   aCard->SetDirectoryId(ourUuid);
   
   return NS_OK;
 }
 
 nsresult
 nsAbOSXDirectory::FallbackSearch(nsIAbBooleanExpression *aExpression,
@@ -1286,39 +1286,39 @@ nsresult nsAbOSXDirectory::DeleteUid(con
 
   // First, we'll see if its in the group list as it is likely to be shorter.
 
   // See if this item is in our address list
   uint32_t addressCount;
   rv = m_AddressList->GetLength(&addressCount);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString uri(NS_ABOSXDIRECTORY_URI_PREFIX);
+  nsAutoCString uri(NS_ABOSXDIRECTORY_URI_PREFIX);
   uri.Append(aUid);
 
   // Iterate backwards in case we remove something
   while (addressCount--)
   {
     nsCOMPtr<nsIAbItem> abItem(do_QueryElementAt(m_AddressList,
                                                  addressCount, &rv));
     if (NS_FAILED(rv))
       continue;
 
     nsCOMPtr<nsIAbDirectory> directory(do_QueryInterface(abItem, &rv));
     if (NS_SUCCEEDED(rv))
     {
-      nsCAutoString dirUri;
+      nsAutoCString dirUri;
       directory->GetURI(dirUri);
       if (uri.Equals(dirUri))
         return UnassertDirectory(abManager, directory);
     } else {
       nsCOMPtr<nsIAbOSXCard> osxCard(do_QueryInterface(abItem, &rv));
       if (NS_SUCCEEDED(rv))
       {
-        nsCAutoString cardUri;
+        nsAutoCString cardUri;
         osxCard->GetURI(cardUri);
         if (uri.Equals(cardUri))
         {
           nsCOMPtr<nsIAbCard> card(do_QueryInterface(osxCard, &rv));
           if (NS_SUCCEEDED(rv))
             return UnassertCard(abManager, card, m_AddressList);
         }
       }
@@ -1336,17 +1336,17 @@ nsresult nsAbOSXDirectory::DeleteUid(con
   NS_ENSURE_SUCCESS(rv, rv);
 
   while (addressCount--)
   {
     nsCOMPtr<nsIAbOSXCard> osxCard(do_QueryElementAt(mCardList, addressCount, &rv));
     if (NS_FAILED(rv))
       continue;
 
-    nsCAutoString cardUri;
+    nsAutoCString cardUri;
     osxCard->GetURI(cardUri);
 
     if (uri.Equals(cardUri)) {
       nsCOMPtr<nsIAbCard> card(do_QueryInterface(osxCard, &rv));
       if (NS_SUCCEEDED(rv))
         return UnassertCard(abManager, card, mCardList);
     }
   }
--- a/mailnews/addrbook/src/nsAbOutlookDirFactory.cpp
+++ b/mailnews/addrbook/src/nsAbOutlookDirFactory.cpp
@@ -59,18 +59,18 @@ nsAbOutlookDirFactory::GetDirectories(co
   nsCOMPtr<nsIMutableArray> directories(do_CreateInstance(NS_ARRAY_CONTRACTID));
   NS_ENSURE_SUCCESS(rv, rv);
   if (!mapiAddBook->IsOK() || !mapiAddBook->GetFolders(folders)) {
     return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsIAbManager> abManager(do_GetService(NS_ABMANAGER_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
-  nsCAutoString entryId;
-  nsCAutoString uri;
+  nsAutoCString entryId;
+  nsAutoCString uri;
 
   for (ULONG i = 0; i < folders.mNbEntries; ++i) {
     folders.mEntries[i].ToString(entryId);
     buildAbWinUri(kOutlookDirectoryScheme, abType, uri);
     uri.Append(entryId);
 
 	nsCOMPtr<nsIAbDirectory> directory;
 	rv = abManager->GetDirectory(uri, getter_AddRefs(directory));
--- a/mailnews/addrbook/src/nsAbOutlookDirectory.cpp
+++ b/mailnews/addrbook/src/nsAbOutlookDirectory.cpp
@@ -55,18 +55,18 @@ NS_IMPL_ISUPPORTS_INHERITED3(nsAbOutlook
 NS_IMETHODIMP nsAbOutlookDirectory::Init(const char *aUri)
 {
   mQueryThreads.Init();
   mCardList.Init();
 
   nsresult rv = nsAbDirProperty::Init(aUri);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString entry;
-  nsCAutoString stub;
+  nsAutoCString entry;
+  nsAutoCString stub;
 
   mAbWinType = getAbWinType(kOutlookDirectoryScheme, mURINoQuery.get(), stub, entry);
   if (mAbWinType == nsAbWinType_Unknown) {
     PRINTF(("Huge problem URI=%s.\n", mURINoQuery));
     return NS_ERROR_INVALID_ARG;
   }
   nsAbWinHelperGuard mapiAddBook (mAbWinType);
   nsString prefix;
@@ -251,29 +251,29 @@ static nsresult ExtractCardEntry(nsIAbCa
   aEntry.Truncate();
 
   nsCString uri;
   aCard->GetPropertyAsAUTF8String("OutlookEntryURI", uri);
 
   // If we don't have a URI, uri will be empty. getAbWinType doesn't set
   // aEntry to anything if uri is empty, so it will be truncated, allowing us
   // to accept cards not initialized by us.
-  nsCAutoString stub;
+  nsAutoCString stub;
   getAbWinType(kOutlookCardScheme, uri.get(), stub, aEntry);
   return NS_OK;
 }
 
 static nsresult ExtractDirectoryEntry(nsIAbDirectory *aDirectory, nsCString& aEntry)
 {
   aEntry.Truncate();
   nsCString uri;
   nsresult rv = aDirectory->GetURI(uri);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString stub;
+  nsAutoCString stub;
   nsAbWinType objType = getAbWinType(kOutlookDirectoryScheme, uri.get(), stub, aEntry);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsAbOutlookDirectory::DeleteCards(nsIArray *aCardList)
 {
     if (mIsQueryURI) { return NS_ERROR_NOT_IMPLEMENTED ; }
@@ -282,17 +282,17 @@ NS_IMETHODIMP nsAbOutlookDirectory::Dele
     nsresult retCode = NS_OK ;
     nsAbWinHelperGuard mapiAddBook (mAbWinType) ;
 
     if (!mapiAddBook->IsOK()) { return NS_ERROR_FAILURE ; }
     
     retCode = aCardList->GetLength(&nbCards);
     NS_ENSURE_SUCCESS(retCode, retCode) ;
     uint32_t i = 0 ;
-    nsCAutoString entryString ;
+    nsAutoCString entryString ;
     nsMapiEntry cardEntry ;
 
     for (i = 0 ; i < nbCards ; ++ i) {
         nsCOMPtr<nsIAbCard> card(do_QueryElementAt(aCardList, i, &retCode));
         NS_ENSURE_SUCCESS(retCode, retCode);
 
         retCode = ExtractCardEntry(card, entryString) ;
         if (NS_SUCCEEDED(retCode) && !entryString.IsEmpty()) {
@@ -322,17 +322,17 @@ NS_IMETHODIMP nsAbOutlookDirectory::Dele
 }
 
 NS_IMETHODIMP nsAbOutlookDirectory::DeleteDirectory(nsIAbDirectory *aDirectory)
 {
     if (mIsQueryURI) { return NS_ERROR_NOT_IMPLEMENTED ; }
     if (!aDirectory) { return NS_ERROR_NULL_POINTER ; }
     nsresult retCode = NS_OK ;
     nsAbWinHelperGuard mapiAddBook (mAbWinType) ;
-    nsCAutoString entryString ;
+    nsAutoCString entryString ;
 
     if (!mapiAddBook->IsOK()) { return NS_ERROR_FAILURE ; }
     retCode = ExtractDirectoryEntry(aDirectory, entryString) ;
     if (NS_SUCCEEDED(retCode) && !entryString.IsEmpty()) {
         nsMapiEntry directoryEntry ;
 
         directoryEntry.Assign(entryString) ;
         if (!mapiAddBook->DeleteEntry(*mMapiData, directoryEntry)) {
@@ -397,17 +397,17 @@ NS_IMETHODIMP nsAbOutlookDirectory::AddM
 {
   if (mIsQueryURI)
     return NS_ERROR_NOT_IMPLEMENTED;
   NS_ENSURE_ARG_POINTER(aMailList);
   NS_ENSURE_ARG_POINTER(addedList);
   if (m_IsMailList)
     return NS_OK;
   nsAbWinHelperGuard mapiAddBook (mAbWinType);
-  nsCAutoString entryString;
+  nsAutoCString entryString;
   nsMapiEntry newEntry;
   bool didCopy = false;
 
   if (!mapiAddBook->IsOK())
     return NS_ERROR_FAILURE;
   nsresult rv = ExtractDirectoryEntry(aMailList, entryString);
   if (NS_SUCCEEDED(rv) && !entryString.IsEmpty())
   {
@@ -420,17 +420,17 @@ NS_IMETHODIMP nsAbOutlookDirectory::AddM
   {
     if (!mapiAddBook->CreateDistList(*mMapiData, newEntry))
         return NS_ERROR_FAILURE;
   }
   else {
     didCopy = true;
   }
   newEntry.ToString(entryString);
-  nsCAutoString uri;
+  nsAutoCString uri;
 
   buildAbWinUri(kOutlookDirectoryScheme, mAbWinType, uri);
   uri.Append(entryString);
 
   nsCOMPtr<nsIAbManager> abManager(do_GetService(NS_ABMANAGER_CONTRACTID,
                                    &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -546,17 +546,17 @@ static nsresult BuildRestriction(nsIAbBo
 {
     if (!aCondition) { return NS_ERROR_NULL_POINTER ; }
     aSkipItem = false ;
     nsAbBooleanConditionType conditionType = 0 ;
     nsresult retCode = NS_OK ;
     nsCString name;
     nsString value;
     ULONG propertyTag = 0 ;
-    nsCAutoString valueAscii ;
+    nsAutoCString valueAscii ;
     
     retCode = aCondition->GetCondition(&conditionType) ;
     NS_ENSURE_SUCCESS(retCode, retCode) ;
     retCode = aCondition->GetName(getter_Copies(name)) ;
     NS_ENSURE_SUCCESS(retCode, retCode) ;
     retCode = aCondition->GetValue(getter_Copies(value)) ;
     NS_ENSURE_SUCCESS(retCode, retCode) ;
     LossyCopyUTF16toASCII(value, valueAscii);
@@ -1021,21 +1021,21 @@ nsresult nsAbOutlookDirectory::GetChildC
   nsMapiEntryArray cardEntries;
   LPSRestriction restriction = (LPSRestriction) aRestriction;
 
   if (!mapiAddBook->GetCards(*mMapiData, restriction, cardEntries)) {
     PRINTF(("Cannot get cards.\n"));
     return NS_ERROR_FAILURE;
   }
 
-  nsCAutoString ourUuid;
+  nsAutoCString ourUuid;
   GetUuid(ourUuid);
 
-  nsCAutoString entryId;
-  nsCAutoString uriName;
+  nsAutoCString entryId;
+  nsAutoCString uriName;
   nsCOMPtr<nsIAbCard> childCard;
   nsresult rv;
 
   for (ULONG card = 0; card < cardEntries.mNbEntries; ++card) {
     cardEntries.mEntries[card].ToString(entryId);
     buildAbWinUri(kOutlookCardScheme, mAbWinType, uriName);
     uriName.Append(entryId);
 
@@ -1061,18 +1061,18 @@ nsresult nsAbOutlookDirectory::GetChildN
       return NS_ERROR_FAILURE;
 
   if (!mapiAddBook->GetNodes(*mMapiData, nodeEntries))
   {
     PRINTF(("Cannot get nodes.\n"));
     return NS_ERROR_FAILURE;
   }
 
-  nsCAutoString entryId;
-  nsCAutoString uriName;
+  nsAutoCString entryId;
+  nsAutoCString uriName;
   nsresult rv = NS_OK;
 
   nsCOMPtr<nsIAbManager> abManager(do_GetService(NS_ABMANAGER_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   for (ULONG node = 0; node < nodeEntries.mNbEntries; ++node)
   {
     nodeEntries.mEntries[node].ToString(entryId);
@@ -1173,17 +1173,17 @@ nsresult nsAbOutlookDirectory::UpdateAdd
 
 nsresult nsAbOutlookDirectory::CreateCard(nsIAbCard *aData, nsIAbCard **aNewCard) 
 {
     if (!aData || !aNewCard) { return NS_ERROR_NULL_POINTER ; }
     *aNewCard = nullptr ;
     nsresult retCode = NS_OK ;
     nsAbWinHelperGuard mapiAddBook (mAbWinType) ;
     nsMapiEntry newEntry ;
-    nsCAutoString entryString ;
+    nsAutoCString entryString ;
     bool didCopy = false ;
 
     if (!mapiAddBook->IsOK()) { return NS_ERROR_FAILURE ; }
     // If we get an nsIAbCard that maps onto an Outlook card uri
     // we simply copy the contents of the Outlook card.
     retCode = ExtractCardEntry(aData, entryString) ;
     if (NS_SUCCEEDED(retCode) && !entryString.IsEmpty()) {
         nsMapiEntry sourceEntry ;
@@ -1227,26 +1227,26 @@ nsresult nsAbOutlookDirectory::CreateCar
         }
         // If we're on a real address book folder, we can directly create an
         // empty card.
         else if (!mapiAddBook->CreateEntry(*mMapiData, newEntry)) {
             return NS_ERROR_FAILURE ;
         }
     }
     newEntry.ToString(entryString) ;
-    nsCAutoString uri ;
+    nsAutoCString uri ;
 
     buildAbWinUri(kOutlookCardScheme, mAbWinType, uri) ;
     uri.Append(entryString) ;
     
     nsCOMPtr<nsIAbCard> newCard;
     retCode = OutlookCardForURI(uri, getter_AddRefs(newCard));
     NS_ENSURE_SUCCESS(retCode, retCode);
 
-    nsCAutoString ourUuid;
+    nsAutoCString ourUuid;
     GetUuid(ourUuid);
     newCard->SetDirectoryId(ourUuid);
 
     if (!didCopy) {
         retCode = newCard->Copy(aData) ;
         NS_ENSURE_SUCCESS(retCode, retCode) ;
         retCode = ModifyCard(newCard) ;
         NS_ENSURE_SUCCESS(retCode, retCode) ;
@@ -1437,18 +1437,18 @@ static void splitString(nsString& aSourc
     aSource.SetLength(offset);
   }
 }
 
 nsresult OutlookCardForURI(const nsACString &aUri, nsIAbCard **newCard)
 {
   NS_ENSURE_ARG_POINTER(newCard);
 
-  nsCAutoString entry;
-  nsCAutoString stub;
+  nsAutoCString entry;
+  nsAutoCString stub;
   uint32_t abWinType = getAbWinType(kOutlookCardScheme,
     PromiseFlatCString(aUri).get(), stub, entry);
   if (abWinType == nsAbWinType_Unknown)
   {
     PRINTF(("Huge problem URI=%s.\n", PromiseFlatCString(aUri).get()));
     return NS_ERROR_INVALID_ARG;
   }
 
@@ -1498,17 +1498,17 @@ nsresult OutlookCardForURI(const nsACStr
   }
 
   ULONG cardType = 0;
   if (mapiAddBook->GetPropertyLong(mapiData, PR_OBJECT_TYPE, cardType))
   {
     card->SetIsMailList(cardType == MAPI_DISTLIST);
     if (cardType == MAPI_DISTLIST)
     {
-      nsCAutoString normalChars;
+      nsAutoCString normalChars;
       buildAbWinUri(kOutlookDirectoryScheme, abWinType, normalChars);
       normalChars.Append(entry);
       card->SetMailListURI(normalChars.get());
     }
   }
 
   nsAutoString unichar;
   nsAutoString unicharBis;
--- a/mailnews/addrbook/src/nsAbQueryStringToExpression.cpp
+++ b/mailnews/addrbook/src/nsAbQueryStringToExpression.cpp
@@ -16,17 +16,17 @@
 #include "nsIMutableArray.h"
 
 nsresult nsAbQueryStringToExpression::Convert (
     const nsACString &aQueryString,
     nsIAbBooleanExpression** expression)
 {
     nsresult rv;
 
-    nsCAutoString q(aQueryString);
+    nsAutoCString q(aQueryString);
     q.StripWhitespace();
     const char *queryChars = q.get();
 
     nsCOMPtr<nsISupports> s;
     rv = ParseExpression(&queryChars, getter_AddRefs(s));
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Case: Not end of string
--- a/mailnews/addrbook/src/nsAbWinHelper.cpp
+++ b/mailnews/addrbook/src/nsAbWinHelper.cpp
@@ -508,17 +508,17 @@ BOOL nsAbWinHelper::DeleteEntry(const ns
     }
     return TRUE ;
 }
 
 BOOL nsAbWinHelper::SetPropertyUString(const nsMapiEntry& aObject, ULONG aPropertyTag, 
                                        const PRUnichar *aValue)
 {
     SPropValue value ;
-    nsCAutoString alternativeValue ;
+    nsAutoCString alternativeValue ;
 
     value.ulPropTag = aPropertyTag ;
     if (PROP_TYPE(aPropertyTag) == PT_UNICODE) {
         value.Value.lpszW = const_cast<WCHAR *>(aValue) ;
     }
     else if (PROP_TYPE(aPropertyTag) == PT_STRING8) {
         alternativeValue = NS_LossyConvertUTF16toASCII(aValue);
         value.Value.lpszA = const_cast<char *>(alternativeValue.get()) ;
@@ -534,17 +534,17 @@ BOOL nsAbWinHelper::SetPropertiesUString
                                          ULONG aNbProperties, nsString *aValues) 
 {
     LPSPropValue values = new SPropValue [aNbProperties] ;
     if (!values)
         return FALSE ;
 
     ULONG i = 0 ;
     ULONG currentValue = 0 ;
-    nsCAutoString alternativeValue ;
+    nsAutoCString alternativeValue ;
     BOOL retCode = TRUE ;
 
     for (i = 0 ; i < aNbProperties ; ++ i) {
         values [currentValue].ulPropTag = aPropertiesTag [i] ;
         if (PROP_TYPE(aPropertiesTag [i]) == PT_UNICODE) {
             values [currentValue ++].Value.lpszW = const_cast<WCHAR *>(aValues [i].get()) ;
         }
         else if (PROP_TYPE(aPropertiesTag [i]) == PT_STRING8) {
--- a/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp
+++ b/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp
@@ -110,17 +110,17 @@ nsAddbookProtocolHandler::NewChannel(nsI
   NS_ENSURE_SUCCESS(rv,rv);
   
   rv = addbookUrl->GetAddbookOperation(&mAddbookOperation);
   NS_ENSURE_SUCCESS(rv,rv);
 
   if (mAddbookOperation == nsIAddbookUrlOperation::InvalidUrl) {
     nsAutoString errorString;
     errorString.AssignLiteral("Unsupported format/operation requested for ");
-    nsCAutoString spec;
+    nsAutoCString spec;
     rv = aURI->GetSpec(spec);
     NS_ENSURE_SUCCESS(rv,rv);
 
      errorString.Append(NS_ConvertUTF8toUTF16(spec));
     rv = GenerateXMLOutputChannel(errorString, addbookUrl, aURI, _retval);
     NS_ENSURE_SUCCESS(rv,rv);
     return NS_OK;
   }
@@ -142,34 +142,34 @@ nsAddbookProtocolHandler::NewChannel(nsI
       return NS_NewInputStreamChannel(_retval, aURI, pipeIn,
           NS_LITERAL_CSTRING("application/x-addvcard"));
   }
 
   nsString output;
   rv = GeneratePrintOutput(addbookUrl, output);
   if (NS_FAILED(rv)) {
     output.AssignLiteral("failed to print. url=");
-    nsCAutoString spec;
+    nsAutoCString spec;
     rv = aURI->GetSpec(spec);
     NS_ENSURE_SUCCESS(rv,rv);
     output.Append(NS_ConvertUTF8toUTF16(spec));
   }
  
   rv = GenerateXMLOutputChannel(output, addbookUrl, aURI, _retval);
   NS_ENSURE_SUCCESS(rv,rv);
   return NS_OK;
 }
 
 nsresult    
 nsAddbookProtocolHandler::GeneratePrintOutput(nsIAddbookUrl *addbookUrl, 
                                               nsString &aOutput)
 {
   NS_ENSURE_ARG_POINTER(addbookUrl);
 
-  nsCAutoString uri;
+  nsAutoCString uri;
   nsresult rv = addbookUrl->GetPath(uri);
   NS_ENSURE_SUCCESS(rv,rv);
 
   /* turn
    "//moz-abmdbdirectory/abook.mab?action=print"
    into "moz-abmdbdirectory://abook.mab"
   */
 
--- a/mailnews/addrbook/src/nsAddbookUrl.cpp
+++ b/mailnews/addrbook/src/nsAddbookUrl.cpp
@@ -32,17 +32,17 @@ nsAddbookUrl::SetSpec(const nsACString &
 {
   nsresult rv = m_baseURL->SetSpec(aSpec);
   NS_ENSURE_SUCCESS(rv, rv);
   return ParseUrl();
 }
 
 nsresult nsAddbookUrl::ParseUrl()
 {
-  nsCAutoString pathStr;
+  nsAutoCString pathStr;
 
   nsresult rv = m_baseURL->GetPath(pathStr);
   NS_ENSURE_SUCCESS(rv,rv);
 
   if (strstr(pathStr.get(), "?action=print"))
     mOperationType = nsIAddbookUrlOperation::PrintAddressBook;
   else if (strstr(pathStr.get(), "?action=add"))
     mOperationType = nsIAddbookUrlOperation::AddVCard;
--- a/mailnews/addrbook/src/nsAddrDatabase.cpp
+++ b/mailnews/addrbook/src/nsAddrDatabase.cpp
@@ -382,31 +382,31 @@ NS_IMETHODIMP nsAddrDatabase::Open
     rv = aMabFile->Clone(getter_AddRefs(actualBackupMabFile));
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Now we try and generate a new name for the corrupt mab
     // file using the dummy backup mab file
 
     // First append .bak - we have to do this the long way as
     // AppendNative is to the path, not the LeafName.
-    nsCAutoString dummyBackupMabFileName;
+    nsAutoCString dummyBackupMabFileName;
     rv = dummyBackupMabFile->GetNativeLeafName(dummyBackupMabFileName);
     NS_ENSURE_SUCCESS(rv, rv);
 
     dummyBackupMabFileName.Append(NS_LITERAL_CSTRING(".bak"));
 
     rv = dummyBackupMabFile->SetNativeLeafName(dummyBackupMabFileName);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Now see if we can create it unique
     rv = dummyBackupMabFile->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 0600);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Now get the new name
-    nsCAutoString backupMabFileName;
+    nsAutoCString backupMabFileName;
     rv = dummyBackupMabFile->GetNativeLeafName(backupMabFileName);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // And the parent directory
     nsCOMPtr<nsIFile> parentDir;
     rv = dummyBackupMabFile->GetParent(getter_AddRefs(parentDir));
     NS_ENSURE_SUCCESS(rv, rv);
 
@@ -510,17 +510,17 @@ NS_IMETHODIMP nsAddrDatabase::OpenMDB(ns
   nsCOMPtr<nsIMdbFactory> mdbFactory;
   GetMDBFactory(getter_AddRefs(mdbFactory));
   if (mdbFactory)
   {
     ret = mdbFactory->MakeEnv(NULL, &m_mdbEnv);
     if (NS_SUCCEEDED(ret))
     {
       nsIMdbThumb *thumb = nullptr;
-      nsCAutoString filePath;
+      nsAutoCString filePath;
 
       ret = dbName->GetNativePath(filePath);
       NS_ENSURE_SUCCESS(ret, ret);
 
       nsIMdbHeap* dbHeap = 0;
       mdb_bool dbFrozen = mdbBool_kFalse; // not readonly, we want modifiable
 
       if (m_mdbEnv)
@@ -1192,17 +1192,17 @@ nsresult nsAddrDatabase::AddAttributeCol
       nsCOMPtr<nsIProperty> prop = do_QueryInterface(next);
       nsAutoString name;
       prop->GetName(name);
 
       nsCOMPtr<nsIVariant> variant;
       prop->GetValue(getter_AddRefs(variant));
       
       // We can't get as a char * because that messes up UTF8 stuff
-      nsCAutoString value;
+      nsAutoCString value;
       variant->GetAsAUTF8String(value);
 
       mdb_token token;
       rv = m_mdbStore->StringToToken(m_mdbEnv, NS_ConvertUTF16toUTF8(name).get(), &token);
       NS_ENSURE_SUCCESS(rv, rv);
  
       rv = AddCharStringColumn(cardRow, token, value.get());
       NS_ENSURE_SUCCESS(rv, rv);
@@ -1227,17 +1227,17 @@ NS_IMETHODIMP nsAddrDatabase::CreateNewC
 
   // Per the UUID requirements, we want to try to reuse the local id if at all
   // possible. nsACString::ToInteger probably won't fail if the local id looks
   // like "23bozo" (returning 23 instead), but it's okay since we aren't going
   // to overwrite anything with 23 if it already exists and the id for the row
   // doesn't matter otherwise.
   nsresult rv;
 
-  nsCAutoString id;
+  nsAutoCString id;
   aNewCard->GetLocalId(id);
 
   mdbOid rowId;
   rowId.mOid_Scope = m_CardRowScopeToken;
   rowId.mOid_Id = id.ToInteger(&rv);
   if (NS_SUCCEEDED(rv))
   {
     // Mork is being very naughty here. If the table does not have the oid, we
@@ -2124,18 +2124,18 @@ NS_IMETHODIMP nsAddrDatabase::AddCardRow
 
 NS_IMETHODIMP nsAddrDatabase::AddLdifListMember(nsIMdbRow* listRow, const char* value)
 {
   if (!m_mdbStore || !listRow || !value || !m_mdbEnv)
     return NS_ERROR_NULL_POINTER;
 
   uint32_t total = GetListAddressTotal(listRow);
   //add member
-  nsCAutoString valueString(value);
-  nsCAutoString email;
+  nsAutoCString valueString(value);
+  nsAutoCString email;
   int32_t emailPos = valueString.Find("mail=");
   emailPos += strlen("mail=");
   email = Substring(valueString, emailPos);
   nsCOMPtr <nsIMdbRow> cardRow;
   // Please DO NOT change the 3rd param of GetRowFromAttribute() call to
   // true (ie, case insensitive) without reading bugs #128535 and #121478.
   nsresult rv = GetRowFromAttribute(kPriEmailProperty, email, false /* retain case */,
                                     getter_AddRefs(cardRow), nullptr);
@@ -2920,17 +2920,17 @@ nsresult nsAddrDatabase::CreateCard(nsIM
     {
         nsCOMPtr<nsIAbCard> personCard;
       personCard = do_CreateInstance(NS_ABMDBCARD_CONTRACTID, &rv);
       NS_ENSURE_SUCCESS(rv,rv);
 
         InitCardFromRow(personCard, cardRow);
         personCard->SetPropertyAsUint32(kRowIDProperty, rowID);
 
-        nsCAutoString id;
+        nsAutoCString id;
         id.AppendInt(rowID);
         personCard->SetLocalId(id);
 
         nsCOMPtr<nsIAbDirectory> abDir(do_QueryReferent(m_dbDirectory));
         if (abDir)
          abDir->GetUuid(id);
 
         personCard->SetDirectoryId(id);
@@ -2978,17 +2978,17 @@ nsresult nsAddrDatabase::CreateABListCar
         if (personCard)
         {
             GetListCardFromDB(personCard, listRow);
 
             personCard->SetPropertyAsUint32(kRowIDProperty, rowID);
             personCard->SetIsMailList(true);
             personCard->SetMailListURI(listURI);
 
-            nsCAutoString id;
+            nsAutoCString id;
             id.AppendInt(rowID);
             personCard->SetLocalId(id);
 
             nsCOMPtr<nsIAbDirectory> abDir(do_QueryReferent(m_dbDirectory));
             if (abDir)
              abDir->GetUuid(id);
             personCard->SetDirectoryId(id);
         }
--- a/mailnews/addrbook/src/nsDirPrefs.cpp
+++ b/mailnews/addrbook/src/nsDirPrefs.cpp
@@ -764,17 +764,17 @@ static nsresult dir_GetChildList(const n
 static char *DIR_GetStringPref(const char *prefRoot, const char *prefLeaf, const char *defaultValue)
 {
     nsresult rv;
     nsCOMPtr<nsIPrefBranch> pPref(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
     if (NS_FAILED(rv))
         return nullptr;
 
     nsCString value;
-    nsCAutoString prefLocation(prefRoot);
+    nsAutoCString prefLocation(prefRoot);
 
     prefLocation.Append('.');
     prefLocation.Append(prefLeaf);
 
     if (NS_SUCCEEDED(pPref->GetCharPref(prefLocation.get(), getter_Copies(value))))
     {
         /* unfortunately, there may be some prefs out there which look like this */
         if (value.EqualsLiteral("(null)")) 
@@ -807,17 +807,17 @@ static char *DIR_GetStringPref(const cha
 static char *DIR_GetDescription(const char *prefRoot)
 {
   nsresult rv;
   nsCOMPtr<nsIPrefBranch> pPref(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
 
   if (NS_FAILED(rv))
     return nullptr;
 
-  nsCAutoString prefLocation(prefRoot);
+  nsAutoCString prefLocation(prefRoot);
   prefLocation.AppendLiteral(".description");
 
   nsString wvalue;
   nsCOMPtr<nsIPrefLocalizedString> locStr;
 
   rv = pPref->GetComplexValue(prefLocation.get(), NS_GET_IID(nsIPrefLocalizedString), getter_AddRefs(locStr));
   if (NS_SUCCEEDED(rv))
     rv = locStr->ToString(getter_Copies(wvalue));
@@ -853,17 +853,17 @@ static int32_t DIR_GetIntPref(const char
 {
   nsresult rv;
   nsCOMPtr<nsIPrefBranch> pPref(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
 
   if (NS_FAILED(rv))
     return defaultValue;
 
   int32_t value;
-  nsCAutoString prefLocation(prefRoot);
+  nsAutoCString prefLocation(prefRoot);
 
   prefLocation.Append('.');
   prefLocation.Append(prefLeaf);
 
   if (NS_FAILED(pPref->GetIntPref(prefLocation.get(), &value)))
     value = defaultValue;
 
   return value;
@@ -1225,17 +1225,17 @@ static nsresult DIR_GetServerPreferences
 static void DIR_SetStringPref(const char *prefRoot, const char *prefLeaf, const char *value, const char *defaultValue)
 {
   nsresult rv;
   nsCOMPtr<nsIPrefBranch> pPref(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv)); 
   if (NS_FAILED(rv)) 
     return;
 
   nsCString defaultPref;
-  nsCAutoString prefLocation(prefRoot);
+  nsAutoCString prefLocation(prefRoot);
 
   prefLocation.Append('.');
   prefLocation.Append(prefLeaf);
 
   if (NS_SUCCEEDED(pPref->GetCharPref(prefLocation.get(), getter_Copies(defaultPref))))
   {
     /* If there's a default pref, just set ours in and let libpref worry 
      * about potential defaults in all.js
@@ -1272,17 +1272,17 @@ static void DIR_SetLocalizedStringPref
 (const char *prefRoot, const char *prefLeaf, const char *value)
 {
   nsresult rv;
   nsCOMPtr<nsIPrefService> prefSvc(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
 
   if (NS_FAILED(rv))
     return;
 
-  nsCAutoString prefLocation(prefRoot);
+  nsAutoCString prefLocation(prefRoot);
   prefLocation.Append('.');
 
   nsCOMPtr<nsIPrefBranch> prefBranch;
   rv = prefSvc->GetBranch(prefLocation.get(), getter_AddRefs(prefBranch));
   if (NS_FAILED(rv))
     return;
 
   nsString wvalue;
@@ -1356,17 +1356,17 @@ static void DIR_SetLocalizedStringPref
 static void DIR_SetIntPref(const char *prefRoot, const char *prefLeaf, int32_t value, int32_t defaultValue)
 {
   nsresult rv;
   nsCOMPtr<nsIPrefBranch> pPref(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv)); 
   if (NS_FAILED(rv)) 
     return;
 
   int32_t defaultPref;
-  nsCAutoString prefLocation(prefRoot);
+  nsAutoCString prefLocation(prefRoot);
 
   prefLocation.Append('.');
   prefLocation.Append(prefLeaf);
 
   if (NS_SUCCEEDED(pPref->GetIntPref(prefLocation.get(), &defaultPref)))
   {
     /* solve the problem where reordering user prefs must override default prefs */
     rv = pPref->SetIntPref(prefLocation.get(), value);
--- a/mailnews/addrbook/src/nsLDAPAutoCompleteSession.cpp
+++ b/mailnews/addrbook/src/nsLDAPAutoCompleteSession.cpp
@@ -584,17 +584,17 @@ nsLDAPAutoCompleteSession::DoTask()
             FinishAutoCompleteLookup(nsIAutoCompleteStatus::failureItems, rv, 
                                      BOUND);
             return NS_ERROR_UNEXPECTED;
         }
     }
 
     // Get the search filter associated with the directory server url;
     // it will be ANDed with the rest of the search filter that we're using.
-    nsCAutoString urlFilter;
+    nsAutoCString urlFilter;
     rv = mDirectoryUrl->GetFilter(urlFilter);
     if ( NS_FAILED(rv) ){
         FinishAutoCompleteLookup(nsIAutoCompleteStatus::failureItems, rv,
                                  BOUND);
         return NS_ERROR_UNEXPECTED;
     }
 
     // Get the LDAP service, since createFilter is called through it.
@@ -605,17 +605,17 @@ nsLDAPAutoCompleteSession::DoTask()
                  "get @mozilla.org/network/ldap-service;1");
         FinishAutoCompleteLookup(nsIAutoCompleteStatus::failureItems, rv,
                                  BOUND);
         return NS_ERROR_FAILURE;
     }
 
     // If urlFilter is unset (or set to the default "objectclass=*"), there's
     // no need to AND in an empty search term, so leave prefix and suffix empty.
-    nsCAutoString prefix, suffix;
+    nsAutoCString prefix, suffix;
     if (urlFilter.Length() && !urlFilter.EqualsLiteral("(objectclass=*)")) {
 
         // If urlFilter isn't parenthesized, we need to add in parens so that
         // the filter works as a term to &
         if (urlFilter[0] != '(') {
             prefix.AssignLiteral("(&(");
             prefix.Append(urlFilter);
             prefix.AppendLiteral(")");
@@ -625,17 +625,17 @@ nsLDAPAutoCompleteSession::DoTask()
         }
         
         suffix = ')';
     }
 
     // Generate an LDAP search filter from mFilterTemplate. If it's unset,
     // use the default.
 #define MAX_AUTOCOMPLETE_FILTER_SIZE 1024
-    nsCAutoString searchFilter;
+    nsAutoCString searchFilter;
     rv = ldapSvc->CreateFilter(MAX_AUTOCOMPLETE_FILTER_SIZE,
                                mFilterTemplate,
                                prefix, suffix, EmptyCString(), 
                                NS_ConvertUTF16toUTF8(mSearchString),
                                searchFilter);
     if (NS_FAILED(rv)) {
         switch(rv) {
 
@@ -674,17 +674,17 @@ nsLDAPAutoCompleteSession::DoTask()
     if (NS_FAILED(rv)) {
         FinishAutoCompleteLookup(nsIAutoCompleteStatus::failed, rv, BOUND);
     }
 
     // Nothing returned yet!
     mEntriesReturned = 0;
     
     // Get the base dn to search
-    nsCAutoString dn;
+    nsAutoCString dn;
     rv = mDirectoryUrl->GetDn(dn);
     if ( NS_FAILED(rv) ){
         FinishAutoCompleteLookup(nsIAutoCompleteStatus::failureItems, rv,
                                  BOUND);
         return NS_ERROR_UNEXPECTED;
     }
 
     // And the scope
--- a/mailnews/addrbook/src/nsVCardObj.cpp
+++ b/mailnews/addrbook/src/nsVCardObj.cpp
@@ -1123,17 +1123,17 @@ static void writeAttrValue(OFile *fp, VO
       appendcOFile(fp,' ');
   }
   writeValue(fp,o,0);
   }
 }
 
 static void writeGroup(OFile *fp, VObject *o)
 {
-  nsCAutoString buf(NAME_OF(o));
+  nsAutoCString buf(NAME_OF(o));
 
   while ((o=isAPropertyOf(o,VCGroupingProp)) != 0) {
     buf.Insert(NS_LITERAL_CSTRING("."), 0);
     buf.Insert(STRINGZ_VALUE_OF(o), 0);
   }
   appendsOFile(fp, buf.get());
 }
 
--- a/mailnews/base/search/src/nsMsgBodyHandler.cpp
+++ b/mailnews/base/search/src/nsMsgBodyHandler.cpp
@@ -87,17 +87,17 @@ nsMsgBodyHandler::~nsMsgBodyHandler()
 {
 }
 
 int32_t nsMsgBodyHandler::GetNextLine (nsCString &buf)
 {
   int32_t length = -1;          // length of incoming line or -1 eof
   int32_t outLength = -1;       // length of outgoing line or -1 eof
   bool eatThisLine = true;
-  nsCAutoString nextLine;
+  nsAutoCString nextLine;
 
   while (eatThisLine) {
     // first, handle the filtering case...this is easy....
     if (m_Filtering)
       length = GetNextFilterLine(nextLine);
     else
     {
       // 3 cases: Offline IMAP, POP, or we are dealing with a news message....
--- a/mailnews/base/search/src/nsMsgFilter.cpp
+++ b/mailnews/base/search/src/nsMsgFilter.cpp
@@ -650,17 +650,17 @@ nsresult nsMsgFilter::ConvertMoveOrCopyT
     nsCOMPtr <nsIMsgFolder> rootFolder;
     nsCString folderUri;
 
     m_filterList->GetFolder(getter_AddRefs(rootFolder));
     // if relative path starts with kImap, this is a move to folder on the same server
     if (moveValue.Find(kImapPrefix) == 0)
     {
       int32_t prefixLen = PL_strlen(kImapPrefix);
-      nsCAutoString originalServerPath(Substring(moveValue, prefixLen));
+      nsAutoCString originalServerPath(Substring(moveValue, prefixLen));
       if (filterVersion == k45Version)
       {
         nsAutoString unicodeStr;
         nsresult rv = nsMsgI18NConvertToUnicode(nsMsgI18NFileSystemCharset(),
                                                 originalServerPath,
                                                 unicodeStr);
         NS_ENSURE_SUCCESS(rv, rv);
 
@@ -769,17 +769,17 @@ nsMsgFilter::SaveToTextFile(nsIOutputStr
   return err;
 }
 
 nsresult nsMsgFilter::SaveRule(nsIOutputStream *aStream)
 {
   nsresult err = NS_OK;
   nsCOMPtr<nsIMsgFilterList> filterList;
   GetFilterList(getter_AddRefs(filterList));
-  nsCAutoString  actionFilingStr;
+  nsAutoCString  actionFilingStr;
 
   uint32_t numActions;
   err = m_actionList->Count(&numActions);
   NS_ENSURE_SUCCESS(err, err);
 
   for (uint32_t index =0; index < numActions; index++)
   {
     nsCOMPtr<nsIMsgRuleAction> action;
@@ -804,17 +804,17 @@ nsresult nsMsgFilter::SaveRule(nsIOutput
         action->GetTargetFolderUri(imapTargetString);
         err = filterList->WriteStrAttr(nsIMsgFilterList::attribActionValue, imapTargetString.get(), aStream);
       }
       break;
       case nsMsgFilterAction::ChangePriority:
       {
         nsMsgPriorityValue priorityValue;
         action->GetPriority(&priorityValue);
-        nsCAutoString priority;
+        nsAutoCString priority;
         NS_MsgGetUntranslatedPriorityName(priorityValue, priority);
         err = filterList->WriteStrAttr(
                 nsIMsgFilterList::attribActionValue, priority.get(), aStream);
       }
       break;
       case nsMsgFilterAction::Label:
       {
         nsMsgLabelValue label;
@@ -836,34 +836,34 @@ nsresult nsMsgFilter::SaveRule(nsIOutput
         nsCString strValue;
         action->GetStrValue(strValue);
         // strValue is e-mail address
         err = filterList->WriteStrAttr(nsIMsgFilterList::attribActionValue, strValue.get(), aStream);
       }
       break;
       case nsMsgFilterAction::Custom:
       {
-        nsCAutoString id;
+        nsAutoCString id;
         action->GetCustomId(id);
         err = filterList->WriteStrAttr(nsIMsgFilterList::attribCustomId, id.get(), aStream);
-        nsCAutoString strValue;
+        nsAutoCString strValue;
         action->GetStrValue(strValue);
         if (strValue.Length())
           err = filterList->WriteWstrAttr(nsIMsgFilterList::attribActionValue,
                                           NS_ConvertUTF8toUTF16(strValue).get(),
                                           aStream);
       }
       break;
 
       default:
         break;
     }
   }
   // and here the fun begins - file out term list...
-  nsCAutoString  condition;
+  nsAutoCString  condition;
   err = MsgTermListToString(m_termList, condition);
   if (NS_SUCCEEDED(err))
     err = filterList->WriteStrAttr(nsIMsgFilterList::attribCondition, condition.get(), aStream);
   return err;
 }
 
 // for each action, this table encodes the filterTypes that support the action.
 struct RuleActionsTableEntry
@@ -938,14 +938,14 @@ nsMsgFilter::GetVersion()
     int16_t version;
     m_filterList->GetVersion(&version);
     return version;
 }
 
 #ifdef DEBUG
 void nsMsgFilter::Dump()
 {
-  nsCAutoString s;
+  nsAutoCString s;
   LossyCopyUTF16toASCII(m_filterName, s);
   printf("filter %s type = %c desc = %s\n", s.get(), m_type + '0', m_description.get());
 }
 #endif
 
--- a/mailnews/base/search/src/nsMsgFilterList.cpp
+++ b/mailnews/base/search/src/nsMsgFilterList.cpp
@@ -445,17 +445,17 @@ const char *nsMsgFilterList::GetStringFo
     if (attrib == FilterFileAttribTable[tableIndex].attrib)
       return FilterFileAttribTable[tableIndex].attribName;
   }
   return nullptr;
 }
 
 nsresult nsMsgFilterList::LoadValue(nsCString &value, nsIInputStream *aStream)
 {
-  nsCAutoString  valueStr;
+  nsAutoCString  valueStr;
   char  curChar;
   value = "";
   curChar = SkipWhitespace(aStream);
   if (curChar != '"')
   {
     NS_ASSERTION(false, "expecting quote as start of value");
     return NS_MSG_FILTER_PARSE_ERROR;
   }
@@ -502,17 +502,17 @@ nsresult nsMsgFilterList::LoadTextFilter
   err = NS_NewBufferedInputStream(getter_AddRefs(bufStream), aStream, 10240);
   NS_ENSURE_SUCCESS(err, err);
 
   nsMsgFilterFileAttribValue attrib;
   nsCOMPtr<nsIMsgRuleAction> currentFilterAction;
   // We'd really like to move lot's of these into the objects that they refer to.
   do
   {
-    nsCAutoString value;
+    nsAutoCString value;
     nsresult intToStringResult;
 
     char curChar;
     curChar = LoadAttrib(attrib, bufStream);
     if (curChar == (char) -1)  //reached eof
       break;
     err = LoadValue(value, bufStream);
     if (err != NS_OK)
@@ -537,17 +537,17 @@ nsresult nsMsgFilterList::LoadTextFilter
       m_startWritingToBuffer = true; //filters begin now
       break;
     case nsIMsgFilterList::attribName:  //every filter starts w/ a name
       {
         if (m_curFilter)
         {
           int32_t nextFilterStartPos = m_unparsedFilterBuffer.RFind("name");
 
-          nsCAutoString nextFilterPart;
+          nsAutoCString nextFilterPart;
           nextFilterPart = Substring(m_unparsedFilterBuffer, nextFilterStartPos, m_unparsedFilterBuffer.Length());
           m_unparsedFilterBuffer.SetLength(nextFilterStartPos);
 
           bool unparseableFilter;
           m_curFilter->GetUnparseable(&unparseableFilter);
           if (unparseableFilter)
           {
             m_curFilter->SetUnparsedBuffer(m_unparsedFilterBuffer);
@@ -641,17 +641,17 @@ nsresult nsMsgFilterList::LoadTextFilter
         }
         else if (type == nsMsgFilterAction::Label)
         {
           // upgrade label to corresponding tag/keyword
           nsresult res;
           int32_t labelInt = value.ToInteger(&res);
           if (NS_SUCCEEDED(res))
           {
-            nsCAutoString keyword("$label");
+            nsAutoCString keyword("$label");
             keyword.Append('0' + labelInt);
             currentFilterAction->SetType(nsMsgFilterAction::AddTag);
             currentFilterAction->SetStrValue(keyword);
           }
         }
         else if (type == nsMsgFilterAction::JunkScore)
         {
           nsresult res;
@@ -812,17 +812,17 @@ NS_IMETHODIMP nsMsgFilterList::ParseCond
 
 nsresult nsMsgFilterList::WriteIntAttr(nsMsgFilterFileAttribValue attrib, int value, nsIOutputStream *aStream)
 {
   nsresult rv = NS_OK;
   const char *attribStr = GetStringForAttrib(attrib);
   if (attribStr)
   {
     uint32_t bytesWritten;
-    nsCAutoString writeStr(attribStr);
+    nsAutoCString writeStr(attribStr);
     writeStr.AppendLiteral("=\"");
     writeStr.AppendInt(value);
     writeStr.AppendLiteral("\"" MSG_LINEBREAK);
     rv = aStream->Write(writeStr.get(), writeStr.Length(), &bytesWritten);
   }
   return rv;
 }
 
@@ -836,17 +836,17 @@ nsMsgFilterList::WriteStrAttr(nsMsgFilte
     char *escapedStr = nullptr;
     if (PL_strchr(aStr, '"'))
       escapedStr = nsMsgSearchTerm::EscapeQuotesInStr(aStr);
 
     const char *attribStr = GetStringForAttrib(attrib);
     if (attribStr)
     {
       uint32_t bytesWritten;
-      nsCAutoString writeStr(attribStr);
+      nsAutoCString writeStr(attribStr);
       writeStr.AppendLiteral("=\"");
       writeStr.Append((escapedStr) ? escapedStr : aStr);
       writeStr.AppendLiteral("\"" MSG_LINEBREAK);
       rv = aStream->Write(writeStr.get(), writeStr.Length(), &bytesWritten);
     }
     PR_Free(escapedStr);
   }
   return rv;
--- a/mailnews/base/search/src/nsMsgFilterService.cpp
+++ b/mailnews/base/search/src/nsMsgFilterService.cpp
@@ -617,17 +617,17 @@ nsresult nsMsgFilterAfterTheFact::ApplyF
         {
             nsCString keyword;
             filterAction->GetStrValue(keyword);
             m_curFolder->AddKeywordsToMessages(m_searchHitHdrs, keyword);
         }
         break;
       case nsMsgFilterAction::JunkScore:
       {
-        nsCAutoString junkScoreStr;
+        nsAutoCString junkScoreStr;
         int32_t junkScore;
         filterAction->GetJunkScore(&junkScore);
         junkScoreStr.AppendInt(junkScore);
         m_curFolder->SetJunkScoreForMessages(m_searchHitHdrs, junkScoreStr);
         break;
       }
       case nsMsgFilterAction::Forward:
         {
@@ -746,17 +746,17 @@ nsresult nsMsgFilterAfterTheFact::ApplyF
       case nsMsgFilterAction::Custom:
       {
         nsMsgFilterTypeType filterType;
         m_curFilter->GetFilterType(&filterType);
         nsCOMPtr<nsIMsgFilterCustomAction> customAction;
         rv = filterAction->GetCustomAction(getter_AddRefs(customAction));
         NS_ENSURE_SUCCESS(rv, rv);
 
-        nsCAutoString value;
+        nsAutoCString value;
         filterAction->GetStrValue(value);
         customAction->Apply(m_searchHitHdrs, value, this,
                             filterType, m_msgWindow);
 
         bool isAsync = false;
         customAction->GetIsAsync(&isAsync);
         if (isAsync)
           return NS_OK;
@@ -815,17 +815,17 @@ NS_IMETHODIMP nsMsgFilterService::GetCus
 NS_IMETHODIMP
 nsMsgFilterService::GetCustomAction(const nsACString & aId,
                                     nsIMsgFilterCustomAction** aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
 
   for (int32_t i = 0; i < mCustomActions.Count(); i++)
   {
-    nsCAutoString id;
+    nsAutoCString id;
     nsresult rv = mCustomActions[i]->GetId(id);
     if (NS_SUCCEEDED(rv) && aId.Equals(id))
     {
       NS_ADDREF(*aResult = mCustomActions[i]);
       return NS_OK;
     }
   }
   aResult = nullptr;
@@ -848,17 +848,17 @@ NS_IMETHODIMP nsMsgFilterService::GetCus
 NS_IMETHODIMP
 nsMsgFilterService::GetCustomTerm(const nsACString& aId,
                                     nsIMsgSearchCustomTerm** aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
 
   for (int32_t i = 0; i < mCustomTerms.Count(); i++)
   {
-    nsCAutoString id;
+    nsAutoCString id;
     nsresult rv = mCustomTerms[i]->GetId(id);
     if (NS_SUCCEEDED(rv) && aId.Equals(id))
     {
       NS_ADDREF(*aResult = mCustomTerms[i]);
       return NS_OK;
     }
   }
   aResult = nullptr;
--- a/mailnews/base/search/src/nsMsgSearchAdapter.cpp
+++ b/mailnews/base/search/src/nsMsgSearchAdapter.cpp
@@ -294,17 +294,17 @@ nsresult nsMsgSearchAdapter::EncodeImapT
 {
   NS_ENSURE_ARG_POINTER(term);
   NS_ENSURE_ARG_POINTER(ppOutTerm);
 
   nsresult err = NS_OK;
   bool useNot = false;
   bool useQuotes = false;
   bool ignoreValue = false;
-  nsCAutoString arbitraryHeader;
+  nsAutoCString arbitraryHeader;
   const char *whichMnemonic = nullptr;
   const char *orHeaderMnemonic = nullptr;
 
   *ppOutTerm = nullptr;
 
   nsCOMPtr <nsIMsgSearchValue> searchValue;
   nsresult rv = term->GetValue(getter_AddRefs(searchValue));
 
@@ -498,17 +498,17 @@ nsresult nsMsgSearchAdapter::EncodeImapT
         PR_ExplodeTime(matchDay, PR_LocalTimeParameters, &exploded);
         PR_FormatTimeUSEnglish(dateBuf, sizeof(dateBuf), "%d-%b-%Y", &exploded);
         //      strftime (dateBuf, sizeof(dateBuf), "%d-%b-%Y", localtime (&matchDay));
         value = dateBuf;
       }
       else if (attrib == nsMsgSearchAttrib::Size)
       {
         uint32_t sizeValue;
-        nsCAutoString searchTermValue;
+        nsAutoCString searchTermValue;
         searchValue->GetSize(&sizeValue);
 
         // Multiply by 1024 to get into kb resolution
         sizeValue *= 1024;
 
         // Ensure that greater than is really greater than
         // in kb resolution.
         if (op == nsMsgSearchOp::IsGreaterThan)
@@ -538,17 +538,17 @@ nsresult nsMsgSearchAdapter::EncodeImapT
 
         // do all sorts of crazy escaping
         convertedValue = reallyDredd ? EscapeSearchUrl (searchTermValue.get()) :
         EscapeImapSearchProtocol(searchTermValue.get());
         useQuotes = ((!reallyDredd ||
                     (nsDependentString(convertedValue).FindChar(PRUnichar(' ')) != -1)) &&
            (attrib != nsMsgSearchAttrib::Keywords));
         // now convert to char* and escape quoted_specials
-        nsCAutoString valueStr;
+        nsAutoCString valueStr;
         nsresult rv = ConvertFromUnicode(NS_LossyConvertUTF16toASCII(destCharset).get(),
           nsDependentString(convertedValue), valueStr);
         if (NS_SUCCEEDED(rv))
         {
           const char *vptr = valueStr.get();
           // max escaped length is one extra character for every character in the cmd.
           nsAutoArrayPtr<char> newValue(new char[2*strlen(vptr) + 1]);
           if (newValue)
@@ -633,17 +633,17 @@ nsresult nsMsgSearchAdapter::EncodeImapV
   {
     // By IMAP RFC, SEARCH HEADER SUBJECT "" is illegal and will generate an error from the server
     if (!value || !value[0])
       return NS_ERROR_NULL_POINTER;
   }
 
   if (!NS_IsAscii(value))
   {
-    nsCAutoString lengthStr;
+    nsAutoCString lengthStr;
     PL_strcat(encoding, "{");
     lengthStr.AppendInt((int32_t) strlen(value));
     PL_strcat(encoding, lengthStr.get());
     PL_strcat(encoding, "}" CRLF);
     PL_strcat(encoding, value);
     return NS_OK;
   }
   if (useQuotes)
@@ -689,17 +689,17 @@ nsresult nsMsgSearchAdapter::EncodeImap 
       expression = nsMsgSearchBoolExpression::AddSearchTerm(expression, pTerm, termEncoding);
       delete [] termEncoding;
     }
   }
 
   if (NS_SUCCEEDED(err))
   {
     // Catenate the intermediate encodings together into a big string
-    nsCAutoString encodingBuff;
+    nsAutoCString encodingBuff;
 
     if (!reallyDredd)
       encodingBuff.Append(m_kImapUnDeleted);
 
     expression->GenerateEncodeStr(&encodingBuff);
     *ppOutEncoding = ToNewCString(encodingBuff);
   }
 
@@ -1148,17 +1148,17 @@ nsMsgSearchValidityManager::NewTable(nsI
 
 nsresult
 nsMsgSearchValidityManager::SetOtherHeadersInTable (nsIMsgSearchValidityTable *aTable, const char *customHeaders)
 {
   uint32_t customHeadersLength = strlen(customHeaders);
   uint32_t numHeaders=0;
   if (customHeadersLength)
   {
-    nsCAutoString hdrStr(customHeaders);
+    nsAutoCString hdrStr(customHeaders);
     hdrStr.StripWhitespace();  //remove whitespace before parsing
     char *newStr = hdrStr.BeginWriting();
     char *token = NS_strtok(":", &newStr);
     while(token)
     {
       numHeaders++;
       token = NS_strtok(":", &newStr);
     }
--- a/mailnews/base/search/src/nsMsgSearchNews.cpp
+++ b/mailnews/base/search/src/nsMsgSearchNews.cpp
@@ -195,17 +195,17 @@ char *nsMsgSearchNews::EncodeTerm (nsIMs
     return nullptr;
 
   char *pattern = new char [NS_strlen(urlEncoded) + overhead];
   if (!pattern)
     return nullptr;
   else
     pattern[0] = '\0';
 #else
-    nsCAutoString pattern;
+    nsAutoCString pattern;
 #endif
 
 
   if (leadingStar)
       pattern.Append('*');
     pattern.Append(NS_ConvertUTF16toUTF8(escapedValue));
   if (trailingStar)
       pattern.Append('*');
--- a/mailnews/base/search/src/nsMsgSearchTerm.cpp
+++ b/mailnews/base/search/src/nsMsgSearchTerm.cpp
@@ -145,17 +145,17 @@ nsresult NS_MsgGetAttributeFromString(co
     rv = prefService->GetBranch(nullptr, getter_AddRefs(prefBranch));
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCString headers;
     prefBranch->GetCharPref(MAILNEWS_CUSTOM_HEADERS, getter_Copies(headers));
 
     if (!headers.IsEmpty())
     {
-      nsCAutoString hdrStr(headers);
+      nsAutoCString hdrStr(headers);
       hdrStr.StripWhitespace();  //remove whitespace before parsing
 
       char *newStr= hdrStr.BeginWriting();
       char *token = NS_strtok(":", &newStr);
       uint32_t i=0;
       while (token)
       {
         if (PL_strcasecmp(token, string) == 0)
@@ -481,24 +481,24 @@ nsresult nsMsgSearchTerm::OutputValue(ns
       }
     case nsMsgSearchAttrib::JunkPercent:
       {
         outputStr.AppendInt(m_value.u.junkPercent);
         break;
       }
     case nsMsgSearchAttrib::MsgStatus:
       {
-        nsCAutoString status;
+        nsAutoCString status;
         NS_MsgGetUntranslatedStatusName (m_value.u.msgStatus, &status);
         outputStr += status;
         break;
       }
     case nsMsgSearchAttrib::Priority:
       {
-        nsCAutoString priority;
+        nsAutoCString priority;
         NS_MsgGetUntranslatedPriorityName(m_value.u.priority, priority);
         outputStr += priority;
         break;
       }
     case nsMsgSearchAttrib::HasAttachmentStatus:
       {
         outputStr.Append("true");  // don't need anything here, really
         break;
@@ -519,17 +519,17 @@ nsresult nsMsgSearchTerm::OutputValue(ns
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgSearchTerm::GetTermAsString (nsACString &outStream)
 {
   const char *operatorStr;
-  nsCAutoString  outputStr;
+  nsAutoCString  outputStr;
   nsresult  ret;
 
   if (m_matchAll)
   {
     outStream = "ALL";
     return NS_OK;
   }
 
@@ -673,17 +673,17 @@ nsMsgSearchTerm::ParseAttribute(char *in
     // arbitrary headers are quoted. Skip first character, which will be the
     // first quote for arbitrary headers
     char *separator = strchr(inStream + 1, quoteVal ? '"' : ',');
 
     if (separator)
         *separator = '\0';
 
     int16_t attributeVal;
-    nsCAutoString customId;
+    nsAutoCString customId;
     nsresult rv = NS_MsgGetAttributeFromString(inStream, &attributeVal, m_customId);
     NS_ENSURE_SUCCESS(rv, rv);
 
     *attrib = (nsMsgSearchAttribValue) attributeVal;
 
     if (*attrib > nsMsgSearchAttrib::OtherHeader && *attrib < nsMsgSearchAttrib::kNumMsgSearchAttributes)  // if we are dealing with an arbitrary header....
     {
       m_arbitraryHeader = inStream + 1; // remove the leading quote
@@ -714,17 +714,17 @@ nsresult nsMsgSearchTerm::DeStreamNew (c
   if (commaSep)
     rv = ParseOperator(commaSep + 1, &m_operator);
   NS_ENSURE_SUCCESS(rv, rv);
   // convert label filters and saved searches to keyword equivalents
   if (secondCommaSep)
     ParseValue(secondCommaSep + 1);
   if (m_attribute == nsMsgSearchAttrib::Label)
   {
-    nsCAutoString keyword("$label");
+    nsAutoCString keyword("$label");
     m_value.attribute = m_attribute = nsMsgSearchAttrib::Keywords;
     keyword.Append('0' + m_value.u.label);
     m_value.string = PL_strdup(keyword.get());
   }
   return NS_OK;
 }
 
 
@@ -761,18 +761,18 @@ nsresult nsMsgSearchTerm::MatchArbitrary
     new nsMsgBodyHandler (scope, length, msg, db, headers, headersSize,
                           ForFiltering);
   if (!bodyHandler)
     return NS_ERROR_OUT_OF_MEMORY;
 
   bodyHandler->SetStripHeaders (false);
 
   nsCString headerFullValue; // contains matched header value accumulated over multiple lines.
-  nsCAutoString buf;
-  nsCAutoString curMsgHeader;
+  nsAutoCString buf;
+  nsAutoCString curMsgHeader;
   bool searchingHeaders = true;
 
   // We will allow accumulation of received headers;
   bool isReceivedHeader = m_arbitraryHeader.EqualsLiteral("received");
   
   while (searchingHeaders)
   {
     if (bodyHandler->GetNextLine(buf) < 0 || EMPTY_MESSAGE_LINE(buf))
@@ -915,17 +915,17 @@ nsresult nsMsgSearchTerm::MatchBody (nsI
   // specified "BODY IS foo". ### Since length is in lines, this is not quite right.
   if ((length > 0) && (m_operator == nsMsgSearchOp::Is || m_operator == nsMsgSearchOp::Isnt))
     length = PL_strlen (m_value.string);
 
   nsMsgBodyHandler * bodyHan  = new nsMsgBodyHandler (scope, length, msg, db);
   if (!bodyHan)
     return NS_ERROR_OUT_OF_MEMORY;
 
-  nsCAutoString buf;
+  nsAutoCString buf;
   bool endOfFile = false;  // if retValue == 0, we've hit the end of the file
   uint32 lines = 0;
 
   // Change the sense of the loop so we don't bail out prematurely
   // on negative terms. i.e. opDoesntContain must look at all lines
   bool boolContinueLoop;
   GetMatchAllBeforeDeciding(&boolContinueLoop);
   result = boolContinueLoop;
@@ -1180,18 +1180,18 @@ NS_IMETHODIMP nsMsgSearchTerm::GetMatchA
 
    if (NS_SUCCEEDED(parseErr) && count > 0)
    {
      NS_ASSERTION(names, "couldn't get names");
      NS_ASSERTION(addresses, "couldn't get addresses");
      if (!names || !addresses)
        return err;
 
-     nsCAutoString walkNames;
-     nsCAutoString walkAddresses;
+     nsAutoCString walkNames;
+     nsAutoCString walkAddresses;
      int32_t namePos = 0;
      int32_t addressPos = 0;
      for (uint32_t i = 0; i < count && result == boolContinueLoop; i++)
      {
        walkNames = names + namePos;
        walkAddresses = addresses + addressPos;
        if ( m_operator == nsMsgSearchOp::IsInAB ||
             m_operator == nsMsgSearchOp::IsntInAB)
--- a/mailnews/base/src/MailNewsDLF.cpp
+++ b/mailnews/base/src/MailNewsDLF.cpp
@@ -42,17 +42,17 @@ MailNewsDLF::CreateInstance(const char* 
 
   aChannel->SetContentType(NS_LITERAL_CSTRING(TEXT_HTML));
 
   // Get the HTML category
   nsCOMPtr<nsICategoryManager> catMan(
     do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString contractID;
+  nsAutoCString contractID;
   rv = catMan->GetCategoryEntry("Gecko-Content-Viewers", TEXT_HTML,
                                 getter_Copies(contractID));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIDocumentLoaderFactory> factory(do_GetService(contractID.get(),
                                              &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
--- a/mailnews/base/src/nsMessenger.cpp
+++ b/mailnews/base/src/nsMessenger.cpp
@@ -601,17 +601,17 @@ nsMessenger::DetachAttachmentsWOPrompts(
   NS_ENSURE_ARG_POINTER(aDisplayNameArray);
   if (!aCount)
     return NS_OK;
   nsSaveAllAttachmentsState *saveState;
   nsCOMPtr<nsIFile> attachmentDestination;
   nsresult rv = aDestFolder->Clone(getter_AddRefs(attachmentDestination));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString path;
+  nsAutoCString path;
   rv = attachmentDestination->GetNativePath(path);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoString unescapedFileName;
   ConvertAndSanitizeFileName(aDisplayNameArray[0], unescapedFileName);
   rv = attachmentDestination->Append(unescapedFileName);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = attachmentDestination->CreateUnique(nsIFile::NORMAL_FILE_TYPE, ATTACHMENT_PERMISSION);
@@ -641,36 +641,36 @@ nsresult nsMessenger::SaveAttachment(nsI
                                      const nsACString &aMessageUri,
                                      const nsACString &aContentType,
                                      void *closure,
                                      nsIUrlListener *aListener)
 {
   nsCOMPtr<nsIMsgMessageService> messageService;
   nsSaveAllAttachmentsState *saveState= (nsSaveAllAttachmentsState*) closure;
   nsCOMPtr<nsIMsgMessageFetchPartService> fetchService;
-  nsCAutoString urlString;
+  nsAutoCString urlString;
   nsCOMPtr<nsIURI> URL;
-  nsCAutoString fullMessageUri(aMessageUri);
+  nsAutoCString fullMessageUri(aMessageUri);
 
   // This instance will be held onto by the listeners, and will be released once 
   // the transfer has been completed.
   nsRefPtr<nsSaveMsgListener> saveListener(new nsSaveMsgListener(aFile, this, aListener));
   if (!saveListener)
     return NS_ERROR_OUT_OF_MEMORY;
 
   saveListener->m_contentType = aContentType;
   if (saveState)
   {
     saveListener->m_saveAllAttachmentsState = saveState;
     if (saveState->m_detachingAttachments)
     {
       nsCOMPtr<nsIURI> outputURI;
       nsresult rv = NS_NewFileURI(getter_AddRefs(outputURI), aFile);
       NS_ENSURE_SUCCESS(rv, rv);
-      nsCAutoString fileUriSpec;
+      nsAutoCString fileUriSpec;
       outputURI->GetSpec(fileUriSpec);
       saveState->m_savedFiles.AppendElement(fileUriSpec);
     }
   }
 
   urlString = aURL;
   // strip out ?type=application/x-message-display because it confuses libmime
 
@@ -996,17 +996,17 @@ nsMessenger::SaveAs(const nsACString& aU
     if (saveAsFileType == EML_FILE_TYPE)
     {
       rv = messageService->SaveMessageToDisk(PromiseFlatCString(aURI).get(), saveAsFile, false,
         urlListener, nullptr,
         true, mMsgWindow);
     }
     else
     {
-      nsCAutoString urlString(aURI);
+      nsAutoCString urlString(aURI);
 
       // we can't go RFC822 to TXT until bug #1775 is fixed
       // so until then, do the HTML to TXT conversion in
       // nsSaveMsgListener::OnStopRequest(), see ConvertBufToPlainText()
       //
       // Setup the URL for a "Save As..." Operation...
       // For now, if this is a save as TEXT operation, then do
       // a "printing" operation
@@ -2791,18 +2791,18 @@ nsDelAttachListener::StartProcessing(nsM
 
   rv = MsgNewBufferedFileOutputStream(getter_AddRefs(mMsgFileStream), mMsgFile, -1, ATTACHMENT_PERMISSION);
 
   // create the additional header for data conversion. This will tell the stream converter
   // which MIME emitter we want to use, and it will tell the MIME emitter which attachments
   // should be deleted.
   const char * partId;
   const char * nextField;
-  nsCAutoString sHeader("attach&del=");
-  nsCAutoString detachToHeader("&detachTo=");
+  nsAutoCString sHeader("attach&del=");
+  nsAutoCString detachToHeader("&detachTo=");
   for (uint32_t u = 0; u < mAttach->mCount; ++u)
   {
     if (u > 0)
     {
       sHeader.Append(",");
       if (detaching)
         detachToHeader.Append(",");
     }
--- a/mailnews/base/src/nsMessengerBootstrap.cpp
+++ b/mailnews/base/src/nsMessengerBootstrap.cpp
@@ -26,17 +26,17 @@ nsMessengerBootstrap::nsMessengerBootstr
 
 nsMessengerBootstrap::~nsMessengerBootstrap()
 {
 }
 
 NS_IMETHODIMP nsMessengerBootstrap::OpenMessengerWindowWithUri(const char *windowType, const char * aFolderURI, nsMsgKey aMessageKey)
 {
   bool standAloneMsgWindow = false;
-  nsCAutoString chromeUrl("chrome://messenger/content/");
+  nsAutoCString chromeUrl("chrome://messenger/content/");
   if (windowType && !strcmp(windowType, "mail:messageWindow"))
   {
     chromeUrl.Append("messageWindow.xul");
     standAloneMsgWindow = true;
   }
   nsCOMPtr<nsISupportsArray> argsArray;
   nsresult rv = NS_NewISupportsArray(getter_AddRefs(argsArray));
   NS_ENSURE_SUCCESS(rv, rv);
@@ -44,17 +44,17 @@ NS_IMETHODIMP nsMessengerBootstrap::Open
   // create scriptable versions of our strings that we can store in our nsISupportsArray....
   if (aFolderURI)
   {
     if (standAloneMsgWindow)
     {
       nsCOMPtr <nsIMsgFolder> folder;
       rv = GetExistingFolder(nsDependentCString(aFolderURI), getter_AddRefs(folder));
       NS_ENSURE_SUCCESS(rv, rv);
-      nsCAutoString msgUri;
+      nsAutoCString msgUri;
       folder->GetBaseMessageURI(msgUri);
 
       nsCOMPtr<nsISupportsCString> scriptableMsgURI (do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID));
       NS_ENSURE_TRUE(scriptableMsgURI, NS_ERROR_FAILURE);
       msgUri.Append('#');
       msgUri.AppendInt(aMessageKey, 10);
       scriptableMsgURI->SetData(msgUri);
       argsArray->AppendElement(scriptableMsgURI);
--- a/mailnews/base/src/nsMessengerContentHandler.cpp
+++ b/mailnews/base/src/nsMessengerContentHandler.cpp
@@ -45,17 +45,17 @@ NS_IMETHODIMP nsMessengerContentHandler:
     if (aUri)
     {
       rv = request->Cancel(NS_ERROR_ABORT);
       if (NS_SUCCEEDED(rv))
       {
         nsCOMPtr<nsIURL> aUrl = do_QueryInterface(aUri);
         if (aUrl)
         {
-          nsCAutoString queryPart;
+          nsAutoCString queryPart;
           aUrl->GetQuery(queryPart);
           queryPart.Replace(queryPart.Find("type=message/rfc822"),
                             sizeof("type=message/rfc822") - 1,
                             "type=application/x-message-display");
           aUrl->SetQuery(queryPart);
           rv = OpenWindow(aUri);
         }
       }
--- a/mailnews/base/src/nsMsgAccount.cpp
+++ b/mailnews/base/src/nsMsgAccount.cpp
@@ -42,17 +42,17 @@ nsMsgAccount::getPrefService()
   if (m_prefs)
     return NS_OK;
 
   nsresult rv;
   NS_ENSURE_FALSE(m_accountKey.IsEmpty(), NS_ERROR_NOT_INITIALIZED);
   nsCOMPtr<nsIPrefService> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString accountRoot("mail.account.");
+  nsAutoCString accountRoot("mail.account.");
   accountRoot.Append(m_accountKey);
   accountRoot.Append('.');
   return prefs->GetBranch(accountRoot.get(), getter_AddRefs(m_prefs));
 }
 
 NS_IMETHODIMP
 nsMsgAccount::GetIncomingServer(nsIMsgIncomingServer **aIncomingServer)
 {
@@ -208,17 +208,17 @@ nsMsgAccount::createIdentities()
            do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   char* newStr = identityKey.BeginWriting();
   char* token = NS_strtok(",", &newStr);
 
   // temporaries used inside the loop
   nsCOMPtr<nsIMsgIdentity> identity;
-  nsCAutoString key;
+  nsAutoCString key;
 
   // iterate through id1,id2, etc
   while (token) {
     key = token;
     key.StripWhitespace();
 
     // create the account
     rv = accountManager->GetIdentity(key, getter_AddRefs(identity));
@@ -291,19 +291,19 @@ nsMsgAccount::AddIdentity(nsIMsgIdentity
   // when this is actually implemented, don't refcount the default identity
   nsCString key;
   nsresult rv = identity->GetKey(key);
 
   if (NS_SUCCEEDED(rv)) {
     nsCString identityList;
     m_prefs->GetCharPref("identities", getter_Copies(identityList));
 
-    nsCAutoString newIdentityList(identityList);
+    nsAutoCString newIdentityList(identityList);
 
-    nsCAutoString testKey;      // temporary to strip whitespace
+    nsAutoCString testKey;      // temporary to strip whitespace
     bool foundIdentity = false; // if the input identity is found
 
     if (!identityList.IsEmpty()) {
       char *newStr = identityList.BeginWriting();
       char *token = NS_strtok(",", &newStr);
 
       // look for the identity key that we're adding
       while (token) {
@@ -361,17 +361,17 @@ nsMsgAccount::RemoveIdentity(nsIMsgIdent
   // clear out the actual pref values associated with the identity
   aIdentity->ClearAllValues();
 
   // if we just deleted the default identity, clear it out so we pick a new one
   if (m_defaultIdentity == aIdentity)
     m_defaultIdentity = nullptr;
 
   // now rebuild the identity pref
-  nsCAutoString newIdentityList;
+  nsAutoCString newIdentityList;
 
   // iterate over the remaining identities
   for (uint32_t index = 0; index < count; index++)
   {
     nsCOMPtr<nsIMsgIdentity> identity = do_QueryElementAt(m_identities, index, &rv);
     if (identity)
     {
       identity->GetKey(key);
--- a/mailnews/base/src/nsMsgAccountManager.cpp
+++ b/mailnews/base/src/nsMsgAccountManager.cpp
@@ -364,17 +364,17 @@ nsMsgAccountManager::getUniqueAccountKey
       accounts->EnumerateForwards(findAccountByKey, (void *)&findEntry);
     } while (findEntry.account);
   }
 }
 
 void
 nsMsgAccountManager::GetUniqueServerKey(nsACString& aResult)
 {
-  nsCAutoString prefResult;
+  nsAutoCString prefResult;
   bool usePrefsScan = true;
   nsresult rv;
   nsCOMPtr<nsIPrefService> prefService(do_GetService(NS_PREFSERVICE_CONTRACTID,
                                        &rv));
   if (NS_FAILED(rv))
     usePrefsScan = false;
 
   // Loop over existing pref names mail.server.server(lastKey).type
@@ -383,51 +383,51 @@ nsMsgAccountManager::GetUniqueServerKey(
   {
     rv = prefService->GetBranch(PREF_MAIL_SERVER_PREFIX, getter_AddRefs(prefBranchServer));
     if (NS_FAILED(rv))
       usePrefsScan = false;
   }
 
   if (usePrefsScan)
   {
-    nsCAutoString type;
-    nsCAutoString typeKey;
+    nsAutoCString type;
+    nsAutoCString typeKey;
     for (PRInt32 lastKey = 1; ; lastKey++)
     {
       aResult.AssignLiteral(SERVER_PREFIX);
       aResult.AppendInt(lastKey);
       typeKey.Assign(aResult);
       typeKey.AppendLiteral(".type");
       prefBranchServer->GetCharPref(typeKey.get(), getter_Copies(type));
       if (type.IsEmpty()) // a server slot with no type is considered empty
         return;
     }
   }
   else
   {
     // If pref service fails, try to find a free serverX key
     // by checking which keys exist.
-    nsCAutoString internalResult;
+    nsAutoCString internalResult;
     nsCOMPtr<nsIMsgIncomingServer> server;
     PRInt32 i = 1;
     do {
       aResult.AssignLiteral(SERVER_PREFIX);
       aResult.AppendInt(i++);
       m_incomingServers.Get(aResult, getter_AddRefs(server));
     } while (server);
     return;
   }
 }
 
 nsresult
 nsMsgAccountManager::CreateIdentity(nsIMsgIdentity **_retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
   nsresult rv;
-  nsCAutoString key;
+  nsAutoCString key;
   nsCOMPtr<nsIMsgIdentity> identity;
   int32_t i = 1;
   do {
     key.AssignLiteral(ID_PREFIX);
     key.AppendInt(i++);
     m_identities.Get(key, getter_AddRefs(identity));
   } while (identity);
 
@@ -480,17 +480,17 @@ nsMsgAccountManager::CreateIncomingServe
                                           const nsACString& type,
                                           nsIMsgIncomingServer **_retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
 
   nsresult rv = LoadAccounts();
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString key;
+  nsAutoCString key;
   GetUniqueServerKey(key);
   rv = createKeyedServer(key, username, hostname, type, _retval);
   if (*_retval)
   {
     nsCString defaultStore;
     m_prefs->GetCharPref("mail.serverDefaultStoreContractID", getter_Copies(defaultStore));
     (*_retval)->SetCharValue("storeContractID", defaultStore);
   }
@@ -510,21 +510,21 @@ nsMsgAccountManager::GetIncomingServer(c
   // server doesn't exist, so create it
   // this is really horrible because we are doing our own prefname munging
   // instead of leaving it up to the incoming server.
   // this should be fixed somehow so that we can create the incoming server
   // and then read from the incoming server's attributes
 
   // in order to create the right kind of server, we have to look
   // at the pref for this server to get the username, hostname, and type
-  nsCAutoString serverPrefPrefix(PREF_MAIL_SERVER_PREFIX);
+  nsAutoCString serverPrefPrefix(PREF_MAIL_SERVER_PREFIX);
   serverPrefPrefix.Append(key);
 
   nsCString serverType;
-  nsCAutoString serverPref (serverPrefPrefix);
+  nsAutoCString serverPref (serverPrefPrefix);
   serverPref.AppendLiteral(".type");
   rv = m_prefs->GetCharPref(serverPref.get(), getter_Copies(serverType));
   NS_ENSURE_SUCCESS(rv, NS_ERROR_NOT_INITIALIZED);
 
   //
   // .userName
   serverPref = serverPrefPrefix;
   serverPref.AppendLiteral(".userName");
@@ -624,17 +624,17 @@ nsMsgAccountManager::createKeyedServer(c
                                        const nsACString& hostname,
                                        const nsACString& type,
                                        nsIMsgIncomingServer ** aServer)
 {
   nsresult rv;
   *aServer = nullptr;
 
   //construct the contractid
-  nsCAutoString serverContractID(NS_MSGINCOMINGSERVER_CONTRACTID_PREFIX);
+  nsAutoCString serverContractID(NS_MSGINCOMINGSERVER_CONTRACTID_PREFIX);
   serverContractID += type;
 
   // finally, create the server
   // (This will fail if type is from an extension that has been removed)
   nsCOMPtr<nsIMsgIncomingServer> server =
            do_CreateInstance(serverContractID.get(), &rv);
   NS_ENSURE_SUCCESS(rv, NS_ERROR_NOT_AVAILABLE);
 
@@ -1435,17 +1435,17 @@ nsMsgAccountManager::LoadAccounts()
     // if we've already seen this exact account, advance to the next account.
     // After the loop, we'll notice that we don't have as many actual accounts
     // as there were accounts in the pref, and rewrite the pref.
     if (accountsArray.IndexOf(accountsArray[i]) != i)
       continue;
 
     // get the "server" pref to see if we already have an account with this
     // server. If we do, we ignore this account.
-    nsCAutoString serverKeyPref("mail.account.");
+    nsAutoCString serverKeyPref("mail.account.");
     serverKeyPref += accountsArray[i];
 
     nsCOMPtr<nsIPrefBranch> accountPrefBranch;
     rv = prefservice->GetBranch(serverKeyPref.get(),
                                 getter_AddRefs(accountPrefBranch));
     NS_ENSURE_SUCCESS(rv,rv);
 
     serverKeyPref += ".server";
@@ -1467,19 +1467,19 @@ nsMsgAccountManager::LoadAccounts()
                                      getter_AddRefs(account))) || !account)
     {
       NS_WARNING("unexpected entry in account list; prefs corrupt?");
       continue;
     }
 
     // See nsIMsgAccount.idl for a description of the secondsToLeaveUnavailable
     //  and timeFoundUnavailable preferences
-    nsCAutoString toLeavePref(PREF_MAIL_SERVER_PREFIX);
+    nsAutoCString toLeavePref(PREF_MAIL_SERVER_PREFIX);
     toLeavePref.Append(serverKey);
-    nsCAutoString unavailablePref(toLeavePref); // this is the server-specific prefix
+    nsAutoCString unavailablePref(toLeavePref); // this is the server-specific prefix
     unavailablePref.AppendLiteral(".timeFoundUnavailable");
     toLeavePref.AppendLiteral(".secondsToLeaveUnavailable");
     PRInt32 secondsToLeave = 0;
     PRInt32 timeUnavailable = 0;
 
     m_prefs->GetIntPref(toLeavePref.get(), &secondsToLeave);
 
     // force load of accounts (need to find a better way to do this)
@@ -1537,17 +1537,17 @@ nsMsgAccountManager::LoadAccounts()
 
   // Go through the accounts seeing if any existing server is deferred to
   // an account we removed. If so, fix the deferral. Then clean up the prefs
   // for the removed account.
   for (int32_t i = 0; i < cnt; i++)
   {
     dupAccount = dupAccounts[i];
     m_incomingServers.Enumerate(hashCleanupDeferral, (void *) dupAccount.get());
-    nsCAutoString accountKeyPref("mail.account.");
+    nsAutoCString accountKeyPref("mail.account.");
     nsCString dupAccountKey;
     dupAccount->GetKey(dupAccountKey);
     if (dupAccountKey.IsEmpty())
       continue;
     accountKeyPref += dupAccountKey;
 
     nsCOMPtr<nsIPrefBranch> accountPrefBranch;
     rv = prefservice->GetBranch(accountKeyPref.get(),
@@ -1776,17 +1776,17 @@ nsMsgAccountManager::createKeyedAccount(
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgAccountManager::CreateAccount(nsIMsgAccount **_retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
 
-  nsCAutoString key;
+  nsAutoCString key;
   getUniqueAccountKey(m_accounts, key);
 
   return createKeyedAccount(key, _retval);
 }
 
 NS_IMETHODIMP
 nsMsgAccountManager::GetAccount(const nsACString& key, nsIMsgAccount **_retval)
 {
@@ -1933,29 +1933,29 @@ nsMsgAccountManager::FindServerByURI(nsI
                                 nsIMsgIncomingServer** aResult)
 {
   NS_ENSURE_ARG_POINTER(aURI);
 
   nsresult rv = LoadAccounts();
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Get username and hostname and port so we can get the server
-  nsCAutoString username;
-  nsCAutoString escapedUsername;
+  nsAutoCString username;
+  nsAutoCString escapedUsername;
   rv = aURI->GetUserPass(escapedUsername);
   if (NS_SUCCEEDED(rv) && !escapedUsername.IsEmpty())
     MsgUnescapeString(escapedUsername, 0,  username);
 
-  nsCAutoString hostname;
-  nsCAutoString escapedHostname;
+  nsAutoCString hostname;
+  nsAutoCString escapedHostname;
   rv = aURI->GetHost(escapedHostname);
   if (NS_SUCCEEDED(rv) && !escapedHostname.IsEmpty())
     MsgUnescapeString(escapedHostname, 0, hostname);
 
-  nsCAutoString type;
+  nsAutoCString type;
   rv = aURI->GetScheme(type);
   if (NS_SUCCEEDED(rv) && !type.IsEmpty())
   {
     // now modify type if pop or news
     if (type.EqualsLiteral("pop"))
       type.AssignLiteral("pop3");
     // we use "nntp" in the server list so translate it here.
     else if (type.EqualsLiteral("news"))
@@ -2682,17 +2682,17 @@ nsMsgAccountManager::GetChromePackageNam
   rv = catman->EnumerateCategory(MAILNEWS_ACCOUNTMANAGER_EXTENSIONS, getter_AddRefs(e));
   if(NS_SUCCEEDED(rv) && e) {
     while (true) {
       nsCOMPtr<nsISupportsCString> catEntry;
       rv = e->GetNext(getter_AddRefs(catEntry));
       if (NS_FAILED(rv) || !catEntry)
         break;
 
-      nsCAutoString entryString;
+      nsAutoCString entryString;
       rv = catEntry->GetData(entryString);
       if (NS_FAILED(rv))
          break;
 
       nsCString contractidString;
       rv = catman->GetCategoryEntry(MAILNEWS_ACCOUNTMANAGER_EXTENSIONS, entryString.get(),
                                     getter_Copies(contractidString));
       if (NS_FAILED(rv))
@@ -3139,17 +3139,17 @@ NS_IMETHODIMP nsMsgAccountManager::LoadV
      NS_ENSURE_SUCCESS(rv, rv);
      nsCOMPtr<nsIFileInputStream> fileStream = do_CreateInstance(NS_LOCALFILEINPUTSTREAM_CONTRACTID, &rv);
      NS_ENSURE_SUCCESS(rv, rv);
 
      rv = fileStream->Init(file,  PR_RDONLY, 0664, false);
      nsCOMPtr <nsILineInputStream> lineInputStream(do_QueryInterface(fileStream));
 
     bool isMore = true;
-    nsCAutoString buffer;
+    nsAutoCString buffer;
     int32_t version = -1;
     nsCOMPtr <nsIMsgFolder> virtualFolder;
     nsCOMPtr <nsIDBFolderInfo> dbFolderInfo;
     nsCOMPtr<nsIRDFResource> resource;
     nsCOMPtr<nsIRDFService> rdf(do_GetService("@mozilla.org/rdf/rdf-service;1", &rv));
     NS_ENSURE_SUCCESS(rv, rv);
     nsCOMPtr<nsIArray> allFolders;
 
@@ -3192,17 +3192,17 @@ NS_IMETHODIMP nsMsgAccountManager::LoadV
               // hold a reference so it won't get deleted before it's parented.
               oldParent = parentFolder;
 
               rdf->GetResource(parentUri, getter_AddRefs(resource));
               parentFolder = do_QueryInterface(resource);
               if (parentFolder)
               {
                 nsAutoString currentFolderNameStr;
-                nsCAutoString currentFolderNameCStr;
+                nsAutoCString currentFolderNameCStr;
                 MsgUnescapeString(nsCString(Substring(buffer, lastSlash + 1, buffer.Length())), 0, currentFolderNameCStr);
                 CopyUTF8toUTF16(currentFolderNameCStr, currentFolderNameStr);
                 nsCOMPtr <nsIMsgFolder> childFolder;
                 nsCOMPtr <nsIMsgDatabase> db;
                 // force db to get created.
                 virtualFolder->SetParent(parentFolder);
                 rv = virtualFolder->GetMsgDatabase(getter_AddRefs(db));
                 if (rv == NS_MSG_ERROR_FOLDER_SUMMARY_MISSING)
--- a/mailnews/base/src/nsMsgAccountManagerDS.cpp
+++ b/mailnews/base/src/nsMsgAccountManagerDS.cpp
@@ -338,17 +338,17 @@ nsMsgAccountManagerDataSource::GetTarget
         nsCOMPtr<nsIMsgAccountManager> am = do_QueryReferent(mAccountManager, &rv);
         NS_ENSURE_SUCCESS(rv, NS_OK);
 
         // turn NC#PageTitlefoobar into foobar, so we can get the am-foobar.properties bundle
         nsCString chromePackageName;
         rv = am->GetChromePackageName(nsCString(sourceValue + strlen(NC_RDF_PAGETITLE_PREFIX)), chromePackageName);
         NS_ENSURE_SUCCESS(rv,rv);
 
-        nsCAutoString bundleURL;
+        nsAutoCString bundleURL;
         bundleURL = "chrome://";
         bundleURL += chromePackageName;
         bundleURL += "/locale/am-";
         bundleURL += (sourceValue + strlen(NC_RDF_PAGETITLE_PREFIX));
         bundleURL += ".properties";
 
         nsCOMPtr <nsIStringBundle> bundle;
         rv = strBundleService->CreateBundle(bundleURL.get(), getter_AddRefs(bundle));
@@ -622,17 +622,17 @@ nsMsgAccountManagerDataSource::appendGen
   rv = catman->EnumerateCategory(MAILNEWS_ACCOUNTMANAGER_EXTENSIONS, getter_AddRefs(e));
   if(NS_SUCCEEDED(rv) && e) {
     while (true) {
       nsCOMPtr<nsISupportsCString> catEntry;
       rv = e->GetNext(getter_AddRefs(catEntry));
       if (NS_FAILED(rv) || !catEntry)
         break;
 
-      nsCAutoString entryString;
+      nsAutoCString entryString;
       rv = catEntry->GetData(entryString);
       if (NS_FAILED(rv))
         break;
 
       nsCString contractidString;
       rv = catman->GetCategoryEntry(MAILNEWS_ACCOUNTMANAGER_EXTENSIONS, entryString.get(), getter_Copies(contractidString));
       if (NS_FAILED(rv))
         break;
@@ -666,17 +666,17 @@ nsresult
 nsMsgAccountManagerDataSource::appendGenericSetting(const char *name,
                                                     nsCOMArray<nsIRDFResource> *aNodeArray)
 {
   NS_ENSURE_ARG_POINTER(name);
   NS_ENSURE_ARG_POINTER(aNodeArray);
 
   nsCOMPtr <nsIRDFResource> resource;
 
-  nsCAutoString resourceStr;
+  nsAutoCString resourceStr;
   resourceStr = NC_RDF_PAGETITLE_PREFIX;
   resourceStr += name;
 
   nsresult rv = getRDFService()->GetResource(resourceStr, getter_AddRefs(resource));
   NS_ENSURE_SUCCESS(rv,rv);
 
   // AppendElement will addref.
   aNodeArray->AppendObject(resource);
@@ -995,17 +995,17 @@ nsMsgAccountManagerDataSource::supportsF
 
 bool
 nsMsgAccountManagerDataSource::canGetMessages(nsIMsgIncomingServer *aServer)
 {
   nsCString type;
   nsresult rv = aServer->GetType(type);
   NS_ENSURE_SUCCESS(rv, false);
 
-  nsCAutoString contractid(NS_MSGPROTOCOLINFO_CONTRACTID_PREFIX);
+  nsAutoCString contractid(NS_MSGPROTOCOLINFO_CONTRACTID_PREFIX);
   contractid.Append(type);
 
   nsCOMPtr<nsIMsgProtocolInfo> protocolInfo = do_GetService(contractid.get(), &rv);
   NS_ENSURE_SUCCESS(rv, false);
 
   bool canGetMessages = false;
   protocolInfo->GetCanGetMessages(&canGetMessages);
 
@@ -1014,17 +1014,17 @@ nsMsgAccountManagerDataSource::canGetMes
 
 bool
 nsMsgAccountManagerDataSource::canGetIncomingMessages(nsIMsgIncomingServer *aServer)
 {
   nsCString type;
   nsresult rv = aServer->GetType(type);
   NS_ENSURE_SUCCESS(rv, false);
 
-  nsCAutoString contractid(NS_MSGPROTOCOLINFO_CONTRACTID_PREFIX);
+  nsAutoCString contractid(NS_MSGPROTOCOLINFO_CONTRACTID_PREFIX);
   contractid.Append(type);
 
   nsCOMPtr<nsIMsgProtocolInfo> protocolInfo = do_GetService(contractid.get(), &rv);
   NS_ENSURE_SUCCESS(rv, false);
 
   bool canGetIncomingMessages = false;
   protocolInfo->GetCanGetIncomingMessages(&canGetIncomingMessages);
 
--- a/mailnews/base/src/nsMsgContentPolicy.cpp
+++ b/mailnews/base/src/nsMsgContentPolicy.cpp
@@ -143,17 +143,17 @@ nsMsgContentPolicy::ShouldAcceptRemoteCo
 /**
  * Extract the host name from aContentLocation, and look it up in our list
  * of trusted domains.
  */
 bool nsMsgContentPolicy::IsTrustedDomain(nsIURI * aContentLocation)
 {
   bool trustedDomain = false;
   // get the host name of the server hosting the remote image
-  nsCAutoString host;
+  nsAutoCString host;
   nsresult rv = aContentLocation->GetHost(host);
 
   if (NS_SUCCEEDED(rv) && !mTrustedMailDomains.IsEmpty()) 
     trustedDomain = MsgHostDomainIsTrusted(host, mTrustedMailDomains);
 
   return trustedDomain;
 }
 
@@ -357,17 +357,17 @@ nsMsgContentPolicy::IsSafeRequestingLoca
 
 /**
  * Determines if the content location is a scheme that we're willing to expose
  * for unlimited loading of content.
  */
 bool
 nsMsgContentPolicy::IsExposedProtocol(nsIURI *aContentLocation)
 {
-  nsCAutoString contentScheme;
+  nsAutoCString contentScheme;
   nsresult rv = aContentLocation->GetScheme(contentScheme);
   NS_ENSURE_SUCCESS(rv, false);
 
   // If you are changing this list, you may need to also consider changing the
   // list of network.protocol-handler.expose.* prefs in all-thunderbird.js.
   if (MsgLowerCaseEqualsLiteral(contentScheme, "mailto") ||
       MsgLowerCaseEqualsLiteral(contentScheme, "news") ||
       MsgLowerCaseEqualsLiteral(contentScheme, "snews") ||
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -833,17 +833,17 @@ nsresult nsMsgDBView::FetchKeywords(nsIM
   }
   nsMsgLabelValue label = 0;
 
   rv = aHdr->GetLabel(&label);
   nsCString keywords;
   aHdr->GetStringProperty("keywords", getter_Copies(keywords));
   if (label > 0)
   {
-    nsCAutoString labelStr("$label");
+    nsAutoCString labelStr("$label");
     labelStr.Append((char) (label + '0'));
     if (keywords.Find(labelStr, CaseInsensitiveCompare) == -1)
     {
       if (!keywords.IsEmpty())
         keywords.Append(' ');
       keywords.Append(labelStr);
     }
   }
@@ -901,17 +901,17 @@ nsresult nsMsgDBView::FetchTags(nsIMsgDB
   nsString tags;
   nsCString keywords;
   aHdr->GetStringProperty("keywords", getter_Copies(keywords));
 
   nsMsgLabelValue label = 0;
   rv = aHdr->GetLabel(&label);
   if (label > 0)
   {
-    nsCAutoString labelStr("$label");
+    nsAutoCString labelStr("$label");
     labelStr.Append((char) (label + '0'));
     if (keywords.Find(labelStr, CaseInsensitiveCompare) == -1)
       FetchLabel(aHdr, tags);
   }
 
   nsTArray<nsCString> keywordsArray;
   ParseString(keywords, ' ', keywordsArray);
   nsAutoString tag;
@@ -1135,17 +1135,17 @@ NS_IMETHODIMP nsMsgDBView::SetSelection(
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBView::ReloadMessageWithAllParts()
 {
   if (m_currentlyDisplayedMsgUri.IsEmpty() || mSuppressMsgDisplay)
     return NS_OK;
 
-  nsCAutoString forceAllParts(m_currentlyDisplayedMsgUri);
+  nsAutoCString forceAllParts(m_currentlyDisplayedMsgUri);
   forceAllParts += (forceAllParts.FindChar('?') == kNotFound) ? '?' : '&';
   forceAllParts.AppendLiteral("fetchCompleteMessage=true");
   nsCOMPtr<nsIMessenger> messenger (do_QueryReferent(mMessengerWeak));
   NS_ENSURE_TRUE(messenger, NS_ERROR_FAILURE);
 
   nsresult rv = messenger->OpenURL(forceAllParts);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -1498,18 +1498,18 @@ NS_IMETHODIMP nsMsgDBView::GetCellProper
   // this is a double fetch of the keywords property since we also fetch
   // it for the tags - do we want to do this?
   // I'm not sure anyone uses the kw- property, though it could be nice
   // for people wanting to extend the thread pane.
   nsCString keywordProperty;
   msgHdr->GetStringProperty("keywords", getter_Copies(keywordProperty));
   if (!keywordProperty.IsEmpty())
   {
-    nsCAutoString keywords(keywordProperty);
-    nsCAutoString nextKeyword;
+    nsAutoCString keywords(keywordProperty);
+    nsAutoCString nextKeyword;
     int32_t spaceIndex = 0;
     do
     {
       spaceIndex = keywords.FindChar(' ');
       int32_t endOfKeyword = (spaceIndex == -1) ? keywords.Length() : spaceIndex;
       nextKeyword.AssignLiteral("kw-");
       nextKeyword.Append(StringHead(keywords, endOfKeyword));
       nsCOMPtr <nsIAtom> keywordAtom = MsgGetAtom(nextKeyword.get());
@@ -3374,17 +3374,17 @@ nsresult nsMsgDBView::SetMsgHdrJunkStatu
     // and told us the junk status of this message.
     // Set origin first so that listeners on the junkscore will
     // know the correct origin.
     rv = db->SetStringProperty(msgKey, "junkscoreorigin", "user");
     NS_ASSERTION(NS_SUCCEEDED(rv), "SetStringPropertyByIndex failed");
 
     // set the junk score on the message itself
 
-    nsCAutoString msgJunkScore;
+    nsAutoCString msgJunkScore;
     msgJunkScore.AppendInt(aNewClassification == nsIJunkMailPlugin::JUNK ?
           nsIJunkMailPlugin::IS_SPAM_SCORE:
           nsIJunkMailPlugin::IS_HAM_SCORE);
     db->SetStringProperty(msgKey, "junkscore", msgJunkScore.get());
     NS_ENSURE_SUCCESS(rv, rv);
 
     return rv;
 }
@@ -7582,17 +7582,17 @@ nsresult nsMsgDBView::InitDisplayFormats
   getDateFormatPref( dateFormatPrefs, "today", m_dateFormatToday );
   return rv;
 }
 
 void nsMsgDBView::SetMRUTimeForFolder(nsIMsgFolder *folder)
 {
   uint32_t seconds;
   PRTime2Seconds(PR_Now(), &seconds);
-  nsCAutoString nowStr;
+  nsAutoCString nowStr;
   nowStr.AppendInt(seconds);
   folder->SetStringProperty(MRU_TIME_PROPERTY, nowStr);
 }
 
 
 NS_IMPL_ISUPPORTS1(nsMsgDBView::nsMsgViewHdrEnumerator, nsISimpleEnumerator)
 
 nsMsgDBView::nsMsgViewHdrEnumerator::nsMsgViewHdrEnumerator(nsMsgDBView *view)
@@ -7674,25 +7674,25 @@ bool nsMsgDBView::JunkControlsEnabled(ns
     GetFolderForViewIndex(aViewIndex, getter_AddRefs(folder));
   if (folder)
   {
     // Check if this is a mail message in search folders.
     if (mIsXFVirtual)
     {
       nsCOMPtr <nsIMsgIncomingServer> server;
       folder->GetServer(getter_AddRefs(server));
-      nsCAutoString type;
+      nsAutoCString type;
       if (server)
         server->GetType(type);
       if (!(MsgLowerCaseEqualsLiteral(type, "nntp") || MsgLowerCaseEqualsLiteral(type, "rss")))
         return true;
     }
 
     // For rss and news, check the inherited folder property.
-    nsCAutoString junkEnableOverride;
+    nsAutoCString junkEnableOverride;
     folder->GetInheritedStringProperty("dobayes.mailnews@mozilla.org#junk",
                                        junkEnableOverride);
     if (junkEnableOverride.EqualsLiteral("true"))
       return true;
   }
 
   return false;
 }
--- a/mailnews/base/src/nsMsgFolderCache.cpp
+++ b/mailnews/base/src/nsMsgFolderCache.cpp
@@ -232,17 +232,17 @@ NS_IMETHODIMP nsMsgFolderCache::Init(nsI
 {
   NS_ENSURE_ARG_POINTER(aFile);
 
   m_cacheElements.Init();
 
   bool exists;
   aFile->Exists(&exists);
 
-  nsCAutoString dbPath;
+  nsAutoCString dbPath;
   aFile->GetNativePath(dbPath);
   // ### evil cast until MDB supports file streams.
   nsresult rv = OpenMDB(dbPath, exists);
   // if this fails and panacea.dat exists, try blowing away the db and recreating it
   if (NS_FAILED(rv) && exists)
   {
     if (m_mdbStore)
       m_mdbStore->Release();
--- a/mailnews/base/src/nsMsgFolderCacheElement.cpp
+++ b/mailnews/base/src/nsMsgFolderCacheElement.cpp
@@ -110,17 +110,17 @@ NS_IMETHODIMP nsMsgFolderCacheElement::S
   }
   return rv;
 }
 
 NS_IMETHODIMP nsMsgFolderCacheElement::SetInt32Property(const char *propertyName, int32_t propertyValue)
 {
   NS_ENSURE_ARG_POINTER(propertyName);
   NS_ENSURE_TRUE(m_mdbRow, NS_ERROR_FAILURE);
-  nsCAutoString propertyStr;
+  nsAutoCString propertyStr;
   propertyStr.AppendInt(propertyValue, 16);
   return SetStringProperty(propertyName, propertyStr);
 }
 
 void nsMsgFolderCacheElement::SetMDBRow(nsIMdbRow *row)
 {
   if (m_mdbRow)
     NS_RELEASE(m_mdbRow);
--- a/mailnews/base/src/nsMsgFolderCompactor.cpp
+++ b/mailnews/base/src/nsMsgFolderCompactor.cpp
@@ -384,17 +384,17 @@ nsFolderCompactState::FinishCompact()
   folderPath->InitWithFile(path);
   // need to make sure we put the .msf file in the same directory
   // as the original mailbox, so resolve symlinks.
   folderPath->SetFollowLinks(true);
   GetSummaryFileLocation(folderPath, getter_AddRefs(summaryFile));
 
   nsCString leafName;
   summaryFile->GetNativeLeafName(leafName);
-  nsCAutoString dbName(leafName);
+  nsAutoCString dbName(leafName);
 
   path->GetNativeLeafName(leafName);
 
     // close down the temp file stream; preparing for deleting the old folder
     // and its database; then rename the temp folder and database
   m_fileStream->Flush();
   m_fileStream->Close();
   m_fileStream = nullptr;
@@ -748,17 +748,17 @@ nsFolderCompactState::OnDataAvailable(ns
         { // no keywords, so write blank header
           m_fileStream->Write(X_MOZILLA_KEYWORDS, sizeof(X_MOZILLA_KEYWORDS) - 1, &bytesWritten);
           m_addedHeaderSize += bytesWritten;
         }
         else
         {
           if (msgHdrKeywords.Length() < sizeof(X_MOZILLA_KEYWORDS) - sizeof(HEADER_X_MOZILLA_KEYWORDS) + 10 /* allow some slop */)
           { // keywords fit in normal blank header, so replace blanks in keyword hdr with keywords
-            nsCAutoString keywordsHdr(X_MOZILLA_KEYWORDS);
+            nsAutoCString keywordsHdr(X_MOZILLA_KEYWORDS);
             keywordsHdr.Replace(sizeof(HEADER_X_MOZILLA_KEYWORDS) + 1, msgHdrKeywords.Length(), msgHdrKeywords);
             m_fileStream->Write(keywordsHdr.get(), keywordsHdr.Length(), &bytesWritten);
             m_addedHeaderSize += bytesWritten;
           }
           else
           { // keywords don't fit, so write out keywords on one line and an extra blank line
             nsCString newKeywordHeader(HEADER_X_MOZILLA_KEYWORDS ": ");
             newKeywordHeader.Append(msgHdrKeywords);
@@ -788,17 +788,17 @@ nsFolderCompactState::OnDataAvailable(ns
         }
         int32_t oldKeywordSize = blockOffset - preKeywordBlockOffset;
 
         // rewrite the headers up to and including the x-mozilla-status2 header
         m_fileStream->Write(m_dataBuffer, preKeywordBlockOffset, &writeCount);
         // let's just rewrite all the keywords on several lines and add a blank line,
         // instead of worrying about which are missing.
         bool done = false;
-        nsCAutoString keywordHdr(HEADER_X_MOZILLA_KEYWORDS ": ");
+        nsAutoCString keywordHdr(HEADER_X_MOZILLA_KEYWORDS ": ");
         int32_t nextBlankOffset = 0;
         int32_t curHdrLineStart = 0;
         int32_t newKeywordSize = 0;
         while (!done)
         {
           nextBlankOffset = msgHdrKeywords.FindChar(' ', nextBlankOffset);
           if (nextBlankOffset == kNotFound)
           {
--- a/mailnews/base/src/nsMsgFolderDataSource.cpp
+++ b/mailnews/base/src/nsMsgFolderDataSource.cpp
@@ -2109,17 +2109,17 @@ nsMsgFlatFolderDataSource::~nsMsgFlatFol
 {
 }
 
 nsresult nsMsgFlatFolderDataSource::Init()
 {
   nsIRDFService* rdf = getRDFService();
   NS_ENSURE_TRUE(rdf, NS_ERROR_FAILURE);
   nsCOMPtr<nsIRDFResource> source;
-  nsCAutoString dsUri(m_dsName);
+  nsAutoCString dsUri(m_dsName);
   dsUri.Append(":/");
   rdf->GetResource(dsUri, getter_AddRefs(m_rootResource));
 
   return nsMsgFolderDataSource::Init();
 }
 
 void nsMsgFlatFolderDataSource::Cleanup()
 {
@@ -2208,17 +2208,17 @@ void nsMsgFlatFolderDataSource::EnsureFo
       }
     }
   }
 }
 
 
 NS_IMETHODIMP nsMsgFlatFolderDataSource::GetURI(char* *aUri)
 {
-  nsCAutoString uri("rdf:");
+  nsAutoCString uri("rdf:");
   uri.Append(m_dsName);
   return (*aUri = ToNewCString(uri))
     ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 NS_IMETHODIMP nsMsgFlatFolderDataSource::HasAssertion(nsIRDFResource* source,
                             nsIRDFResource* property,
                             nsIRDFNode* target,
--- a/mailnews/base/src/nsMsgFolderDataSource.h
+++ b/mailnews/base/src/nsMsgFolderDataSource.h
@@ -159,17 +159,17 @@ protected:
                         nsIMsgWindow *window);
 
   nsresult DoFolderAssert(nsIMsgFolder *folder, nsIRDFResource *property, nsIRDFNode *target);
   nsresult DoFolderUnassert(nsIMsgFolder *folder, nsIRDFResource *property, nsIRDFNode *target);
 
   nsresult DoFolderHasAssertion(nsIMsgFolder *folder, nsIRDFResource *property, nsIRDFNode *target,
                                 bool tv, bool *hasAssertion);
 
-  nsresult GetBiffStateString(uint32_t biffState, nsCAutoString & biffStateStr);
+  nsresult GetBiffStateString(uint32_t biffState, nsAutoCString & biffStateStr);
 
   nsresult CreateUnreadMessagesNameString(int32_t unreadMessages, nsAutoString &nameString);
   nsresult CreateArcsOutEnumerator();
 
   virtual nsresult OnItemAddedOrRemoved(nsIMsgFolder *parentItem, nsISupports *item, bool added);
 
   nsresult OnUnreadMessagePropertyChanged(nsIRDFResource *folderResource, int32_t oldValue, int32_t newValue);
   nsresult OnTotalMessagePropertyChanged(nsIRDFResource *folderResource, int32_t oldValue, int32_t newValue);
--- a/mailnews/base/src/nsMsgMailSession.cpp
+++ b/mailnews/base/src/nsMsgMailSession.cpp
@@ -414,17 +414,17 @@ nsMsgMailSession::ConvertMsgURIToMsgURL(
   nsCOMPtr <nsIMsgMessageService> msgService;
   nsresult rv = GetMessageServiceFromURI(nsDependentCString(aURI), getter_AddRefs(msgService));
   NS_ENSURE_SUCCESS(rv, NS_ERROR_NULL_POINTER);
 
   nsCOMPtr<nsIURI> tURI;
   rv = msgService->GetUrlForUri(aURI, getter_AddRefs(tURI), aMsgWindow);
   NS_ENSURE_SUCCESS(rv, NS_ERROR_NULL_POINTER);
 
-  nsCAutoString urlString;
+  nsAutoCString urlString;
   if (NS_SUCCEEDED(tURI->GetSpec(urlString)))
   {
     *aURL = ToNewCString(urlString);
     NS_ENSURE_ARG_POINTER(aURL);
   }
   return rv;
 }
 
@@ -440,17 +440,17 @@ nsMsgMailSession::GetSelectedLocaleDataD
   bool baseDirExists = false;
   nsresult rv = defaultsDir->Exists(&baseDirExists);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (baseDirExists) {
     nsCOMPtr<nsIXULChromeRegistry> packageRegistry =
       mozilla::services::GetXULChromeRegistryService();
     if (packageRegistry) {
-      nsCAutoString localeName;
+      nsAutoCString localeName;
       rv = packageRegistry->GetSelectedLocale(NS_LITERAL_CSTRING("global-region"), localeName);
 
       if (NS_SUCCEEDED(rv) && !localeName.IsEmpty()) {
         bool localeDirExists = false;
         nsCOMPtr<nsIFile> localeDataDir;
 
         rv = defaultsDir->Clone(getter_AddRefs(localeDataDir));
         NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/base/src/nsMsgPrintEngine.cpp
+++ b/mailnews/base/src/nsMsgPrintEngine.cpp
@@ -137,17 +137,17 @@ nsMsgPrintEngine::OnStateChange(nsIWebPr
           }
           nsCOMPtr<nsIChannel> aChannel = do_QueryInterface(aRequest);
           if (!aChannel) return NS_ERROR_FAILURE;
 
           // Make sure this isn't just "about:blank" finishing....
           nsCOMPtr<nsIURI> originalURI = nullptr;
           if (NS_SUCCEEDED(aChannel->GetOriginalURI(getter_AddRefs(originalURI))) && originalURI)
           {
-            nsCAutoString spec;
+            nsAutoCString spec;
 
             if (NS_SUCCEEDED(originalURI->GetSpec(spec)))
             {      
               if (spec.Equals("about:blank"))
               {
                 return StartNextPrintOperation();
               }
             }
--- a/mailnews/base/src/nsMsgPurgeService.cpp
+++ b/mailnews/base/src/nsMsgPurgeService.cpp
@@ -223,17 +223,17 @@ nsresult nsMsgPurgeService::PerformPurge
               }
             }
           }
         }
         nsCString type;
         nsresult rv = server->GetType(type);
         NS_ENSURE_SUCCESS(rv, rv);
 
-        nsCAutoString contractid(NS_MSGPROTOCOLINFO_CONTRACTID_PREFIX);
+        nsAutoCString contractid(NS_MSGPROTOCOLINFO_CONTRACTID_PREFIX);
         contractid.Append(type);
 
         nsCOMPtr<nsIMsgProtocolInfo> protocolInfo =
           do_GetService(contractid.get(), &rv);
         NS_ENSURE_SUCCESS(rv, NS_OK);
 
         nsCString realHostName;
         server->GetRealHostName(realHostName);
--- a/mailnews/base/src/nsMsgSearchDBView.cpp
+++ b/mailnews/base/src/nsMsgSearchDBView.cpp
@@ -1253,31 +1253,31 @@ nsMsgViewIndex nsMsgSearchDBView::FindHd
 // first by looking up the message id, then references, and finally, if subject
 // threading is turned on, the subject.
 nsresult nsMsgSearchDBView::GetXFThreadFromMsgHdr(nsIMsgDBHdr *msgHdr, 
                                                   nsIMsgThread **pThread,
                                                   bool *foundByMessageId)
 {
   NS_ENSURE_ARG_POINTER(pThread);
 
-  nsCAutoString messageId;
+  nsAutoCString messageId;
   msgHdr->GetMessageId(getter_Copies(messageId));
   *pThread = nullptr;
   m_threadsTable.Get(messageId, pThread);
   // The caller may want to know if we found the thread by the msgHdr's
   // messageId
   if (foundByMessageId)
     *foundByMessageId = *pThread != nullptr;
   if (!*pThread)
   {
     uint16_t numReferences = 0;
     msgHdr->GetNumReferences(&numReferences);
     for (int32_t i = numReferences - 1; i >= 0  && !*pThread; i--)
     {
-      nsCAutoString reference;
+      nsAutoCString reference;
       
       msgHdr->GetStringReference(i, reference);
       if (reference.IsEmpty())
         break;
 
       m_threadsTable.Get(reference, pThread);
     }
   }
@@ -1324,17 +1324,17 @@ nsresult nsMsgSearchDBView::AddMsgToHash
   NS_ENSURE_ARG_POINTER(msgHdr);
 
   uint16_t numReferences = 0;
   nsresult rv;
 
   msgHdr->GetNumReferences(&numReferences);
   for (int32_t i = 0; i < numReferences; i++)
   {
-    nsCAutoString reference;
+    nsAutoCString reference;
 
     msgHdr->GetStringReference(i, reference);
     if (reference.IsEmpty())
       break;
 
     rv = AddRefToHash(reference, thread);
     NS_ENSURE_SUCCESS(rv, rv);
   }
@@ -1364,17 +1364,17 @@ nsresult nsMsgSearchDBView::RemoveMsgFro
 
   uint16_t numReferences = 0;
   nsresult rv = NS_OK;
 
   msgHdr->GetNumReferences(&numReferences);
 
   for (int32_t i = 0; i < numReferences; i++)
   {
-    nsCAutoString reference;
+    nsAutoCString reference;
     msgHdr->GetStringReference(i, reference);
     if (reference.IsEmpty())
       break;
 
     rv = RemoveRefFromHash(reference);
     if (NS_FAILED(rv))
       break;
   }
--- a/mailnews/base/src/nsMsgServiceProvider.cpp
+++ b/mailnews/base/src/nsMsgServiceProvider.cpp
@@ -102,17 +102,17 @@ void nsMsgServiceProviderService::LoadIS
   // we only care about the .rdf files in this directory
   nsCOMPtr<nsIFile> file;
   while (NS_SUCCEEDED(files->GetNextFile(getter_AddRefs(file))) && file) {
     nsAutoString leafName;
     file->GetLeafName(leafName);
     if (!StringEndsWith(leafName, NS_LITERAL_STRING(".rdf")))
       continue;
 
-    nsCAutoString urlSpec;
+    nsAutoCString urlSpec;
     rv = NS_GetURLSpecFromFile(file, urlSpec);
     if (NS_SUCCEEDED(rv))
       LoadDataSource(urlSpec.get());
   }
 }
 
 nsresult
 nsMsgServiceProviderService::LoadDataSource(const char *aURI)
--- a/mailnews/base/src/nsMsgTagService.cpp
+++ b/mailnews/base/src/nsMsgTagService.cpp
@@ -50,17 +50,17 @@ CompareMsgTags(const void* aTagPref1, co
   if (!element1 && !element2)
     return TAG_CMP_EQUAL;
   if (!element2)
     return TAG_CMP_LESSER;
   if (!element1)
     return TAG_CMP_GREATER;
 
   // only use the key if the ordinal is not defined or empty
-  nsCAutoString value1, value2;
+  nsAutoCString value1, value2;
   element1->GetOrdinal(value1);
   if (value1.IsEmpty())
     element1->GetKey(value1);
   element2->GetOrdinal(value2);
   if (value2.IsEmpty())
     element2->GetKey(value2);
 
   return strcmp(value1.get(), value2.get());
@@ -135,27 +135,27 @@ nsMsgTagService::nsMsgTagService()
 nsMsgTagService::~nsMsgTagService()
 {
   /* destructor code */
 }
 
 /* wstring getTagForKey (in string key); */
 NS_IMETHODIMP nsMsgTagService::GetTagForKey(const nsACString &key, nsAString &_retval)
 {
-  nsCAutoString prefName(key);
+  nsAutoCString prefName(key);
   if (!gMigratingKeys)
     ToLowerCase(prefName);
   prefName.AppendLiteral(TAG_PREF_SUFFIX_TAG);
   return GetUnicharPref(prefName.get(), _retval);
 }
 
 /* void setTagForKey (in string key); */
 NS_IMETHODIMP nsMsgTagService::SetTagForKey(const nsACString &key, const nsAString &tag )
 {
-  nsCAutoString prefName(key);
+  nsAutoCString prefName(key);
   ToLowerCase(prefName);
   prefName.AppendLiteral(TAG_PREF_SUFFIX_TAG);
   return SetUnicharPref(prefName.get(), tag);
 }
 
 /* void getKeyForTag (in wstring tag); */
 NS_IMETHODIMP nsMsgTagService::GetKeyForTag(const nsAString &aTag, nsACString &aKey)
 {
@@ -223,17 +223,17 @@ NS_IMETHODIMP nsMsgTagService::GetTopKey
 }
 
 /* void addTagForKey (in string key, in wstring tag, in string color, in string ordinal); */
 NS_IMETHODIMP nsMsgTagService::AddTagForKey(const nsACString &key,
                                             const nsAString  &tag,
                                             const nsACString &color,
                                             const nsACString &ordinal)
 {
-  nsCAutoString prefName(key);
+  nsAutoCString prefName(key);
   ToLowerCase(prefName);
   prefName.AppendLiteral(TAG_PREF_SUFFIX_TAG);
   nsresult rv = SetUnicharPref(prefName.get(), tag);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = SetColorForKey(key, color);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = RefreshKeyCache();
   NS_ENSURE_SUCCESS(rv, rv);
@@ -247,94 +247,94 @@ NS_IMETHODIMP nsMsgTagService::AddTag(co
 {
   // figure out key from tag. Apply transformation stripping out
   // illegal characters like <SP> and then convert to imap mod utf7.
   // Then, check if we have a tag with that key yet, and if so,
   // make it unique by appending A, AA, etc.
   // Should we use an iterator?
   nsAutoString transformedTag(tag);
   MsgReplaceChar(transformedTag, " ()/{%*<>\\\"", '_');
-  nsCAutoString key;
+  nsAutoCString key;
   CopyUTF16toMUTF7(transformedTag, key);
   // We have an imap server that converts keys to upper case so we're going
   // to normalize all keys to lower case (upper case looks ugly in prefs.js)
   ToLowerCase(key);
-  nsCAutoString prefName(key);
+  nsAutoCString prefName(key);
   while (true)
   {
     nsAutoString tagValue;
     nsresult rv = GetTagForKey(prefName, tagValue);
     if (NS_FAILED(rv) || tagValue.IsEmpty() || tagValue.Equals(tag))
       return AddTagForKey(prefName, tag, color, ordinal);
     prefName.Append('A');
   }
   NS_ASSERTION(false, "can't get here");
   return NS_ERROR_FAILURE;
 }
 
 /* long getColorForKey (in string key); */
 NS_IMETHODIMP nsMsgTagService::GetColorForKey(const nsACString &key, nsACString  &_retval)
 {
-  nsCAutoString prefName(key);
+  nsAutoCString prefName(key);
   if (!gMigratingKeys)
     ToLowerCase(prefName);
   prefName.AppendLiteral(TAG_PREF_SUFFIX_COLOR);
   nsCString color;
   nsresult rv = m_tagPrefBranch->GetCharPref(prefName.get(), getter_Copies(color));
   if (NS_SUCCEEDED(rv))
     _retval = color;
   return NS_OK;
 }
 
 /* void setColorForKey (in ACString key, in ACString color); */
 NS_IMETHODIMP nsMsgTagService::SetColorForKey(const nsACString & key, const nsACString & color)
 {
-  nsCAutoString prefName(key);
+  nsAutoCString prefName(key);
   ToLowerCase(prefName);
   prefName.AppendLiteral(TAG_PREF_SUFFIX_COLOR);
   if (color.IsEmpty())
   {
     m_tagPrefBranch->ClearUserPref(prefName.get());
     return NS_OK;
   }
   return m_tagPrefBranch->SetCharPref(prefName.get(), nsCString(color).get());
 }
 
 /* ACString getOrdinalForKey (in ACString key); */
 NS_IMETHODIMP nsMsgTagService::GetOrdinalForKey(const nsACString & key, nsACString & _retval)
 {
-  nsCAutoString prefName(key);
+  nsAutoCString prefName(key);
   if (!gMigratingKeys)
     ToLowerCase(prefName);
   prefName.AppendLiteral(TAG_PREF_SUFFIX_ORDINAL);
   nsCString ordinal;
   nsresult rv = m_tagPrefBranch->GetCharPref(prefName.get(), getter_Copies(ordinal));
   _retval = ordinal;
   return rv;
 }
 
 /* void setOrdinalForKey (in ACString key, in ACString ordinal); */
 NS_IMETHODIMP nsMsgTagService::SetOrdinalForKey(const nsACString & key, const nsACString & ordinal)
 {
-  nsCAutoString prefName(key);
+  nsAutoCString prefName(key);
   ToLowerCase(prefName);
   prefName.AppendLiteral(TAG_PREF_SUFFIX_ORDINAL);
   if (ordinal.IsEmpty())
   {
     m_tagPrefBranch->ClearUserPref(prefName.get());
     return NS_OK;
   }
   return m_tagPrefBranch->SetCharPref(prefName.get(), nsCString(ordinal).get());
 }
 
 /* void deleteTag (in wstring tag); */
 NS_IMETHODIMP nsMsgTagService::DeleteKey(const nsACString &key)
 {
   // clear the associated prefs
-  nsCAutoString prefName(key);
+  nsAutoCString prefName(key);
   if (!gMigratingKeys)
     ToLowerCase(prefName);
   nsresult rv = m_tagPrefBranch->DeleteBranch(prefName.get());
   NS_ENSURE_SUCCESS(rv, rv);
   return RefreshKeyCache();
 }
 
 /* void getAllTags (out unsigned long count, [array, size_is (count), retval] out nsIMsgTag tagArray); */
@@ -370,17 +370,17 @@ NS_IMETHODIMP nsMsgTagService::GetAllTag
   nsString tag;
   nsCString lastKey, color, ordinal;
   for (uint32_t i = prefCount; i--;)
   {
     // extract just the key from <key>.<info=tag|color|ordinal>
     char *info = strrchr(prefList[i], '.');
     if (info)
     {
-      nsCAutoString key(Substring(prefList[i], info));
+      nsAutoCString key(Substring(prefList[i], info));
       if (key != lastKey)
       {
         if (!key.IsEmpty())
         {
           // .tag MUST exist (but may be empty)
           rv = GetTagForKey(key, tag);
           if (NS_SUCCEEDED(rv))
           {
@@ -475,17 +475,17 @@ nsresult nsMsgTagService::MigrateLabelsT
   {
     gMigratingKeys = true;
   // need to convert the keys to lower case
     nsIMsgTag **tagArray;
     uint32_t numTags;
     GetAllTags(&numTags, &tagArray);
     for (uint32_t tagIndex = 0; tagIndex < numTags; tagIndex++)
     {
-      nsCAutoString key, color, ordinal;
+      nsAutoCString key, color, ordinal;
       nsAutoString tagStr;
       nsIMsgTag *tag = tagArray[tagIndex];
       tag->GetKey(key);
       tag->GetTag(tagStr);
       tag->GetOrdinal(ordinal);
       tag->GetColor(color);
       DeleteKey(key);
       ToLowerCase(key);
@@ -494,17 +494,17 @@ nsresult nsMsgTagService::MigrateLabelsT
     NS_FREE_XPCOM_ISUPPORTS_POINTER_ARRAY(numTags, tagArray);
     gMigratingKeys = false;
   }
   else 
   {
     nsCOMPtr<nsIPrefBranch> prefRoot(do_GetService(NS_PREFSERVICE_CONTRACTID));
     nsCOMPtr<nsIPrefLocalizedString> pls;
     nsString ucsval;
-    nsCAutoString labelKey("$label1");
+    nsAutoCString labelKey("$label1");
     for(int32_t i = 0; i < PREF_LABELS_MAX; )
     {
       prefString.Assign(PREF_LABELS_DESCRIPTION);
       prefString.AppendInt(i + 1);
       rv = prefRoot->GetComplexValue(prefString.get(),
                                      NS_GET_IID(nsIPrefLocalizedString),
                                      getter_AddRefs(pls));
       NS_ENSURE_SUCCESS(rv, rv);
@@ -543,17 +543,17 @@ nsresult nsMsgTagService::RefreshKeyCach
 
   for (uint32_t tagIndex = 0; tagIndex < numTags; tagIndex++)
   {
     nsIMsgTag *tag = tagArray[tagIndex];
     if (!tag) {
       rv = NS_ERROR_FAILURE;
       break;
     }
-    nsCAutoString key;
+    nsAutoCString key;
     tag->GetKey(key);
     if (!m_keys.InsertElementAt(tagIndex, key)) {
       rv = NS_ERROR_FAILURE;
       break;
     }
   }
   NS_FREE_XPCOM_ISUPPORTS_POINTER_ARRAY(numTags, tagArray);
   return rv;
--- a/mailnews/base/src/nsMsgXFViewThread.cpp
+++ b/mailnews/base/src/nsMsgXFViewThread.cpp
@@ -128,17 +128,17 @@ nsresult nsMsgXFViewThread::AddHdr(nsIMs
   // to this thread.
   uint16_t numReferences;
   newHdr->GetNumReferences(&numReferences);
   nsCOMPtr<nsIMsgDBHdr> parent;
   int32_t parentIndex;
 
   for (int32_t i = numReferences - 1; i >= 0;  i--)
   {
-    nsCAutoString reference;
+    nsAutoCString reference;
     newHdr->GetStringReference(i, reference);
     if (reference.IsEmpty())
       break;
 
     // I could look for the thread from the reference, but getting
     // the header directly should be fine. If it's not, that means
     // that the parent isn't in this thread, though it should be.
     m_view->GetMsgHdrFromHash(reference, getter_AddRefs(parent));
@@ -370,17 +370,17 @@ void nsMsgXFViewThread::ChangeChildCount
   m_numChildren += delta;
 }
 
 bool nsMsgXFViewThread::IsHdrParentOf(nsIMsgDBHdr *possibleParent, 
                                         nsIMsgDBHdr *possibleChild)
 {
   uint16_t referenceToCheck = 0;
   possibleChild->GetNumReferences(&referenceToCheck);
-  nsCAutoString reference;
+  nsAutoCString reference;
 
   nsCString messageId;
   possibleParent->GetMessageId(getter_Copies(messageId));
 
   while (referenceToCheck > 0)
   {
     possibleChild->GetStringReference(referenceToCheck - 1, reference);
 
--- a/mailnews/base/src/nsSpamSettings.cpp
+++ b/mailnews/base/src/nsSpamSettings.cpp
@@ -355,17 +355,17 @@ NS_IMETHODIMP nsSpamSettings::Initialize
     nsCOMPtr<nsIMsgAccountManager>
       accountManager(do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv));
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsIMsgAccount> account;
     rv = accountManager->FindAccountForServer(aServer, getter_AddRefs(account));
     NS_ENSURE_SUCCESS(rv, rv);
 
-    nsCAutoString accountKey;
+    nsAutoCString accountKey;
     if (account) 
       account->GetKey(accountKey);
 
     // Loop through all accounts, adding emails from this account, as well as
     // from any accounts that defer to this account.
     mEmails.Clear();
     nsCOMPtr<nsISupportsArray> accounts;
     rv = accountManager->GetAccounts(getter_AddRefs(accounts));
@@ -374,21 +374,21 @@ NS_IMETHODIMP nsSpamSettings::Initialize
     if (account && accounts) // no sense scanning accounts if we've nothing to match
       accounts->Count(&accountCount);
 
     for (uint32_t i = 0; i < accountCount; i++)
     {
       nsCOMPtr<nsIMsgAccount> loopAccount(do_QueryElementAt(accounts, i));
       if (!loopAccount)
         continue;
-      nsCAutoString loopAccountKey;
+      nsAutoCString loopAccountKey;
       loopAccount->GetKey(loopAccountKey);
       nsCOMPtr<nsIMsgIncomingServer> loopServer;
       loopAccount->GetIncomingServer(getter_AddRefs(loopServer));
-      nsCAutoString deferredToAccountKey;
+      nsAutoCString deferredToAccountKey;
       if (loopServer)
         loopServer->GetCharValue("deferred_to_account", deferredToAccountKey);
 
       // Add the emails for any account that defers to this one, or for the
       // account itself.
       if (accountKey.Equals(deferredToAccountKey) || accountKey.Equals(loopAccountKey))
       {
         nsCOMPtr<nsISupportsArray> identities;
@@ -397,17 +397,17 @@ NS_IMETHODIMP nsSpamSettings::Initialize
           continue;
         uint32_t identityCount = 0;
         identities->Count(&identityCount);
         for (uint32_t j = 0; j < identityCount; ++j)
         {
           nsCOMPtr<nsIMsgIdentity> identity(do_QueryElementAt(identities, j));
           if (!identity)
             continue;
-          nsCAutoString email;
+          nsAutoCString email;
           identity->GetEmail(email);
           if (!email.IsEmpty())
             mEmails.AppendElement(email);
         }
       }
     }
   }
 
@@ -575,17 +575,17 @@ NS_IMETHODIMP nsSpamSettings::SetServerF
 }
 
 NS_IMETHODIMP nsSpamSettings::GetServerFilterFile(nsIFile ** aFile)
 {
   NS_ENSURE_ARG_POINTER(aFile);
   if (!mServerFilterFile)
   {
     nsresult rv;
-    nsCAutoString serverFilterFileName;
+    nsAutoCString serverFilterFileName;
     GetServerFilterName(serverFilterFileName);
     serverFilterFileName.Append(".sfd");
 
     nsCOMPtr<nsIProperties> dirSvc = do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Walk through the list of isp directories
     nsCOMPtr<nsISimpleEnumerator> ispDirectories;
@@ -795,17 +795,17 @@ NS_IMETHODIMP nsSpamSettings::CheckWhite
 
   nsCString author;
   aMsgHdr->GetAuthor(getter_Copies(author));
   nsresult rv;
   nsCOMPtr<nsIMsgHeaderParser> headerParser =
     do_GetService(NS_MAILNEWS_MIME_HEADER_PARSER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString authorEmailAddress;
+  nsAutoCString authorEmailAddress;
   rv = headerParser->ExtractHeaderAddressMailboxes(author, authorEmailAddress);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (authorEmailAddress.IsEmpty())
     return NS_OK;
 
   // should we skip whitelisting for the identity email?
   if (mInhibitWhiteListingIdentityUser)
@@ -814,34 +814,34 @@ NS_IMETHODIMP nsSpamSettings::CheckWhite
     {
       if (mEmails[i].Equals(authorEmailAddress, nsCaseInsensitiveCStringComparator()))
         return NS_OK;
     }
   }
 
   if (!mTrustedMailDomains.IsEmpty() || mInhibitWhiteListingIdentityDomain)
   {
-    nsCAutoString domain;
+    nsAutoCString domain;
     int32_t atPos = authorEmailAddress.FindChar('@');
     if (atPos >= 0)
       domain = Substring(authorEmailAddress, atPos + 1);
     if (!domain.IsEmpty())
     {
       if (!mTrustedMailDomains.IsEmpty() &&
           MsgHostDomainIsTrusted(domain, mTrustedMailDomains))
       {
         *aResult = true;
         return NS_OK;
       }
 
       if (mInhibitWhiteListingIdentityDomain)
       {
         for (uint32_t i = 0; i < mEmails.Length(); ++i)
         {
-          nsCAutoString identityDomain;
+          nsAutoCString identityDomain;
           int32_t atPos = mEmails[i].FindChar('@');
           if (atPos >= 0)
           {
             identityDomain = Substring(mEmails[i], atPos + 1);
             if (identityDomain.Equals(domain, nsCaseInsensitiveCStringComparator()))
               return NS_OK; // don't whitelist
           }
         }
--- a/mailnews/base/src/nsSubscribableServer.cpp
+++ b/mailnews/base/src/nsSubscribableServer.cpp
@@ -200,22 +200,22 @@ nsSubscribableServer::NotifyAssert(Subsc
     NS_ENSURE_SUCCESS(rv,rv);
     rv = mSubscribeDS->GetHasObservers(&hasObservers);
     NS_ENSURE_SUCCESS(rv,rv);
     // no need to do all this work, there are no observers
     if (!hasObservers) {
         return NS_OK;
     }
 
-    nsCAutoString subjectUri;
+    nsAutoCString subjectUri;
     BuildURIFromNode(subjectNode, subjectUri);
 
     // we could optimize this, since we know that objectUri == subjectUri + mDelimiter + object->name
     // is it worth it?
-    nsCAutoString objectUri;
+    nsAutoCString objectUri;
     BuildURIFromNode(objectNode, objectUri);
 
     nsCOMPtr <nsIRDFResource> subject;
     nsCOMPtr <nsIRDFResource> object;
 
     rv = EnsureRDFService();
     NS_ENSURE_SUCCESS(rv,rv);
 
@@ -254,17 +254,17 @@ nsSubscribableServer::NotifyChange(Subsc
     NS_ENSURE_SUCCESS(rv,rv);
     rv = mSubscribeDS->GetHasObservers(&hasObservers);
     NS_ENSURE_SUCCESS(rv,rv);
     // no need to do all this work, there are no observers
     if (!hasObservers) {
         return NS_OK;
     }
 
-    nsCAutoString subjectUri;
+    nsAutoCString subjectUri;
     BuildURIFromNode(subjectNode, subjectUri);
 
     rv = EnsureRDFService();
     NS_ENSURE_SUCCESS(rv,rv);
 
     rv = mRDFService->GetResource(subjectUri, getter_AddRefs(subject));
     NS_ENSURE_SUCCESS(rv,rv);
 
@@ -732,17 +732,17 @@ nsSubscribableServer::GetChildren(const 
     SubscribeTreeNode *node = nullptr;
     nsresult rv = FindAndCreateNode(aPath, &node);
     NS_ENSURE_SUCCESS(rv, rv);
 
     NS_ASSERTION(node,"didn't find the node");
     if (!node)
       return NS_ERROR_FAILURE;
 
-    nsCAutoString uriPrefix;
+    nsAutoCString uriPrefix;
     NS_ASSERTION(mTreeRoot, "no tree root!");
     if (!mTreeRoot)
       return NS_ERROR_UNEXPECTED;
 
     uriPrefix = mTreeRoot->name; // the root's name is the server uri
     uriPrefix += "/";
     if (!aPath.IsEmpty()) {
         uriPrefix += aPath;
@@ -755,17 +755,17 @@ nsSubscribableServer::GetChildren(const 
     SubscribeTreeNode *current = node->lastChild;
     // return failure if there are no children.
     if (!current)
       return NS_ERROR_FAILURE;
 
     nsCOMArray<nsIRDFResource> result;
 
     while (current) {
-        nsCAutoString uri;
+        nsAutoCString uri;
         uri = uriPrefix;
         NS_ASSERTION(current->name, "no name");
         if (!current->name)
           return NS_ERROR_FAILURE;
 
         uri += current->name;
 
         nsCOMPtr <nsIRDFResource> res;
--- a/mailnews/base/util/nsMsgDBFolder.cpp
+++ b/mailnews/base/util/nsMsgDBFolder.cpp
@@ -272,17 +272,17 @@ NS_IMETHODIMP nsMsgDBFolder::CloseAndBac
   bool backupExists;
   backupDBFile->Exists(&backupExists);
   NS_ASSERTION(!backupExists, "Couldn't delete database backup");
   if (backupExists)
     return NS_ERROR_FAILURE;
 
   if (!newName.IsEmpty())
   {
-    nsCAutoString backupName;
+    nsAutoCString backupName;
     rv = backupDBFile->GetNativeLeafName(backupName);
     NS_ENSURE_SUCCESS(rv, rv);
     return dbFile->CopyToNative(backupDir, backupName);
   }
   else
     return dbFile->CopyToNative(backupDir, EmptyCString());
 }
 
@@ -1611,17 +1611,17 @@ NS_IMETHODIMP nsMsgDBFolder::IsCommandEn
 {
   NS_ENSURE_ARG_POINTER(result);
   *result = true;
   return NS_OK;
 }
 
 nsresult nsMsgDBFolder::WriteStartOfNewLocalMessage()
 {
-  nsCAutoString result;
+  nsAutoCString result;
   uint32_t writeCount;
   time_t now = time ((time_t*) 0);
   char *ct = ctime(&now);
   ct[24] = 0;
   result = "From - ";
   result += ct;
   result += MSG_LINEBREAK;
   m_bytesAddedToLocalMsg = result.Length();
@@ -1721,17 +1721,17 @@ nsresult nsMsgDBFolder::EndNewOfflineMes
        {
          m_tempMessageStream->Close();
          m_tempMessageStream = nullptr;
          ReleaseSemaphore(static_cast<nsIMsgFolder*>(this));
          if (msgStore)
            msgStore->DiscardNewMessage(m_tempMessageStream, m_offlineHeader);
        }
 #ifdef _DEBUG
-       nsCAutoString message("Offline message too small: messageSize=");
+       nsAutoCString message("Offline message too small: messageSize=");
        message.AppendInt(messageSize);
        message.Append(" curStorePos=");
        message.AppendInt(curStorePos);
        message.Append(" numOfflineMsgLines=");
        message.AppendInt(m_numOfflineMsgLines);
        NS_ERROR(message.get());
 #endif
     }
@@ -2162,28 +2162,28 @@ nsMsgDBFolder::SetStringProperty(const c
   return NS_OK;
 }
 
 // Get/Set ForcePropertyEmpty is only used with inherited properties
 NS_IMETHODIMP
 nsMsgDBFolder::GetForcePropertyEmpty(const char *aPropertyName, bool *_retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
-  nsCAutoString nameEmpty(aPropertyName);
+  nsAutoCString nameEmpty(aPropertyName);
   nameEmpty.Append(NS_LITERAL_CSTRING(".empty"));
   nsCString value;
   GetStringProperty(nameEmpty.get(), value);
   *_retval = value.EqualsLiteral("true");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgDBFolder::SetForcePropertyEmpty(const char *aPropertyName, bool aValue)
 {
- nsCAutoString nameEmpty(aPropertyName);
+ nsAutoCString nameEmpty(aPropertyName);
  nameEmpty.Append(NS_LITERAL_CSTRING(".empty"));
  return SetStringProperty(nameEmpty.get(),
    aValue ? NS_LITERAL_CSTRING("true") : NS_LITERAL_CSTRING(""));
 }
 
 NS_IMETHODIMP
 nsMsgDBFolder::GetInheritedStringProperty(const char *aPropertyName, nsACString& aPropertyValue)
 {
@@ -2356,24 +2356,24 @@ nsMsgDBFolder::OnMessageClassified(const
   uint32_t processingFlags;
   GetProcessingFlags(msgKey, &processingFlags);
 
   if (processingFlags & nsMsgProcessingFlags::ClassifyJunk)
   {
     mClassifiedMsgKeys.AppendElement(msgKey);
     AndProcessingFlags(msgKey, ~nsMsgProcessingFlags::ClassifyJunk);
 
-    nsCAutoString msgJunkScore;
+    nsAutoCString msgJunkScore;
     msgJunkScore.AppendInt(aClassification == nsIJunkMailPlugin::JUNK ?
           nsIJunkMailPlugin::IS_SPAM_SCORE:
           nsIJunkMailPlugin::IS_HAM_SCORE);
     mDatabase->SetStringProperty(msgKey, "junkscore", msgJunkScore.get());
     mDatabase->SetStringProperty(msgKey, "junkscoreorigin", "plugin");
 
-    nsCAutoString strPercent;
+    nsAutoCString strPercent;
     strPercent.AppendInt(aJunkPercent);
     mDatabase->SetStringProperty(msgKey, "junkpercent", strPercent.get());
 
     if (aClassification == nsIJunkMailPlugin::JUNK)
     {
       // IMAP has its own way of marking read.
       if (!(mFlags & nsMsgFolderFlags::ImapBox))
       {
@@ -2424,20 +2424,20 @@ nsMsgDBFolder::OnMessageTraitsClassified
   nsCOMPtr<nsIMsgTraitService> traitService;
   traitService = do_GetService("@mozilla.org/msg-trait-service;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   for (uint32_t i = 0; i < aTraitCount; i++)
   {
     if (aTraits[i] == nsIJunkMailPlugin::JUNK_TRAIT)
       continue; // junk is processed by the junk listener
-    nsCAutoString traitId;
+    nsAutoCString traitId;
     rv = traitService->GetId(aTraits[i], traitId);
     traitId.Insert(NS_LITERAL_CSTRING("bayespercent/"), 0);
-    nsCAutoString strPercent;
+    nsAutoCString strPercent;
     strPercent.AppendInt(aPercents[i]);
     mDatabase->SetStringPropertyByHdr(msgHdr, traitId.get(), strPercent.get());
   }
   return NS_OK;
 }
 
 /**
  * Call the filter plugins (XXX currently just one)
@@ -2505,17 +2505,17 @@ nsMsgDBFolder::CallFilterPlugins(nsIMsgW
   /*
    * We'll use inherited folder properties for the junk trait to override the
    * standard server-based activation of junk processing. This provides a
    * hook for extensions to customize the application of junk filtering.
    * Set inherited property "dobayes.mailnews@mozilla.org#junk" to "true"
    * to force junk processing, and "false" to skip junk processing.
    */
 
-  nsCAutoString junkEnableOverride;
+  nsAutoCString junkEnableOverride;
   GetInheritedStringProperty("dobayes.mailnews@mozilla.org#junk", junkEnableOverride);
   if (junkEnableOverride.EqualsLiteral("true"))
     filterForJunk = true;
   else if (junkEnableOverride.EqualsLiteral("false"))
     filterForJunk = false;
 
   bool userHasClassified = false;
   // if the user has not classified any messages yet, then we shouldn't bother
@@ -2552,21 +2552,21 @@ nsMsgDBFolder::CallFilterPlugins(nsIMsgW
       // the string value "false"
       //
       // If any non-junk traits are active on the folder, then the bayes
       // processing will calculate probabilities for all enabled traits.
 
       if (proIndices[i] != nsIJunkMailPlugin::JUNK_TRAIT)
       {
         filterForOther = true;
-        nsCAutoString traitId;
-        nsCAutoString property("dobayes.");
+        nsAutoCString traitId;
+        nsAutoCString property("dobayes.");
         traitService->GetId(proIndices[i], traitId);
         property.Append(traitId);
-        nsCAutoString isEnabledOnFolder;
+        nsAutoCString isEnabledOnFolder;
         GetInheritedStringProperty(property.get(), isEnabledOnFolder);
         if (isEnabledOnFolder.EqualsLiteral("false"))
           filterForOther = false;
         // We might have to allow a "true" override in the future, but
         // for now there is no way for that to affect the processing
         break;
       }
     }
@@ -2650,17 +2650,17 @@ nsMsgDBFolder::CallFilterPlugins(nsIMsgW
         break;
 
       bool whiteListMessage = false;
       spamSettings->CheckWhiteList(msgHdr, &whiteListMessage);
       if (whiteListMessage)
       {
         // mark this msg as non-junk, because we whitelisted it.
 
-        nsCAutoString msgJunkScore;
+        nsAutoCString msgJunkScore;
         msgJunkScore.AppendInt(nsIJunkMailPlugin::IS_HAM_SCORE);
         mDatabase->SetStringProperty(msgKey, "junkscore", msgJunkScore.get());
         mDatabase->SetStringProperty(msgKey, "junkscoreorigin", "whitelist");
         break; // skip this msg since it's in the white list
       }
       filterMessageForJunk = true;
 
       OrProcessingFlags(msgKey, nsMsgProcessingFlags::ClassifyJunk);
@@ -2976,17 +2976,17 @@ nsMsgDBFolder::FindSubFolder(const nsACS
 {
   nsresult rv = NS_OK;
   nsCOMPtr<nsIRDFService> rdf(do_GetService(kRDFServiceCID, &rv));
 
   if (NS_FAILED(rv))
     return rv;
 
   // XXX use necko here
-  nsCAutoString uri;
+  nsAutoCString uri;
   uri.Append(mURI);
   uri.Append('/');
   uri.Append(aEscapedSubFolderName);
 
   nsCOMPtr<nsIRDFResource> res;
   rv = rdf->GetResource(uri, getter_AddRefs(res));
   if (NS_FAILED(rv))
     return rv;
@@ -3103,30 +3103,30 @@ nsMsgDBFolder::parseURI(bool needServer)
   url = do_CreateInstance(NS_STANDARDURL_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = url->SetSpec(mURI);
   NS_ENSURE_SUCCESS(rv, rv);
   // empty path tells us it's a server.
   if (!mIsServerIsValid)
   {
-    nsCAutoString path;
+    nsAutoCString path;
     rv = url->GetPath(path);
     if (NS_SUCCEEDED(rv))
       mIsServer = path.EqualsLiteral("/");
     mIsServerIsValid = true;
   }
 
   // grab the name off the leaf of the server
   if (mName.IsEmpty())
   {
     // mName:
     // the name is the trailing directory in the path
-    nsCAutoString fileName;
-    nsCAutoString escapedFileName;
+    nsAutoCString fileName;
+    nsAutoCString escapedFileName;
     url->GetFileName(escapedFileName);
     if (!escapedFileName.IsEmpty())
     {
       // XXX conversion to unicode here? is fileName in UTF8?
       // yes, let's say it is in utf8
       MsgUnescapeString(escapedFileName, 0, fileName);
       NS_ASSERTION(MsgIsUTF8(fileName), "fileName is not in UTF-8");
       CopyUTF8toUTF16(fileName, mName);
@@ -3167,32 +3167,32 @@ nsMsgDBFolder::parseURI(bool needServer)
       NS_ENSURE_SUCCESS(rv, rv);
     }
     mServer = do_GetWeakReference(server);
   } /* !mServer */
 
   // now try to find the local path for this folder
   if (server)
   {
-    nsCAutoString newPath;
-    nsCAutoString escapedUrlPath;
-    nsCAutoString urlPath;
+    nsAutoCString newPath;
+    nsAutoCString escapedUrlPath;
+    nsAutoCString urlPath;
     url->GetFilePath(escapedUrlPath);
     if (!escapedUrlPath.IsEmpty())
     {
       MsgUnescapeString(escapedUrlPath, 0, urlPath);
 
       // transform the filepath from the URI, such as
       // "/folder1/folder2/foldern"
       // to
       // "folder1.sbd/folder2.sbd/foldern"
       // (remove leading / and add .sbd to first n-1 folders)
       // to be appended onto the server's path
       bool isNewsFolder = false;
-      nsCAutoString scheme;
+      nsAutoCString scheme;
       if (NS_SUCCEEDED(url->GetScheme(scheme)))
       {
         isNewsFolder = scheme.EqualsLiteral("news") ||
                        scheme.EqualsLiteral("snews") ||
                        scheme.EqualsLiteral("nntp");
       }
       NS_MsgCreatePathStringFromFolderURI(urlPath.get(), newPath, scheme,
                                           isNewsFolder);
@@ -3660,22 +3660,22 @@ NS_IMETHODIMP nsMsgDBFolder::AddSubfolde
 {
   NS_ENSURE_ARG_POINTER(child);
 
   int32_t flags = 0;
   nsresult rv;
   nsCOMPtr<nsIRDFService> rdf = do_GetService("@mozilla.org/rdf/rdf-service;1", &rv);
   NS_ENSURE_SUCCESS(rv,rv);
 
-  nsCAutoString uri(mURI);
+  nsAutoCString uri(mURI);
   uri.Append('/');
 
   // URI should use UTF-8
   // (see RFC2396 Uniform Resource Identifiers (URI): Generic Syntax)
-  nsCAutoString escapedName;
+  nsAutoCString escapedName;
   rv = NS_MsgEscapeEncodeURLPath(name, escapedName);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // fix for #192780
   // if this is the root folder
   // make sure the the special folders
   // have the right uri.
   // on disk, host\INBOX should be a folder with the uri mailbox://user@host/Inbox"
@@ -3893,17 +3893,17 @@ nsresult nsMsgDBFolder::GetBackupSummary
     rv = backupDBDummyFolder->AppendNative(newName);
   }
   else // if newName is null, use the folder name
   {
     nsCOMPtr<nsIFile> folderPath;
     rv = GetFilePath(getter_AddRefs(folderPath));
     NS_ENSURE_SUCCESS(rv, rv);
 
-    nsCAutoString folderName;
+    nsAutoCString folderName;
     rv = folderPath->GetNativeLeafName(folderName);
     NS_ENSURE_SUCCESS(rv, rv);
     rv = backupDBDummyFolder->AppendNative(folderName);
   }
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIFile> backupDBFile;
   rv = GetSummaryFileLocation(backupDBDummyFolder, getter_AddRefs(backupDBFile));
@@ -4623,19 +4623,19 @@ NS_IMETHODIMP nsMsgDBFolder::GetNumNewMe
 
 NS_IMETHODIMP nsMsgDBFolder::SetNumNewMessages(int32_t aNumNewMessages)
 {
   if (aNumNewMessages != mNumNewBiffMessages)
   {
     int32_t oldNumMessages = mNumNewBiffMessages;
     mNumNewBiffMessages = aNumNewMessages;
 
-    nsCAutoString oldNumMessagesStr;
+    nsAutoCString oldNumMessagesStr;
     oldNumMessagesStr.AppendInt(oldNumMessages);
-    nsCAutoString newNumMessagesStr;
+    nsAutoCString newNumMessagesStr;
     newNumMessagesStr.AppendInt(aNumNewMessages);
     NotifyPropertyChanged(kNumNewBiffMessagesAtom, oldNumMessagesStr, newNumMessagesStr);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::GetRootFolder(nsIMsgFolder * *aRootFolder)
 {
@@ -5099,17 +5099,17 @@ NS_IMETHODIMP nsMsgDBFolder::GetBaseMess
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::GetUriForMsg(nsIMsgDBHdr *msgHdr, nsACString& aURI)
 {
   NS_ENSURE_ARG(msgHdr);
   nsMsgKey msgKey;
   msgHdr->GetMessageKey(&msgKey);
-  nsCAutoString uri;
+  nsAutoCString uri;
   uri.Assign(mBaseMessageURI);
 
   // append a "#" followed by the message key.
   uri.Append('#');
   uri.AppendInt(msgKey);
   aURI = uri;
   return NS_OK;
 }
@@ -5396,21 +5396,21 @@ NS_IMETHODIMP nsMsgDBFolder::GetMsgTextF
    3. mime message, text/plain - body follows headers
    4. multipart/mixed - scan past boundary, treat next part as body.
    */
 
   nsLineBuffer<char> *lineBuffer;
   nsresult rv = NS_InitLineBuffer(&lineBuffer);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString msgText;
+  nsAutoCString msgText;
   nsAutoString contentType;
   nsAutoString encoding;
-  nsCAutoString curLine;
-  nsCAutoString charset(aCharset);
+  nsAutoCString curLine;
+  nsAutoCString charset(aCharset);
 
   // might want to use a state var instead of bools.
   bool msgBodyIsHtml = false;
   bool more = true;
   bool reachedEndBody = false;
   bool isBase64 = false;
   bool inMsgBody = false;
   bool justPassedEndBoundary = false;
@@ -5423,17 +5423,17 @@ NS_IMETHODIMP nsMsgDBFolder::GetMsgTextF
   nsCOMPtr<nsIMIMEHeaderParam> mimeHdrParam(do_GetService(NS_MIMEHEADERPARAM_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Stack of boundaries, used to figure out where we are
   nsTArray<nsCString> boundaryStack;
 
   while (!inMsgBody && bytesRead <= bytesToRead)
   {
-    nsCAutoString msgHeaders;
+    nsAutoCString msgHeaders;
     // We want to NS_ReadLine until we get to a blank line (the end of the headers)
     while (more)
     {
       rv = NS_ReadLine(stream, lineBuffer, curLine, &more);
       NS_ENSURE_SUCCESS(rv, rv);
       if (curLine.IsEmpty())
         break;
       msgHeaders.Append(curLine);
@@ -5446,17 +5446,17 @@ NS_IMETHODIMP nsMsgDBFolder::GetMsgTextF
     // There's no point in processing if we can't get the body
     if (bytesRead > bytesToRead)
       break;
 
     // Process the headers, looking for things we need
     rv = mimeHeaders->Initialize(msgHeaders.get(), msgHeaders.Length());
     NS_ENSURE_SUCCESS(rv, rv);
 
-    nsCAutoString contentTypeHdr;
+    nsAutoCString contentTypeHdr;
     mimeHeaders->ExtractHeader("Content-Type", false, getter_Copies(contentTypeHdr));
 
     // Get the content type
     // If we don't have a content type, then we assign text/plain
     // this is in violation of the RFC for multipart/digest, though
     // Also, if we've just passed an end boundary, we're going to ignore this.
     if (!justPassedEndBoundary && contentTypeHdr.IsEmpty())
       contentType.Assign(NS_LITERAL_STRING("text/plain"));
@@ -5467,17 +5467,17 @@ NS_IMETHODIMP nsMsgDBFolder::GetMsgTextF
 
     // If we are multipart, then we need to get the boundary
     if (StringBeginsWith(contentType, NS_LITERAL_STRING("multipart/"), nsCaseInsensitiveStringComparator()))
     {
       nsAutoString boundaryParam;
       mimeHdrParam->GetParameter(contentTypeHdr, "boundary", EmptyCString(), false, nullptr, boundaryParam);
       if (!boundaryParam.IsEmpty())
       {
-        nsCAutoString boundary(NS_LITERAL_CSTRING("--"));
+        nsAutoCString boundary(NS_LITERAL_CSTRING("--"));
         boundary.Append(NS_ConvertUTF16toUTF8(boundaryParam));
         boundaryStack.AppendElement(boundary);
       }
     }
 
     // If we are message/rfc822, then there's another header block coming up
     else if (contentType.LowerCaseEqualsLiteral("message/rfc822"))
       continue;
@@ -5494,29 +5494,29 @@ NS_IMETHODIMP nsMsgDBFolder::GetMsgTextF
       if (charset.IsEmpty())
       {
         nsAutoString charsetW;
         mimeHdrParam->GetParameter(contentTypeHdr, "charset", EmptyCString(), false, nullptr, charsetW);
         charset.Assign(NS_ConvertUTF16toUTF8(charsetW));
       }
 
       // Finally, get the encoding
-      nsCAutoString encodingHdr;
+      nsAutoCString encodingHdr;
       mimeHeaders->ExtractHeader("Content-Transfer-Encoding", false, getter_Copies(encodingHdr));
       if (!encodingHdr.IsEmpty())
         mimeHdrParam->GetParameter(encodingHdr, nullptr, EmptyCString(), false, nullptr, encoding);
 
       if (encoding.LowerCaseEqualsLiteral(ENCODING_BASE64))
         isBase64 = true;
     }
 
     // We need to consume the rest, until the next headers
     uint32_t count = boundaryStack.Length();
-    nsCAutoString boundary;
-    nsCAutoString endBoundary;
+    nsAutoCString boundary;
+    nsAutoCString endBoundary;
     if (count)
     {
       boundary.Assign(boundaryStack.ElementAt(count - 1));
       endBoundary.Assign(boundary);
       endBoundary.Append(NS_LITERAL_CSTRING("--"));
     }
     while (more)
     {
@@ -5687,19 +5687,19 @@ NS_IMETHODIMP nsMsgDBFolder::ConvertMsgS
   nsCOMPtr<nsIParserUtils> utils =
     do_GetService(NS_PARSERUTILS_CONTRACTID);
   return utils->ConvertToPlainText(aMessageText, flags, 80, aOutText);
 }
 
 nsresult nsMsgDBFolder::GetMsgPreviewTextFromStream(nsIMsgDBHdr *msgHdr, nsIInputStream *stream)
 {
   nsCString msgBody;
-  nsCAutoString charset;
+  nsAutoCString charset;
   msgHdr->GetCharset(getter_Copies(charset));
-  nsCAutoString contentType;
+  nsAutoCString contentType;
   nsresult rv = GetMsgTextFromStream(stream, charset, 4096, 255, true, true, contentType, msgBody);
   // replaces all tabs and line returns with a space, 
   // then trims off leading and trailing white space
   MsgCompressWhitespace(msgBody);
   msgHdr->SetStringProperty("preview", msgBody.get());
   return rv;
 }
 
@@ -5721,26 +5721,26 @@ void nsMsgDBFolder::UpdateTimestamps(boo
     }
   }
 }
 
 void nsMsgDBFolder::SetMRUTime()
 {
   uint32_t seconds;
   PRTime2Seconds(PR_Now(), &seconds);
-  nsCAutoString nowStr;
+  nsAutoCString nowStr;
   nowStr.AppendInt(seconds);
   SetStringProperty(MRU_TIME_PROPERTY, nowStr);
 }
 
 void nsMsgDBFolder::SetMRMTime()
 {
   uint32_t seconds;
   PRTime2Seconds(PR_Now(), &seconds);
-  nsCAutoString nowStr;
+  nsAutoCString nowStr;
   nowStr.AppendInt(seconds);
   SetStringProperty(MRM_TIME_PROPERTY, nowStr);
 }
 
 NS_IMETHODIMP nsMsgDBFolder::AddKeywordsToMessages(nsIArray *aMessages, const nsACString& aKeywords)
 {
   NS_ENSURE_ARG(aMessages);
   nsresult rv = NS_OK;
--- a/mailnews/base/util/nsMsgI18N.cpp
+++ b/mailnews/base/util/nsMsgI18N.cpp
@@ -157,17 +157,17 @@ nsresult nsMsgI18NConvertToUnicode(const
   }
   return rv;
 }
 
 // Charset used by the file system.
 const char * nsMsgI18NFileSystemCharset()
 {
   /* Get a charset used for the file. */
-  static nsCAutoString fileSystemCharset;
+  static nsAutoCString fileSystemCharset;
 
   if (fileSystemCharset.IsEmpty()) 
   {
     nsresult rv;
     nsCOMPtr <nsIPlatformCharset> platformCharset = do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv);
         if (NS_SUCCEEDED(rv)) {
           rv = platformCharset->GetCharset(kPlatformCharsetSel_FileName,
                                            fileSystemCharset);
@@ -195,17 +195,17 @@ void nsMsgI18NTextFileCharset(nsACString
 }
 
 // MIME encoder, output string should be freed by PR_FREE
 // XXX : fix callers later to avoid allocation and copy
 char * nsMsgI18NEncodeMimePartIIStr(const char *header, bool structured, const char *charset, int32_t fieldnamelen, bool usemime) 
 {
   // No MIME, convert to the outgoing mail charset.
   if (false == usemime) {
-    nsCAutoString convertedStr;
+    nsAutoCString convertedStr;
     if (NS_SUCCEEDED(ConvertFromUnicode(charset, NS_ConvertUTF8toUTF16(header),
                                         convertedStr)))
       return PL_strdup(convertedStr.get());
     else
       return PL_strdup(header);
   }
 
   char *encodedString = nullptr;
@@ -391,17 +391,17 @@ nsresult nsMsgI18NSaveAsCharset(const ch
   else if (PL_strcasecmp(contentType, TEXT_PLAIN)) {
     return NS_ERROR_ILLEGAL_VALUE;  // not supported type
   }
 
   nsCOMPtr <nsICharsetConverterManager> ccm =
     do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &res);
   NS_ENSURE_SUCCESS(res, res);
 
-  nsCAutoString charsetName;
+  nsAutoCString charsetName;
   res = ccm->GetCharsetAlias(charset, charsetName);
   NS_ENSURE_SUCCESS(res, res);
 
   // charset converter plus entity, NCR generation
   nsCOMPtr <nsISaveAsCharset> conv = do_CreateInstance(NS_SAVEASCHARSET_CONTRACTID, &res);
   NS_ENSURE_SUCCESS(res, res);
 
   // attribute: 
@@ -427,17 +427,17 @@ nsresult nsMsgI18NSaveAsCharset(const ch
   res = conv->Convert(input, outString);
 
   // If the converer cannot encode to the charset,
   // then fallback to pref sepcified charsets.
   if (NS_ERROR_UENC_NOMAPPING == res && !bTEXT_HTML && fallbackCharset) {
     nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &res));
     NS_ENSURE_SUCCESS(res, res);
 
-    nsCAutoString prefString("intl.fallbackCharsetList.");
+    nsAutoCString prefString("intl.fallbackCharsetList.");
     prefString.Append(charset);
     nsCString fallbackList;
     res = prefBranch->GetCharPref(prefString.get(), getter_Copies(fallbackList));
     // do the fallback only if there is a pref for the charset
     if (NS_FAILED(res) || fallbackList.IsEmpty())
       return NS_ERROR_UENC_NOMAPPING;
 
     res = conv->Init(fallbackList.get(), 
--- a/mailnews/base/util/nsMsgIdentity.cpp
+++ b/mailnews/base/util/nsMsgIdentity.cpp
@@ -46,17 +46,17 @@ NS_IMETHODIMP
 nsMsgIdentity::SetKey(const nsACString& identityKey)
 {
   mKey = identityKey;
   nsresult rv;
   nsCOMPtr<nsIPrefService> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
   if (NS_FAILED(rv))
     return rv;
 
-  nsCAutoString branchName;
+  nsAutoCString branchName;
   branchName.AssignLiteral("mail.identity.");
   branchName += mKey;
   branchName.Append('.');
   rv = prefs->GetBranch(branchName.get(), getter_AddRefs(mPrefBranch));
   if (NS_FAILED(rv))
     return rv;
 
   rv = prefs->GetBranch("mail.identity.default.", getter_AddRefs(mDefPrefBranch));
--- a/mailnews/base/util/nsMsgIncomingServer.cpp
+++ b/mailnews/base/util/nsMsgIncomingServer.cpp
@@ -99,17 +99,17 @@ nsMsgIncomingServer::SetKey(const nsACSt
 {
   m_serverKey.Assign(serverKey);
 
   // in order to actually make use of the key, we need the prefs
   nsresult rv;
   nsCOMPtr<nsIPrefService> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString branchName;
+  nsAutoCString branchName;
   branchName.AssignLiteral("mail.server.");
   branchName.Append(m_serverKey);
   branchName.Append('.');
   rv = prefs->GetBranch(branchName.get(), getter_AddRefs(mPrefBranch));
   NS_ENSURE_SUCCESS(rv, rv);
 
   return prefs->GetBranch("mail.server.default.", getter_AddRefs(mDefPrefBranch));
 }
@@ -1055,17 +1055,17 @@ nsMsgIncomingServer::GetFilterList(nsIMs
       NS_ENSURE_SUCCESS(rv, rv);
 
       nsCString filterType;
       rv = GetCharValue("filter.type", filterType);
       NS_ENSURE_SUCCESS(rv, rv);
 
       if (!filterType.IsEmpty() && !filterType.EqualsLiteral("default"))
       {
-        nsCAutoString contractID("@mozilla.org/filterlist;1?type=");
+        nsAutoCString contractID("@mozilla.org/filterlist;1?type=");
         contractID += filterType;
         ToLowerCase(contractID);
         mFilterList = do_CreateInstance(contractID.get(), &rv);
         NS_ENSURE_SUCCESS(rv, rv);
 
         rv = mFilterList->SetFolder(msgFolder);
         NS_ENSURE_SUCCESS(rv, rv);
 
@@ -1133,17 +1133,17 @@ nsMsgIncomingServer::GetEditableFilterLi
     nsresult rv = GetBoolValue("filter.editable.separate", &editSeparate);
     if (NS_FAILED(rv) || !editSeparate)
       return GetFilterList(aMsgWindow, aResult);
 
     nsCString filterType;
     rv = GetCharValue("filter.editable.type", filterType);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    nsCAutoString contractID("@mozilla.org/filterlist;1?type=");
+    nsAutoCString contractID("@mozilla.org/filterlist;1?type=");
     contractID += filterType;
     ToLowerCase(contractID);
     mEditableFilterList = do_CreateInstance(contractID.get(), &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsIMsgFolder> msgFolder;
     // use GetRootFolder so for deferred pop3 accounts, we'll get the filters
     // file from the deferred account, not the deferred to account,
@@ -1167,17 +1167,17 @@ nsMsgIncomingServer::GetEditableFilterLi
 nsresult
 nsMsgIncomingServer::InternalSetHostName(const nsACString& aHostname, const char * prefName)
 {
   nsCString hostname;
   hostname = aHostname;
   if (MsgCountChar(hostname, ':') == 1)
   {
     int32_t colonPos = hostname.FindChar(':');
-    nsCAutoString portString(Substring(hostname, colonPos));
+    nsAutoCString portString(Substring(hostname, colonPos));
     hostname.SetLength(colonPos);
     nsresult err;
     int32_t port = portString.ToInteger(&err);
     if (NS_SUCCEEDED(err))
       SetPort(port);
   }
   return SetCharValue(prefName, hostname);
 }
@@ -1423,17 +1423,17 @@ nsMsgIncomingServer::getProtocolInfo(nsI
 {
   NS_ENSURE_ARG_POINTER(aResult);
   nsresult rv;
 
   nsCString type;
   rv = GetType(type);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString contractid(NS_MSGPROTOCOLINFO_CONTRACTID_PREFIX);
+  nsAutoCString contractid(NS_MSGPROTOCOLINFO_CONTRACTID_PREFIX);
   contractid.Append(type);
 
   nsCOMPtr<nsIMsgProtocolInfo> protocolInfo = do_GetService(contractid.get(), &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   protocolInfo.swap(*aResult);
   return NS_OK;
 }
 
@@ -1795,17 +1795,17 @@ nsMsgIncomingServer::ConfigureTemporaryS
   NS_ENSURE_SUCCESS(rv, rv);
 
   // if we aren't configured to use server filters, then return early.
   if (!useServerFilter)
     return NS_OK;
 
   // For performance reasons, we'll handle clearing of filters if the user turns
   // off the server-side filters from the junk mail controls, in the junk mail controls.
-  nsCAutoString serverFilterName;
+  nsAutoCString serverFilterName;
   spamSettings->GetServerFilterName(serverFilterName);
   if (serverFilterName.IsEmpty())
     return NS_OK;
   int32_t serverFilterTrustFlags = 0;
   (void) spamSettings->GetServerFilterTrustFlags(&serverFilterTrustFlags);
   if (!serverFilterTrustFlags)
     return NS_OK;
   // check if filters have been setup already.
@@ -2075,17 +2075,17 @@ nsMsgIncomingServer::GetMsgFolderFromURI
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgIncomingServer::GetSpamSettings(nsISpamSettings **aSpamSettings)
 {
   NS_ENSURE_ARG_POINTER(aSpamSettings);
 
-  nsCAutoString spamActionTargetAccount;
+  nsAutoCString spamActionTargetAccount;
   GetCharValue("spamActionTargetAccount", spamActionTargetAccount);
   if (spamActionTargetAccount.IsEmpty())
   {
     GetServerURI(spamActionTargetAccount);
     SetCharValue("spamActionTargetAccount", spamActionTargetAccount);
   }
 
   if (!mSpamSettings) {
@@ -2219,17 +2219,17 @@ NS_IMETHODIMP nsMsgIncomingServer::IsNew
 
   // If the message has been partially downloaded, the message should not
   // be considered a duplicated message. See bug 714090.
   uint32_t flags;
   aNewHdr->GetFlags(&flags);
   if (flags & nsMsgMessageFlags::Partial)
     return NS_OK;
 
-  nsCAutoString strHashKey;
+  nsAutoCString strHashKey;
   nsCString messageId, subject;
   aNewHdr->GetMessageId(getter_Copies(messageId));
   strHashKey.Append(messageId);
   aNewHdr->GetSubject(getter_Copies(subject));
   // err on the side of caution and ignore messages w/o subject or messageid.
   if (subject.IsEmpty() || messageId.IsEmpty())
     return NS_OK;
   strHashKey.Append(subject);
@@ -2250,24 +2250,24 @@ NS_IMETHODIMP nsMsgIncomingServer::IsNew
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgIncomingServer::GetForcePropertyEmpty(const char *aPropertyName, bool *_retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
-  nsCAutoString nameEmpty(aPropertyName);
+  nsAutoCString nameEmpty(aPropertyName);
   nameEmpty.Append(NS_LITERAL_CSTRING(".empty"));
   nsCString value;
   GetCharValue(nameEmpty.get(), value);
   *_retval = value.EqualsLiteral("true");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgIncomingServer::SetForcePropertyEmpty(const char *aPropertyName, bool aValue)
 {
- nsCAutoString nameEmpty(aPropertyName);
+ nsAutoCString nameEmpty(aPropertyName);
  nameEmpty.Append(NS_LITERAL_CSTRING(".empty"));
  return SetCharValue(nameEmpty.get(),
    aValue ? NS_LITERAL_CSTRING("true") : NS_LITERAL_CSTRING(""));
 }
--- a/mailnews/base/util/nsMsgMailNewsUrl.cpp
+++ b/mailnews/base/util/nsMsgMailNewsUrl.cpp
@@ -133,18 +133,18 @@ nsresult nsMsgMailNewsUrl::UnRegisterLis
 NS_IMETHODIMP nsMsgMailNewsUrl::GetServer(nsIMsgIncomingServer ** aIncomingServer)
 {
   // mscott --> we could cache a copy of the server here....but if we did, we run
   // the risk of leaking the server if any single url gets leaked....of course that
   // shouldn't happen...but it could. so i'm going to look it up every time and
   // we can look at caching it later.
 
   nsresult rv;
-  nsCAutoString urlstr;
-  nsCAutoString scheme;
+  nsAutoCString urlstr;
+  nsAutoCString scheme;
 
   nsCOMPtr<nsIURL> url = do_CreateInstance(NS_STANDARDURL_CONTRACTID, &rv);
   if (NS_FAILED(rv)) return rv;
 
   m_baseURL->GetSpec(urlstr);
   rv = url->SetSpec(urlstr);
   if (NS_FAILED(rv)) return rv;
   rv = GetScheme(scheme);
@@ -347,17 +347,17 @@ NS_IMETHODIMP nsMsgMailNewsUrl::GetSpec(
 {
   return m_baseURL->GetSpec(aSpec);
 }
 
 #define FILENAME_PART_LEN 10
 
 NS_IMETHODIMP nsMsgMailNewsUrl::SetSpec(const nsACString &aSpec)
 {
-  nsCAutoString spec(aSpec);
+  nsAutoCString spec(aSpec);
   // Parse out "filename" attribute if present.
   char *start, *end;
   start = PL_strcasestr(spec.BeginWriting(),"?filename=");
   if (!start)
     start = PL_strcasestr(spec.BeginWriting(),"&filename=");
   if (start)
   { // Make sure we only get our own value.
     end = PL_strcasestr((char*)(start+FILENAME_PART_LEN),"&");
@@ -533,17 +533,17 @@ nsMsgMailNewsUrl::GetHasRef(bool *result
 NS_IMETHODIMP nsMsgMailNewsUrl::SchemeIs(const char *aScheme, bool *_retval)
 {
   return m_baseURL->SchemeIs(aScheme, _retval);
 }
 
 NS_IMETHODIMP nsMsgMailNewsUrl::Clone(nsIURI **_retval)
 {
   nsresult rv;
-  nsCAutoString urlSpec;
+  nsAutoCString urlSpec;
   nsCOMPtr<nsIIOService> ioService =
     mozilla::services::GetIOService();
   NS_ENSURE_TRUE(ioService, NS_ERROR_UNEXPECTED);
   rv = GetSpec(urlSpec);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = ioService->NewURI(urlSpec, nullptr, nullptr, _retval);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -568,17 +568,17 @@ NS_IMETHODIMP nsMsgMailNewsUrl::Resolve(
   if (!relativePath.IsEmpty() && relativePath.First() == '#') // an anchor
     return m_baseURL->Resolve(relativePath, result);
   else
   {
     // if relativePath is a complete url with it's own scheme then allow it...
     nsCOMPtr<nsIIOService> ioService =
       mozilla::services::GetIOService();
     NS_ENSURE_TRUE(ioService, NS_ERROR_UNEXPECTED);
-    nsCAutoString scheme;
+    nsAutoCString scheme;
 
     rv = ioService->ExtractScheme(relativePath, scheme);
     // if we have a fully qualified scheme then pass the relative path back as the result
     if (NS_SUCCEEDED(rv) && !scheme.IsEmpty())
     {
       result = relativePath;
       rv = NS_OK;
     }
@@ -934,17 +934,17 @@ nsresult nsMsgSaveAsListener::SetupMsgWr
   aFile->Remove(false);
 
   nsresult rv = MsgNewBufferedFileOutputStream(getter_AddRefs(m_outputStream),
                                                aFile, -1, 00600);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (m_outputStream && addDummyEnvelope)
   {
-    nsCAutoString result;
+    nsAutoCString result;
     uint32_t writeCount;
 
     time_t now = time((time_t*) 0);
     char *ct = ctime(&now);
     // Remove the ending new-line character.
     ct[24] = '\0';
     result = "From - ";
     result += ct;
@@ -992,13 +992,13 @@ NS_IMETHODIMP nsMsgMailNewsUrl::SetMsgHe
 {
     mMsgHeaderSink = aMsgHdrSink;
     return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgMailNewsUrl::GetIsMessageUri(bool *aIsMessageUri)
 {
   NS_ENSURE_ARG(aIsMessageUri);
-  nsCAutoString scheme;
+  nsAutoCString scheme;
   m_baseURL->GetScheme(scheme);
   *aIsMessageUri = StringEndsWith(scheme, NS_LITERAL_CSTRING("-message"));
   return NS_OK;
 }
--- a/mailnews/base/util/nsMsgProtocol.cpp
+++ b/mailnews/base/util/nsMsgProtocol.cpp
@@ -94,17 +94,17 @@ nsresult
 nsMsgProtocol::GetQoSBits(uint8_t *aQoSBits)
 {
   NS_ENSURE_ARG_POINTER(aQoSBits);
   const char* protocol = GetType();
 
   if (!protocol)
     return NS_ERROR_NOT_IMPLEMENTED;
 
-  nsCAutoString prefName("mail.");
+  nsAutoCString prefName("mail.");
   prefName.Append(protocol);
   prefName.Append(".qos");
 
   nsresult rv;
   nsCOMPtr<nsIPrefBranch> prefBranch = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv,rv);
 
   int32_t val;
@@ -168,17 +168,17 @@ nsMsgProtocol::OpenNetworkSocketWithInfo
 
 // open a connection on this url
 nsresult
 nsMsgProtocol::OpenNetworkSocket(nsIURI * aURL, const char *connectionType,
                                  nsIInterfaceRequestor* callbacks)
 {
   NS_ENSURE_ARG(aURL);
 
-  nsCAutoString hostName;
+  nsAutoCString hostName;
   int32_t port = 0;
 
   aURL->GetPort(&port);
   aURL->GetAsciiHost(hostName);
 
   nsCOMPtr<nsIProxyInfo> proxyInfo;
 
   nsCOMPtr<nsIProtocolProxyService> pps =
@@ -197,17 +197,17 @@ nsMsgProtocol::OpenNetworkSocket(nsIURI 
       // nsSmtpUrl calls nsStandardUrl's clone method, which fails
       // because smtp isn't a registered protocol.
       // So we cheat. Whilst creating a uri manually is valid here,
       // do _NOT_ copy this to use in your own code - bbaetz
       nsCOMPtr<nsIURI> proxyUri = aURL;
       bool isSMTP = false;
       if (NS_SUCCEEDED(aURL->SchemeIs("smtp", &isSMTP)) && isSMTP)
       {
-          nsCAutoString spec;
+          nsAutoCString spec;
           rv = aURL->GetSpec(spec);
           if (NS_SUCCEEDED(rv))
               proxyUri = do_CreateInstance(NS_STANDARDURL_CONTRACTID, &rv);
 
           if (NS_SUCCEEDED(rv))
               rv = proxyUri->SetSpec(spec);
           if (NS_SUCCEEDED(rv))
               rv = proxyUri->SetScheme(NS_LITERAL_CSTRING("mailto"));
@@ -227,17 +227,17 @@ nsMsgProtocol::OpenNetworkSocket(nsIURI 
                                    proxyInfo, callbacks);
 }
 
 nsresult nsMsgProtocol::GetFileFromURL(nsIURI * aURL, nsIFile **aResult)
 {
   NS_ENSURE_ARG_POINTER(aURL);
   NS_ENSURE_ARG_POINTER(aResult);
   // extract the file path from the uri...
-  nsCAutoString urlSpec;
+  nsAutoCString urlSpec;
   aURL->GetPath(urlSpec);
   urlSpec.Insert(NS_LITERAL_CSTRING("file://"), 0);
   nsresult rv;
 
 // dougt - there should be an easier way!
   nsCOMPtr<nsIURI> uri;
   if (NS_FAILED(rv = NS_NewURI(getter_AddRefs(uri), urlSpec.get())))
       return rv;
@@ -583,17 +583,17 @@ NS_IMETHODIMP nsMsgProtocol::Open(nsIInp
 
 NS_IMETHODIMP nsMsgProtocol::AsyncOpen(nsIStreamListener *listener, nsISupports *ctxt)
 {
     int32_t port;
     nsresult rv = m_url->GetPort(&port);
     if (NS_FAILED(rv))
         return rv;
 
-    nsCAutoString scheme;
+    nsAutoCString scheme;
     rv = m_url->GetScheme(scheme);
     if (NS_FAILED(rv))
         return rv;
 
 
     rv = NS_CheckPortSafety(port, scheme.get());
     if (NS_FAILED(rv))
         return rv;
@@ -627,17 +627,17 @@ NS_IMETHODIMP nsMsgProtocol::GetContentT
     aContentType.AssignLiteral("message/rfc822");
   else
     aContentType = m_ContentType;
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgProtocol::SetContentType(const nsACString &aContentType)
 {
-    nsCAutoString charset;
+    nsAutoCString charset;
     return NS_ParseContentType(aContentType, m_ContentType, charset);
 }
 
 NS_IMETHODIMP nsMsgProtocol::GetContentCharset(nsACString &aContentCharset)
 {
   aContentCharset.Truncate();
   return NS_OK;
 }
@@ -741,17 +741,17 @@ nsMsgProtocol::OnTransportStatus(nsITran
 
   if (!mProgressEventSink)
   {
     NS_QueryNotificationCallbacks(mCallbacks, m_loadGroup, mProgressEventSink);
     if (!mProgressEventSink)
       return NS_OK;
   }
 
-  nsCAutoString host;
+  nsAutoCString host;
   m_url->GetHost(host);
 
   nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(m_url);
   if (mailnewsUrl)
   {
     nsCOMPtr<nsIMsgIncomingServer> server;
     mailnewsUrl->GetServer(getter_AddRefs(server));
     if (server)
--- a/mailnews/base/util/nsMsgUtils.cpp
+++ b/mailnews/base/util/nsMsgUtils.cpp
@@ -81,37 +81,37 @@ static NS_DEFINE_CID(kCNntpUrlCID, NS_NN
 #define ILLEGAL_FOLDER_CHARS_AS_LAST_LETTER  ".~ "
 
 #define FOUR_K 4096
 
 nsresult GetMessageServiceContractIDForURI(const char *uri, nsCString &contractID)
 {
   nsresult rv = NS_OK;
   //Find protocol
-  nsCAutoString uriStr(uri);
+  nsAutoCString uriStr(uri);
   int32_t pos = uriStr.FindChar(':');
   if (pos == -1)
     return NS_ERROR_FAILURE;
 
-  nsCAutoString protocol(StringHead(uriStr, pos));
+  nsAutoCString protocol(StringHead(uriStr, pos));
 
   if (protocol.Equals("file") && uriStr.Find("application/x-message-display") != -1)
     protocol.Assign("mailbox");
   //Build message service contractid
   contractID = "@mozilla.org/messenger/messageservice;1?type=";
   contractID += protocol.get();
 
   return rv;
 }
 
 nsresult GetMessageServiceFromURI(const nsACString& uri, nsIMsgMessageService **aMessageService)
 {
   nsresult rv;
 
-  nsCAutoString contractID;
+  nsAutoCString contractID;
   rv = GetMessageServiceContractIDForURI(PromiseFlatCString(uri).get(), contractID);
   NS_ENSURE_SUCCESS(rv,rv);
 
   nsCOMPtr <nsIMsgMessageService> msgService = do_GetService(contractID.get(), &rv);
   NS_ENSURE_SUCCESS(rv,rv);
 
   NS_IF_ADDREF(*aMessageService = msgService);
   return rv;
@@ -343,17 +343,17 @@ MsgFindCharInSet(const nsString &aString
       return index;
   }
   return -1;
 #endif
 }
 
 static bool ConvertibleToNative(const nsAutoString& str)
 {
-    nsCAutoString native;
+    nsAutoCString native;
     nsAutoString roundTripped;
 #ifdef MOZILLA_INTERNAL_API
     NS_CopyUnicodeToNative(str, native);
     NS_CopyNativeToUnicode(native, roundTripped);
 #else
     nsMsgI18NConvertFromUnicode(nsMsgI18NFileSystemCharset(), str, native);
     nsMsgI18NConvertToUnicode(nsMsgI18NFileSystemCharset(), native, roundTripped);
 #endif
@@ -365,19 +365,19 @@ static bool ConvertibleToNative(const ns
 #elif defined(XP_WIN32)
   const static uint32_t MAX_LEN = 55;
 #elif defined(XP_OS2)
   const static uint32_t MAX_LEN = 55;
 #else
   #error need_to_define_your_max_filename_length
 #endif
 
-nsresult NS_MsgHashIfNecessary(nsCAutoString &name)
+nsresult NS_MsgHashIfNecessary(nsAutoCString &name)
 {
-  nsCAutoString str(name);
+  nsAutoCString str(name);
 
   // Given a filename, make it safe for filesystem
   // certain filenames require hashing because they
   // are too long or contain illegal characters
   int32_t illegalCharacterIndex = MsgFindCharInSet(str,
                                                    FILE_PATH_SEPARATOR
                                                    FILE_ILLEGAL_CHARACTERS
                                                    ILLEGAL_FOLDER_CHARS, 0);
@@ -558,17 +558,17 @@ nsresult NS_MsgCreatePathStringFromFolde
       // add .sbd onto the previous path
       if (haveFirst)
       {
         path.AppendLiteral(".sbd/");
       }
 
       if (aIsNewsFolder)
       {
-          nsCAutoString tmp;
+          nsAutoCString tmp;
           CopyUTF16toMUTF7(pathPiece, tmp);
           CopyASCIItoUTF16(tmp, pathPiece);
       }
 #ifdef XP_MACOSX
       // Don't hash path pieces because local mail folder uri's have already
       // been hashed. We're only doing this on the mac to limit potential
       // regressions.
       if (!isMailboxUri)
@@ -609,17 +609,17 @@ bool NS_MsgStripRE(const char **stringP,
   nsString utf16LocalizedRe;
   NS_GetLocalizedUnicharPreferenceWithDefault(nullptr,
                                               "mailnews.localizedRe",
                                               EmptyString(),
                                               utf16LocalizedRe);
   NS_ConvertUTF16toUTF8 localizedRe(utf16LocalizedRe);
 
   // hardcoded "Re" so that noone can configure Mozilla standards incompatible
-  nsCAutoString checkString("Re,RE,re,rE");
+  nsAutoCString checkString("Re,RE,re,rE");
   if (!localizedRe.IsEmpty()) {
     checkString.Append(',');
     checkString.Append(localizedRe);
   }
 
   // decode the string
   nsCString decodedString;
   nsCOMPtr<nsIMimeConverter> mimeConverter;
@@ -772,17 +772,17 @@ char * NS_MsgSACat (char **destination, 
 nsresult NS_MsgEscapeEncodeURLPath(const nsAString& aStr, nsCString& aResult)
 {
   return MsgEscapeString(NS_ConvertUTF16toUTF8(aStr), nsINetUtil::ESCAPE_URL_PATH, aResult);
 }
 
 nsresult NS_MsgDecodeUnescapeURLPath(const nsACString& aPath,
                                      nsAString& aResult)
 {
-  nsCAutoString unescapedName;
+  nsAutoCString unescapedName;
   MsgUnescapeString(aPath, nsINetUtil::ESCAPE_URL_FILE_BASENAME |
                  nsINetUtil::ESCAPE_URL_FORCED, unescapedName);
   CopyUTF8toUTF16(unescapedName, aResult);
   return NS_OK;
 }
 
 bool WeAreOffline()
 {
@@ -1040,17 +1040,17 @@ nsresult IsRSSArticle(nsIURI * aMsgURI, 
 }
 
 
 // digest needs to be a pointer to a DIGEST_LENGTH (16) byte buffer
 nsresult MSGCramMD5(const char *text, int32_t text_len, const char *key, int32_t key_len, unsigned char *digest)
 {
   nsresult rv;
 
-  nsCAutoString hash;
+  nsAutoCString hash;
   nsCOMPtr<nsICryptoHash> hasher = do_CreateInstance("@mozilla.org/security/hash;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
 
   // this code adapted from http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc2104.html
 
   char innerPad[65];    /* inner padding - key XORd with innerPad */
   char outerPad[65];    /* outer padding - key XORd with outerPad */
@@ -1093,17 +1093,17 @@ nsresult MSGCramMD5(const char *text, in
   for (i=0; i<64; i++)
   {
     innerPad[i] ^= 0x36;
     outerPad[i] ^= 0x5c;
   }
   /*
    * perform inner MD5
    */
-  nsCAutoString result;
+  nsAutoCString result;
   rv = hasher->Init(nsICryptoHash::MD5); /* init context for 1st pass */
   rv = hasher->Update((const uint8_t*)innerPad, 64);       /* start with inner pad */
   rv = hasher->Update((const uint8_t*)text, text_len);     /* then text of datagram */
   rv = hasher->Finish(false, result);   /* finish up 1st pass */
 
   /*
    * perform outer MD5
    */
@@ -1121,17 +1121,17 @@ nsresult MSGCramMD5(const char *text, in
 
 }
 
 
 // digest needs to be a pointer to a DIGEST_LENGTH (16) byte buffer
 nsresult MSGApopMD5(const char *text, int32_t text_len, const char *password, int32_t password_len, unsigned char *digest)
 {
   nsresult rv;
-  nsCAutoString result;
+  nsAutoCString result;
 
   nsCOMPtr<nsICryptoHash> hasher = do_CreateInstance("@mozilla.org/security/hash;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = hasher->Init(nsICryptoHash::MD5);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = hasher->Update((const uint8_t*) text, text_len);
@@ -2034,17 +2034,17 @@ bool MsgAdvanceToNextLine(const char *bu
 NS_MSG_BASE nsresult
 MsgExamineForProxy(const char *scheme, const char *host,
                    int32_t port, nsIProxyInfo **proxyInfo)
 {
   nsresult rv;
   nsCOMPtr<nsIProtocolProxyService> pps =
           do_GetService(NS_PROTOCOLPROXYSERVICE_CONTRACTID, &rv);
   if (NS_SUCCEEDED(rv)) {
-    nsCAutoString spec(scheme);
+    nsAutoCString spec(scheme);
     spec.Append("://");
     spec.Append(host);
     spec.Append(':');
     spec.AppendInt(port);
     // XXXXX - Under no circumstances whatsoever should any code which
     // wants a uri do this. I do this here because I do not, in fact,
     // actually want a uri (the dummy uris created here may not be 
     // syntactically valid for the specific protocol), and all we need
@@ -2137,17 +2137,17 @@ NS_MSG_BASE nsresult MsgTermListToString
 {
   uint32_t count;
   aTermList->Count(&count);
   nsresult rv = NS_OK;
 
   for (uint32_t searchIndex = 0; searchIndex < count;
        searchIndex++)
   {
-    nsCAutoString stream;
+    nsAutoCString stream;
 
     nsCOMPtr<nsIMsgSearchTerm> term;
     aTermList->QueryElementAt(searchIndex, NS_GET_IID(nsIMsgSearchTerm),
                                (void **)getter_AddRefs(term));
     if (!term)
       continue;
 
     if (aOutString.Length() > 1)
@@ -2190,18 +2190,18 @@ NS_MSG_BASE uint64_t ParseUint64Str(cons
 
 NS_MSG_BASE nsresult
 MsgStreamMsgHeaders(nsIInputStream *aInputStream, nsIStreamListener *aConsumer)
 {
   nsLineBuffer<char> *lineBuffer;
   nsresult rv = NS_InitLineBuffer(&lineBuffer);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString msgHeaders;
-  nsCAutoString curLine;
+  nsAutoCString msgHeaders;
+  nsAutoCString curLine;
 
   bool more = true;
 
   // We want to NS_ReadLine until we get to a blank line (the end of the headers)
   while (more)
   {
     rv = NS_ReadLine(aInputStream, lineBuffer, curLine, &more);
     NS_ENSURE_SUCCESS(rv, rv);
@@ -2250,30 +2250,30 @@ MsgDetectCharsetFromFile(nsIFile *aFile,
     = do_CreateInstance(NS_CHARSET_DETECTOR_CONTRACTID_BASE
                         "universal_charset_detector");
   if (!detector) {
     // No universal charset detector, try the default charset detector
     nsString detectorName;
     NS_GetLocalizedUnicharPreferenceWithDefault(nullptr, "intl.charset.detector",
                                                 EmptyString(), detectorName);
     if (!detectorName.IsEmpty()) {
-      nsCAutoString detectorContractID;
+      nsAutoCString detectorContractID;
       detectorContractID.AssignLiteral(NS_CHARSET_DETECTOR_CONTRACTID_BASE);
       AppendUTF16toUTF8(detectorName, detectorContractID);
       detector = do_CreateInstance(detectorContractID.get());
     }
   }
 
   nsresult rv;
   nsCOMPtr<nsIInputStream> inputStream;
   rv = NS_NewLocalFileInputStream(getter_AddRefs(inputStream), aFile);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (detector) {
-    nsCAutoString buffer;
+    nsAutoCString buffer;
 
     nsCOMPtr<CharsetDetectionObserver> observer = new CharsetDetectionObserver();
 
     rv = detector->Init(observer);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsILineInputStream> lineInputStream;
     lineInputStream = do_QueryInterface(inputStream, &rv);
--- a/mailnews/base/util/nsMsgUtils.h
+++ b/mailnews/base/util/nsMsgUtils.h
@@ -54,17 +54,17 @@ NS_MSG_BASE nsresult NS_MsgGetPriorityVa
                        const nsMsgPriorityValue p,
                        nsACString & outValueString);
 
 NS_MSG_BASE nsresult NS_MsgGetUntranslatedPriorityName(
                        const nsMsgPriorityValue p,
                        nsACString & outName);
 
 NS_MSG_BASE nsresult NS_MsgHashIfNecessary(nsAutoString &name);
-NS_MSG_BASE nsresult NS_MsgHashIfNecessary(nsCAutoString &name);
+NS_MSG_BASE nsresult NS_MsgHashIfNecessary(nsAutoCString &name);
 
 NS_MSG_BASE nsresult FormatFileSize(uint64_t size, bool useKB, nsAString &formattedSize);
 
 
 /**
  * given a folder uri, return the path to folder in the user profile directory.
  *
  * @param aFolderURI uri of folder we want the path to, without the scheme
--- a/mailnews/compose/src/nsMsgAppleDoubleEncode.cpp
+++ b/mailnews/compose/src/nsMsgAppleDoubleEncode.cpp
@@ -60,17 +60,17 @@ MacGetFileType(nsIFile   *fs,
     // see what we can find out?
     nsresult      rv;
     nsCOMPtr <nsIURI> tURI;
     if (NS_SUCCEEDED(NS_NewFileURI(getter_AddRefs(tURI), fs)) && tURI)
     {
       nsCOMPtr<nsIMIMEService> mimeFinder (do_GetService(NS_MIMESERVICE_CONTRACTID, &rv));
       if (NS_SUCCEEDED(rv) && mimeFinder) 
       {
-        nsCAutoString mimeType;
+        nsAutoCString mimeType;
         rv = mimeFinder->GetTypeFromURI(tURI, mimeType);
         if (NS_SUCCEEDED(rv)) 
         {
           *fileType = ToNewCString(mimeType);
           return;
         }        
       }
     }
@@ -95,17 +95,17 @@ int ap_encode_init( appledouble_encode_o
 {
   nsCOMPtr <nsIFile> myFile;
   NS_NewNativeLocalFile(nsDependentCString(fname), true, getter_AddRefs(myFile));
   bool exists;
   if (myFile && NS_SUCCEEDED(myFile->Exists(&exists)) && !exists)
     return -1;
 
   nsCOMPtr<nsILocalFileMac> macFile = do_QueryInterface(myFile);
-  nsCAutoString path;
+  nsAutoCString path;
   macFile->GetNativePath(path);
 
 	memset(p_ap_encode_obj, 0, sizeof(appledouble_encode_object));
 	
 	/*
 	**	Fill out the source file inforamtion.
 	*/	
   memcpy(p_ap_encode_obj->fname, path.get(), path.Length());
--- a/mailnews/compose/src/nsMsgAppleEncode.cpp
+++ b/mailnews/compose/src/nsMsgAppleEncode.cpp
@@ -185,17 +185,17 @@ int ap_encode_file_infor(
 	head.entries = NUM_ENTRIES - 1;
 	status = to64(p_ap_encode_obj,
 					(char *) &head,
 					sizeof (head));				
 	if (status != noErr)
 		return status;
 
 	/* write entry descriptors */
-    nsCAutoString leafname;
+    nsAutoCString leafname;
     macFile->GetNativeLeafName(leafname);
 	entries[0].offset = sizeof (head) + sizeof (ap_entry) * head.entries;
 	entries[0].id 	= ENT_NAME;
     entries[0].length = leafname.Length();
 	entries[1].id 	= ENT_FINFO;
 	entries[1].length = sizeof (FInfo) + sizeof (FXInfo);
 	entries[2].id 	= ENT_DATES;
 	entries[2].length = sizeof (ap_dates);
@@ -480,17 +480,17 @@ int ap_encode_data(
 		else
 		{
 			magic_type = text_type;		/* we already know it is a text type.	*/
 		}
 
 		/*
 		**	the data portion header information.
 		*/
-        nsCAutoString leafName;
+        nsAutoCString leafName;
         resFile->GetNativeLeafName(leafName);
 		PR_snprintf(rd_buff, sizeof(rd_buff),
 			"Content-Type: %s; name=\"%s\"" CRLF "Content-Transfer-Encoding: base64" CRLF "Content-Disposition: inline; filename=\"%s\"" CRLF CRLF,
 			magic_type,
 			leafName.get(),
 			leafName.get());
 			
 		status = write_stream(p_ap_encode_obj, 
--- a/mailnews/compose/src/nsMsgAttachment.cpp
+++ b/mailnews/compose/src/nsMsgAttachment.cpp
@@ -221,17 +221,17 @@ NS_IMETHODIMP nsMsgAttachment::SetSize(i
 }
 
 /* boolean equalsUrl (in nsIMsgAttachment attachment); */
 NS_IMETHODIMP nsMsgAttachment::EqualsUrl(nsIMsgAttachment *attachment, bool *_retval)
 {
   NS_ENSURE_ARG_POINTER(attachment);
   NS_ENSURE_ARG_POINTER(_retval);
 
-  nsCAutoString url;
+  nsAutoCString url;
   attachment->GetUrl(url);
 
   *_retval = mUrl.Equals(url);
   return NS_OK;
 }
 
 
 nsresult nsMsgAttachment::DeleteAttachment()
--- a/mailnews/compose/src/nsMsgAttachmentHandler.cpp
+++ b/mailnews/compose/src/nsMsgAttachmentHandler.cpp
@@ -520,17 +520,17 @@ nsMsgAttachmentHandler::SnarfMsgAttachme
         rv =  NS_ERROR_UNEXPECTED;
       goto done;
     }
 
     rv = fetcher->Initialize(mTmpFile, mOutFile, FetcherURLDoneCallback, this);
     rv = GetMessageServiceFromURI(m_uri, getter_AddRefs(messageService));
     if (NS_SUCCEEDED(rv) && messageService)
     {
-      nsCAutoString uri(m_uri);
+      nsAutoCString uri(m_uri);
       uri += (uri.FindChar('?') == kNotFound) ? '?' : '&';
       uri.Append("fetchCompleteMessage=true");
       nsCOMPtr<nsIStreamListener> strListener;
       fetcher->QueryInterface(NS_GET_IID(nsIStreamListener), getter_AddRefs(strListener));
 
       // initialize a new stream converter, that uses the strListener as its input
       // obtain the input stream listener from the new converter,
       // and pass the converter's input stream listener to DisplayMessage
@@ -634,19 +634,19 @@ nsMsgAttachmentHandler::SnarfAttachment(
   }
 
   nsCString sourceURISpec;
   mURL->GetSpec(sourceURISpec);
 #ifdef XP_MACOSX
   if (!m_bogus_attachment && StringBeginsWith(sourceURISpec, NS_LITERAL_CSTRING("file://")))
   {
     // Unescape the path (i.e. un-URLify it) before making a FSSpec
-    nsCAutoString filePath;
+    nsAutoCString filePath;
     filePath.Adopt(nsMsgGetLocalFileFromURL(sourceURISpec.get()));
-    nsCAutoString unescapedFilePath;
+    nsAutoCString unescapedFilePath;
     MsgUnescapeString(filePath, 0, unescapedFilePath);
 
     nsCOMPtr<nsIFile> sourceFile;
     NS_NewNativeLocalFile(unescapedFilePath, true, getter_AddRefs(sourceFile));
     if (!sourceFile)
       return NS_ERROR_FAILURE;
       
     // check if it is a bundle. if it is, we'll zip it. 
@@ -681,17 +681,17 @@ nsMsgAttachmentHandler::SnarfAttachment(
   return fetcher->FireURLRequest(mURL, mTmpFile, mOutFile, FetcherURLDoneCallback, this);
 }
 
 #ifdef XP_MACOSX
 nsresult
 nsMsgAttachmentHandler::ConvertToZipFile(nsILocalFileMac *aSourceFile)
 {
   // append ".zip" to the real file name
-  nsCAutoString zippedName;
+  nsAutoCString zippedName;
   nsresult rv = aSourceFile->GetNativeLeafName(zippedName);
   NS_ENSURE_SUCCESS(rv, rv);
   zippedName.AppendLiteral(".zip");
 
   // create a temporary file that we'll work on
   nsCOMPtr <nsIFile> tmpFile;
   rv = nsMsgCreateTempFile(zippedName.get(), getter_AddRefs(tmpFile));
   NS_ENSURE_SUCCESS(rv, rv);
@@ -744,17 +744,17 @@ nsMsgAttachmentHandler::ConvertToAppleEn
   if (sendResourceFork)
   {
     nsCOMPtr<nsIURL> fileUrl(do_CreateInstance(NS_STANDARDURL_CONTRACTID));
     if (fileUrl)
     {
       rv = fileUrl->SetSpec(aFileURI);
       if (NS_SUCCEEDED(rv))
       {
-        nsCAutoString ext;
+        nsAutoCString ext;
         rv = fileUrl->GetFileExtension(ext);
         if (NS_SUCCEEDED(rv) && !ext.IsEmpty())
         {
           sendResourceFork =
           PL_strcasecmp(ext.get(), "TXT") &&
           PL_strcasecmp(ext.get(), "JPG") &&
           PL_strcasecmp(ext.get(), "GIF") &&
           PL_strcasecmp(ext.get(), "TIF") &&
@@ -1046,17 +1046,17 @@ nsMsgAttachmentHandler::UrlExit(nsresult
     if (mode == nsIMsgSend::nsMsgSaveAsDraft || mode == nsIMsgSend::nsMsgSaveAsTemplate)
       bundle->GetStringFromID(NS_MSG_FAILURE_ON_OBJ_EMBED_WHILE_SAVING, getter_Copies(msg));
     else
       bundle->GetStringFromID(NS_MSG_FAILURE_ON_OBJ_EMBED_WHILE_SENDING, getter_Copies(msg));
     if (!m_realName.IsEmpty())
       printfString = nsTextFormatter::smprintf(msg.get(), m_realName.get());
     else if (NS_SUCCEEDED(mURL->GetSpec(turl)) && !turl.IsEmpty())
     {
-      nsCAutoString unescapedUrl;
+      nsAutoCString unescapedUrl;
       MsgUnescapeString(turl, 0, unescapedUrl);
       if (unescapedUrl.IsEmpty())
         printfString = nsTextFormatter::smprintf(msg.get(), turl.get());
       else
         printfString = nsTextFormatter::smprintf(msg.get(), unescapedUrl.get());
     }
     else
       printfString = nsTextFormatter::smprintf(msg.get(), "?");
@@ -1108,17 +1108,17 @@ nsMsgAttachmentHandler::UrlExit(nsresult
         if (mDeleteFile)
           mTmpFile->Remove(false);
 
         nsCOMPtr<nsIOutputStream> outputStream;
         nsresult rv = NS_NewLocalFileOutputStream(getter_AddRefs(outputStream), mTmpFile,  PR_WRONLY | PR_CREATE_FILE, 00600);
 
         if (NS_SUCCEEDED(rv))
         {
-          nsCAutoString tData;
+          nsAutoCString tData;
           if (NS_FAILED(ConvertFromUnicode(m_charset.get(), conData, tData)))
             LossyCopyUTF16toASCII(conData, tData);
           if (!tData.IsEmpty())
           {
             uint32_t bytesWritten;
             (void) outputStream->Write(tData.get(), tData.Length(), &bytesWritten);
           }
           outputStream->Close();
--- a/mailnews/compose/src/nsMsgCompFields.cpp
+++ b/mailnews/compose/src/nsMsgCompFields.cpp
@@ -626,17 +626,17 @@ nsresult nsMsgCompFields::SplitRecipient
   nsresult rv;
 
   nsCOMPtr<nsIMsgHeaderParser> parser =
     do_GetService(NS_MAILNEWS_MIME_HEADER_PARSER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsIMimeConverter> converter = do_GetService(NS_MIME_CONVERTER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString recipientsStr;
+  nsAutoCString recipientsStr;
   char *names;
   char *addresses;
   uint32_t numAddresses;
 
   CopyUTF16toUTF8(recipients, recipientsStr);
   rv = parser->ParseHeaderAddresses(recipientsStr.get(), &names,
                                     &addresses, &numAddresses);
   if (NS_SUCCEEDED(rv))
@@ -718,17 +718,17 @@ NS_IMETHODIMP nsMsgCompFields::GetDefaul
   *aDefaultCharacterSet = ToNewCString(m_DefaultCharacterSet);
   return *aDefaultCharacterSet ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 NS_IMETHODIMP nsMsgCompFields::CheckCharsetConversion(char **fallbackCharset, bool *_retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
 
-  nsCAutoString headers;
+  nsAutoCString headers;
   for (int16_t i = 0; i < MSG_MAX_HEADERS; i++)
     headers.Append(m_headers[i]);
 
   // charset conversion check
   *_retval = nsMsgI18Ncheck_data_in_charset_range(GetCharacterSet(), NS_ConvertUTF8toUTF16(headers.get()).get(),
                                                   fallbackCharset);
 
   return NS_OK;
--- a/mailnews/compose/src/nsMsgCompUtils.cpp
+++ b/mailnews/compose/src/nsMsgCompUtils.cpp
@@ -282,17 +282,17 @@ mime_generate_headers (nsMsgCompFields *
   const char* pSubject;
   const char* pPriority;
   const char* pReference;
   const char* pOtherHdr;
   char *convbuf;
 
   bool hasDisclosedRecipient = false;
 
-  nsCAutoString headerBuf;    // accumulate header strings to get length
+  nsAutoCString headerBuf;    // accumulate header strings to get length
   headerBuf.Truncate();
 
   NS_ASSERTION (fields, "null fields");
   if (!fields)
     return nullptr;
 
   pFrom = fields->GetFrom();
   if (pFrom)
@@ -442,17 +442,17 @@ mime_generate_headers (nsMsgCompFields *
 
     PUSH_NEWLINE ();
   }
 
 
   nsCOMPtr<nsIHttpProtocolHandler> pHTTPHandler = do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &rv);
   if (NS_SUCCEEDED(rv) && pHTTPHandler)
   {
-    nsCAutoString userAgentString;
+    nsAutoCString userAgentString;
     pHTTPHandler->GetUserAgent(userAgentString);
 
     if (!userAgentString.IsEmpty())
     {
       PUSH_STRING ("User-Agent: ");
       PUSH_STRING(userAgentString.get());
       PUSH_NEWLINE ();
     }
@@ -627,18 +627,18 @@ mime_generate_headers (nsMsgCompFields *
   if (pPriority && *pPriority) 
   {
     nsMsgPriorityValue priorityValue;
 
     NS_MsgGetPriorityFromString(pPriority, priorityValue);
 
     // Skip default priority.
     if (priorityValue != nsMsgPriority::Default) {
-      nsCAutoString priorityName;
-      nsCAutoString priorityValueString;
+      nsAutoCString priorityName;
+      nsAutoCString priorityValueString;
 
       NS_MsgGetPriorityValueString(priorityValue, priorityValueString);
       NS_MsgGetUntranslatedPriorityName(priorityValue, priorityName);
 
       // Output format: [X-Priority: <pValue> (<pName>)]
       PUSH_STRING("X-Priority: ");
       PUSH_STRING(priorityValueString.get());
       PUSH_STRING(" (");
@@ -1135,17 +1135,17 @@ RFC2231ParmFolding(const char *parmName,
 {
   NS_ENSURE_TRUE(parmName && *parmName && !parmValue.IsEmpty(), nullptr);
 
   bool needEscape;
   nsCString dupParm;
 
   if (!NS_IsAscii(parmValue.get()) || is7bitCharset(charset)) {
     needEscape = true;
-    nsCAutoString nativeParmValue;
+    nsAutoCString nativeParmValue;
     ConvertFromUnicode(charset.get(), parmValue, nativeParmValue);
     MsgEscapeString(nativeParmValue, nsINetUtil::ESCAPE_ALL, dupParm);
   }
   else {
     needEscape = false;
     dupParm.Adopt(
       msg_make_filename_qtext(NS_LossyConvertUTF16toASCII(parmValue).get(),
                               true));
@@ -1701,17 +1701,17 @@ nsMsgNewURL(nsIURI** aInstancePtrResult,
   if (nullptr == aInstancePtrResult)
     return NS_ERROR_NULL_POINTER;
   nsCOMPtr<nsIIOService> pNetService =
     mozilla::services::GetIOService();
   NS_ENSURE_TRUE(pNetService, NS_ERROR_UNEXPECTED);
   if (PL_strstr(aSpec, "://") == nullptr && strncmp(aSpec, "data:", 5))
   {
     //XXXjag Temporary fix for bug 139362 until the real problem(bug 70083) get fixed
-    nsCAutoString uri(NS_LITERAL_CSTRING("http://"));
+    nsAutoCString uri(NS_LITERAL_CSTRING("http://"));
     uri.Append(aSpec);
     rv = pNetService->NewURI(uri, nullptr, nullptr, aInstancePtrResult);
   }
   else
     rv = pNetService->NewURI(nsDependentCString(aSpec), nullptr, nullptr, aInstancePtrResult);
   return rv;
 }
 
@@ -1752,17 +1752,17 @@ nsMsgParseURLHost(const char *url)
 {
   nsIURI        *workURI = nullptr;
   nsresult      rv;
 
   rv = nsMsgNewURL(&workURI, url);
   if (NS_FAILED(rv) || !workURI)
     return nullptr;
 
-  nsCAutoString host;
+  nsAutoCString host;
   rv = workURI->GetHost(host);
   NS_IF_RELEASE(workURI);
   if (NS_FAILED(rv))
     return nullptr;
 
   return ToNewCString(host);
 }
 
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -280,26 +280,26 @@ bool nsMsgCompose::IsEmbeddedObjectSafe(
     return false;
 
   if (!objURL.IsEmpty())
   {
     nsCOMPtr<nsIURI> uri;
     rv = NS_NewURI(getter_AddRefs(uri), objURL);
     if (NS_SUCCEEDED(rv) && uri)
     {
-      nsCAutoString scheme;
+      nsAutoCString scheme;
       rv = uri->GetScheme(scheme);
       if (NS_SUCCEEDED(rv) && scheme.Equals(originalScheme, nsCaseInsensitiveCStringComparator()))
       {
-        nsCAutoString host;
+        nsAutoCString host;
         rv = uri->GetAsciiHost(host);
         // mailbox url don't have a host therefore don't be too strict.
         if (NS_SUCCEEDED(rv) && (host.IsEmpty() || originalHost || host.Equals(originalHost, nsCaseInsensitiveCStringComparator())))
         {
-          nsCAutoString path;
+          nsAutoCString path;
           rv = uri->GetPath(path);
           if (NS_SUCCEEDED(rv))
           {
             const char * query = strrchr(path.get(), '?');
             if (query && PL_strncasecmp(path.get(), originalPath, query - path.get()) == 0)
                 return true; //This object is a part of the original message, we can send it safely.
           }
         }
@@ -920,17 +920,17 @@ nsMsgCompose::Initialize(nsIMsgComposePa
   nsCOMPtr<nsIMsgComposeService> composeService = do_GetService(NS_MSGCOMPOSESERVICE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv,rv);
 
   rv = composeService->DetermineComposeHTML(m_identity, format, &m_composeHTML);
   NS_ENSURE_SUCCESS(rv,rv);
 
   if (composeFields)
   {
-    nsCAutoString draftId; // will get set for drafts and templates
+    nsAutoCString draftId; // will get set for drafts and templates
     rv = composeFields->GetDraftId(getter_Copies(draftId));
     NS_ENSURE_SUCCESS(rv,rv);
 
     // Set return receipt flag and type, and if we should attach a vCard
     // by checking the identity prefs - but don't clobber the values for
     // drafts and templates as they were set up already by mime when
     // initializing the message.
     if (m_identity && draftId.IsEmpty())
@@ -1668,17 +1668,17 @@ nsresult nsMsgCompose::CreateMessage(con
                                      nsIMsgCompFields * compFields)
 {
   nsresult rv = NS_OK;
 
   mType = type;
   mDraftDisposition = nsIMsgFolder::nsMsgDispositionState_None;
 
   mDeleteDraft = (type == nsIMsgCompType::Draft);
-  nsCAutoString msgUri(originalMsgURI);
+  nsAutoCString msgUri(originalMsgURI);
   bool fileUrl = StringBeginsWith(msgUri, NS_LITERAL_CSTRING("file:"));
   int32_t typeIndex = msgUri.Find("type=application/x-message-display");
   if (typeIndex != kNotFound && typeIndex > 0)
   {
     // Strip out type=application/x-message-display because it confuses libmime.
     msgUri.Cut(typeIndex, sizeof("type=application/x-message-display"));
     if (fileUrl) // we're dealing with an .eml file msg
     {
@@ -1838,20 +1838,20 @@ nsresult nsMsgCompose::CreateMessage(con
       }
     }
 
     // We want to treat this message as a reference too
     nsCOMPtr<nsIMsgDBHdr> msgHdr;
     rv = GetMsgDBHdrFromURI(originalMsgURI, getter_AddRefs(msgHdr));
     if (NS_SUCCEEDED(rv))
     {
-      nsCAutoString messageId;
+      nsAutoCString messageId;
       msgHdr->GetMessageId(getter_Copies(messageId));
 
-      nsCAutoString reference;
+      nsAutoCString reference;
       reference.Append(NS_LITERAL_CSTRING("<"));
       reference.Append(messageId);
       reference.Append(NS_LITERAL_CSTRING(">"));
       // We're forwarding, which means we're composing a message that has no
       // references yet, so we can set the value safely
       m_compFields->SetReferences(reference.get());
     }
 
@@ -1915,17 +1915,17 @@ nsresult nsMsgCompose::CreateMessage(con
       {
         rv = msgHdr->GetCharset(getter_Copies(charset));
         if (NS_FAILED(rv)) return rv;
       }
 
       // save the charset of a message being replied to because
       // we need to use it when decoding RFC-2047-encoded author name
       // with |charsetOverride|.
-      nsCAutoString originCharset(charset);
+      nsAutoCString originCharset(charset);
 
       bool replyInDefault = false;
       prefs->GetBoolPref("mailnews.reply_in_default_charset",
                           &replyInDefault);
       // Use send_default_charset if reply_in_default_charset is on.
       if (replyInDefault)
       {
         nsString str;
@@ -1964,17 +1964,17 @@ nsresult nsMsgCompose::CreateMessage(con
           // firstly, get the database via the folder
           nsCOMPtr<nsIMsgFolder> folder;
           msgHdr->GetFolder(getter_AddRefs(folder));
           if (folder) {
             nsCOMPtr<nsIMsgDatabase> db;
             folder->GetMsgDatabase(getter_AddRefs(db));
 
             if (db) {
-              nsCAutoString reference;
+              nsAutoCString reference;
               msgHdr->GetStringReference(0, reference);
 
               nsCOMPtr<nsIMsgDBHdr> refHdr;
               db->GetMsgHdrForMessageID(reference.get(), getter_AddRefs(refHdr));
 
               if (refHdr) {
                 nsCString refSubject;
                 rv = refHdr->GetSubject(getter_Copies(refSubject));
@@ -2138,29 +2138,29 @@ nsresult nsMsgCompose::CreateMessage(con
 
             // Setup quoting callbacks for later...
             mWhatHolder = 1;
             break;
           }
         case nsIMsgCompType::ForwardAsAttachment:
           {
             // Add the forwarded message in the references, first
-            nsCAutoString messageId;
+            nsAutoCString messageId;
             msgHdr->GetMessageId(getter_Copies(messageId));
             if (isFirstPass)
             {
-              nsCAutoString reference;
+              nsAutoCString reference;
               reference.Append(NS_LITERAL_CSTRING("<"));
               reference.Append(messageId);
               reference.Append(NS_LITERAL_CSTRING(">"));
               m_compFields->SetReferences(reference.get());
             }
             else
             {
-              nsCAutoString references;
+              nsAutoCString references;
               m_compFields->GetReferences(getter_Copies(references));
               references.Append(NS_LITERAL_CSTRING(" <"));
               references.Append(messageId);
               references.Append(NS_LITERAL_CSTRING(">"));
               m_compFields->SetReferences(references.get());
             }
 
             uint32_t flags;
@@ -2226,17 +2226,17 @@ nsresult nsMsgCompose::CreateMessage(con
               }
               m_compFields->SetSubject(subject);
             }
             break;
           }
         case nsIMsgCompType::Redirect:
           {
             // For a redirect, set the Reply-To: header to what was in the original From: header...
-            nsCAutoString author;
+            nsAutoCString author;
             msgHdr->GetAuthor(getter_Copies(author));
             m_compFields->SetReplyTo(author.get());
 
             // ... and empty out the various recipient headers
             nsAutoString empty;
             m_compFields->SetTo(empty);
             m_compFields->SetCc(empty);
             m_compFields->SetBcc(empty);
@@ -2338,17 +2338,17 @@ QuotingOutputStreamListener::QuotingOutp
     if (originalMsgHdr && !quoteHeaders)
     {
       // Setup the cite information....
       nsCString myGetter;
       if (NS_SUCCEEDED(originalMsgHdr->GetMessageId(getter_Copies(myGetter))))
       {
         if (!myGetter.IsEmpty())
         {
-          nsCAutoString buf;
+          nsAutoCString buf;
           mCiteReference.AssignLiteral("mid:");
           MsgEscapeURL(myGetter,
                        nsINetUtil::ESCAPE_URL_FILE_BASENAME | nsINetUtil::ESCAPE_URL_FORCED,
                        buf);
           mCiteReference.Append(NS_ConvertASCIItoUTF16(buf));
         }
       }
 
@@ -3315,17 +3315,17 @@ NS_IMETHODIMP nsMsgCompose::RememberQueu
   else if (mType == nsIMsgCompType::ForwardAsAttachment ||
            mType == nsIMsgCompType::ForwardInline)
     dispositionSetting = "forwarded";
 
   nsMsgKey msgKey;
   if (mMsgSend)
   {
     mMsgSend->GetMessageKey(&msgKey);
-    nsCAutoString msgUri(m_folderName);
+    nsAutoCString msgUri(m_folderName);
     nsCString identityKey;
 
     m_identity->GetKey(identityKey);
 
     int32_t insertIndex = StringBeginsWith(msgUri, NS_LITERAL_CSTRING("mailbox")) ? 7 : 4;
     msgUri.Insert("-message", insertIndex); // "mailbox/imap: -> "mailbox/imap-message:"
     msgUri.Append('#');
     msgUri.AppendInt(msgKey);
@@ -3881,17 +3881,17 @@ nsMsgComposeSendListener::RemoveCurrentD
         nsCOMPtr <nsIMsgImapMailFolder> imapFolder = do_QueryInterface(msgFolder);
         NS_ASSERTION(imapFolder, "The draft folder MUST be an imap folder in order to mark the msg delete!");
         if (NS_SUCCEEDED(rv) && imapFolder)
         {
           const char * str = PL_strchr(curDraftIdURL.get(), '#');
           NS_ASSERTION(str, "Failed to get current draft id url");
           if (str)
           {
-            nsCAutoString srcStr(str+1);
+            nsAutoCString srcStr(str+1);
             nsresult err;
             nsMsgKey messageID = srcStr.ToInteger(&err);
             if (messageID != nsMsgKey_None)
             {
               rv = imapFolder->StoreImapFlags(kImapMsgDeletedFlag, true,
                                               &messageID, 1, nullptr);
             }
           }
@@ -4093,47 +4093,47 @@ nsMsgCompose::LoadDataFromFile(nsIFile *
     else {
       readSize = 0;
     }
   }
   inputFile->Close();
 
   readSize = (uint32_t) fileSize;
 
-  nsCAutoString sigEncoding(nsMsgI18NParseMetaCharset(file));
+  nsAutoCString sigEncoding(nsMsgI18NParseMetaCharset(file));
   bool removeSigCharset = !sigEncoding.IsEmpty() && m_composeHTML;
 
   if (sigEncoding.IsEmpty()) {
     if (aAllowUTF8 && MsgIsUTF8(nsDependentCString(readBuf))) {
       sigEncoding.Assign("UTF-8");
     }
     else if (sigEncoding.IsEmpty() && aAllowUTF16 &&
              readSize % 2 == 0 && readSize >= 2 &&
              ((readBuf[0] == char(0xFE) && readBuf[1] == char(0xFF)) ||
               (readBuf[0] == char(0xFF) && readBuf[1] == char(0xFE)))) {
       sigEncoding.Assign("UTF-16");
     }
     else {
       //default to platform encoding for plain text files w/o meta charset
-      nsCAutoString textFileCharset;
+      nsAutoCString textFileCharset;
       nsMsgI18NTextFileCharset(textFileCharset);
       sigEncoding.Assign(textFileCharset);
     }
   }
 
-  nsCAutoString readStr(readBuf, (int32_t) fileSize);
+  nsAutoCString readStr(readBuf, (int32_t) fileSize);
   PR_FREEIF(readBuf);
 
   if (NS_FAILED(ConvertToUnicode(sigEncoding.get(), readStr, sigData)))
     CopyASCIItoUTF16(readStr, sigData);
 
   //remove sig meta charset to allow user charset override during composition
   if (removeSigCharset)
   {
-    nsCAutoString metaCharset("charset=");
+    nsAutoCString metaCharset("charset=");
     metaCharset.Append(sigEncoding);
     int32_t pos = sigData.Find(metaCharset.BeginReading(), true);
     if (pos != kNotFound)
       sigData.Cut(pos, metaCharset.Length());
   }
 
   return NS_OK;
 }
@@ -4179,17 +4179,17 @@ nsMsgCompose::ProcessSignature(nsIMsgIde
   // insert the correct HTML into the composer to have it work, but if we
   // are doing plain text compose, we should insert some sort of message
   // saying "Image Signature Omitted" or something (not done yet).
   //
   // If there's a sig pref, it will only be used if there is no sig file defined,
   // thus if attach_signature is checked, htmlSigText is ignored (bug 324495).
   // Plain-text signatures may or may not have a trailing line break (bug 428040).
 
-  nsCAutoString sigNativePath;
+  nsAutoCString sigNativePath;
   bool          attachFile = false;
   bool          useSigFile = false;
   bool          htmlSig = false;
   bool          imageSig = false;
   nsAutoString  sigData;
   nsAutoString sigOutput;
   int32_t      reply_on_top = 0;
   bool         sig_bottom = true;
@@ -4214,17 +4214,17 @@ nsMsgCompose::ProcessSignature(nsIMsgIde
         if (NS_SUCCEEDED(rv) && !sigNativePath.IsEmpty()) {
           bool exists = false;
           sigFile->Exists(&exists);
           if (exists) {
             useSigFile = true; // ok, there's a signature file
 
             // Now, most importantly, we need to figure out what the content type is for
             // this signature...if we can't, we assume text
-            nsCAutoString sigContentType;
+            nsAutoCString sigContentType;
             nsresult rv2; // don't want to clobber the other rv
             nsCOMPtr<nsIMIMEService> mimeFinder (do_GetService(NS_MIMESERVICE_CONTRACTID, &rv2));
             if (NS_SUCCEEDED(rv2)) {
               rv2 = mimeFinder->GetTypeFromFile(sigFile, sigContentType);
               if (NS_SUCCEEDED(rv2)) {
                 if (StringBeginsWith(sigContentType, NS_LITERAL_CSTRING("image/"), nsCaseInsensitiveCStringComparator()))
                   imageSig = true;
                 else if (sigContentType.Equals(TEXT_HTML, nsCaseInsensitiveCStringComparator()))
--- a/mailnews/compose/src/nsMsgComposeService.cpp
+++ b/mailnews/compose/src/nsMsgComposeService.cpp
@@ -427,17 +427,17 @@ nsMsgComposeService::GetOrigWindowSelect
 
   nsCOMPtr<nsIDOMWindow> domWindow(do_GetInterface(childAsItem, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsISelection> sel;
   rv = domWindow->GetSelection(getter_AddRefs(sel));
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool requireMultipleWords = true;
-  nsCAutoString charsOnlyIf;
+  nsAutoCString charsOnlyIf;
   prefs->GetBoolPref(PREF_MAILNEWS_REPLY_QUOTING_SELECTION_MULTI_WORD, &requireMultipleWords);
   prefs->GetCharPref(PREF_MAILNEWS_REPLY_QUOTING_SELECTION_ONLY_IF, getter_Copies(charsOnlyIf));
   if (sel && (requireMultipleWords || !charsOnlyIf.IsEmpty()))
   {
     nsAutoString selPlain;
     rv = sel->ToString(selPlain);
     NS_ENSURE_SUCCESS(rv, rv);
 
@@ -509,17 +509,17 @@ nsMsgComposeService::OpenComposeWindow(c
     GetDefaultIdentity(getter_AddRefs(identity));
 
   /* Actually, the only way to implement forward inline is to simulate a template message.
      Maybe one day when we will have more time we can change that
   */
   if (type == nsIMsgCompType::ForwardInline || type == nsIMsgCompType::Draft || type == nsIMsgCompType::Template
     || type == nsIMsgCompType::ReplyWithTemplate || type == nsIMsgCompType::Redirect)
   {
-    nsCAutoString uriToOpen(originalMsgURI);
+    nsAutoCString uriToOpen(originalMsgURI);
     uriToOpen += (uriToOpen.FindChar('?') == kNotFound) ? '?' : '&';
     uriToOpen.Append("fetchCompleteMessage=true");
     if (type == nsIMsgCompType::Redirect)
       uriToOpen.Append("&redirect=true");
 
     aMsgWindow->SetCharsetOverride(true);
     return LoadDraftOrTemplate(uriToOpen, type == nsIMsgCompType::ForwardInline || type == nsIMsgCompType::Draft ?
                                nsMimeOutput::nsMimeMessageDraftOrTemplate : nsMimeOutput::nsMimeMessageEditorTemplate,
@@ -540,41 +540,41 @@ nsMsgComposeService::OpenComposeWindow(c
       // When doing a reply (except with a template) see if there's a selection that we should quote
       if (type == nsIMsgCompType::Reply ||
           type == nsIMsgCompType::ReplyAll ||
           type == nsIMsgCompType::ReplyToSender ||
           type == nsIMsgCompType::ReplyToGroup ||
           type == nsIMsgCompType::ReplyToSenderAndGroup ||
           type == nsIMsgCompType::ReplyToList)
       {
-        nsCAutoString selHTML;
+        nsAutoCString selHTML;
         if (NS_SUCCEEDED(GetOrigWindowSelection(type, aMsgWindow, selHTML)))
           pMsgComposeParams->SetHtmlToQuote(selHTML);
       }
 
       if (originalMsgURI && *originalMsgURI)
       {
         if (type == nsIMsgCompType::NewsPost)
         {
-          nsCAutoString newsURI(originalMsgURI);
-          nsCAutoString group;
-          nsCAutoString host;
+          nsAutoCString newsURI(originalMsgURI);
+          nsAutoCString group;
+          nsAutoCString host;
 
           int32_t slashpos = newsURI.RFindChar('/');
           if (slashpos > 0 )
           {
             // uri is "[s]news://host[:port]/group"
             host = StringHead(newsURI, slashpos);
             group = Substring(newsURI, slashpos + 1);
 
           }
           else
             group = originalMsgURI;
 
-          nsCAutoString unescapedName;
+          nsAutoCString unescapedName;
           MsgUnescapeString(group,
                             nsINetUtil::ESCAPE_URL_FILE_BASENAME | nsINetUtil::ESCAPE_URL_FORCED,
                             unescapedName);
           pMsgCompFields->SetNewsgroups(NS_ConvertUTF8toUTF16(unescapedName));
           pMsgCompFields->SetNewshost(host.get());
         }
         else
         {
@@ -1100,28 +1100,28 @@ NS_IMETHODIMP nsMsgComposeService::Reply
 
   nsCOMPtr <nsIMsgFolder> templateFolder;
   nsCOMPtr <nsIMsgDatabase> templateDB;
   nsCString templateMsgHdrUri;
   const char * query = PL_strstr(templateUri, "?messageId=");
   if (!query)
     return NS_ERROR_FAILURE;
 
-  nsCAutoString folderUri(Substring(templateUri, query)); 
+  nsAutoCString folderUri(Substring(templateUri, query)); 
   nsresult rv = GetExistingFolder(folderUri, getter_AddRefs(templateFolder));
   NS_ENSURE_SUCCESS(rv, rv);
   rv = templateFolder->GetMsgDatabase(getter_AddRefs(templateDB));
   NS_ENSURE_SUCCESS(rv, rv);
 
   const char *subject = PL_strstr(templateUri, "&subject=");
   if (subject)
   {
     const char *subjectEnd = subject + strlen(subject);
-    nsCAutoString messageId(Substring(query + 11, subject));
-    nsCAutoString subjectString(Substring(subject + 9, subjectEnd));
+    nsAutoCString messageId(Substring(query + 11, subject));
+    nsAutoCString subjectString(Substring(subject + 9, subjectEnd));
     templateDB->GetMsgHdrForMessageID(messageId.get(), getter_AddRefs(helper->mTemplateHdr));
     if (helper->mTemplateHdr)
       templateFolder->GetUriForMsg(helper->mTemplateHdr, templateMsgHdrUri);
     // to use the subject, we'd need to expose a method to find a message by subject,
     // or painfully iterate through messages...We'll try to make the message-id
     // not change when saving a template first.
   }
   if (templateMsgHdrUri.IsEmpty())
@@ -1365,17 +1365,17 @@ nsresult nsMsgComposeService::AddGlobalH
     if (NS_SUCCEEDED(rv) && !globalHtmlDomainList.IsEmpty()) {
       nsTArray<nsCString> domainArray;
 
       // Get user's current HTML domain set for send format
       nsCString currentHtmlDomainList;
       rv = prefBranch->GetCharPref(USER_CURRENT_HTMLDOMAINLIST_PREF_NAME, getter_Copies(currentHtmlDomainList));
       NS_ENSURE_SUCCESS(rv,rv);
 
-      nsCAutoString newHtmlDomainList(currentHtmlDomainList);
+      nsAutoCString newHtmlDomainList(currentHtmlDomainList);
       // Get the current html domain list into new list var
       ParseString(currentHtmlDomainList, DOMAIN_DELIMITER, domainArray);
 
       // Get user's current Plaintext domain set for send format
       nsCString currentPlaintextDomainList;
       rv = prefBranch->GetCharPref(USER_CURRENT_PLAINTEXTDOMAINLIST_PREF_NAME, getter_Copies(currentPlaintextDomainList));
       NS_ENSURE_SUCCESS(rv,rv);
 
--- a/mailnews/compose/src/nsMsgQuote.cpp
+++ b/mailnews/compose/src/nsMsgQuote.cpp
@@ -120,17 +120,17 @@ nsMsgQuote::QuoteMessage(const char *msg
 {
   nsresult  rv;
   if (!msgURI)
     return NS_ERROR_INVALID_ARG;
 
   mQuoteHeaders = quoteHeaders;
   mStreamListener = aQuoteMsgStreamListener;
 
-  nsCAutoString msgUri(msgURI);
+  nsAutoCString msgUri(msgURI);
   bool fileUrl = !strncmp(msgURI, "file:", 5);
   bool forwardedMessage = PL_strstr(msgURI, "&realtype=message/rfc822") != nullptr;
   nsCOMPtr<nsIURI> aURL;
   if (fileUrl)
   {
     msgUri.Replace(0, 5, NS_LITERAL_CSTRING("mailbox:"));
     msgUri.AppendLiteral("?number=0");
     rv = NS_NewURI(getter_AddRefs(aURL), msgUri);
@@ -147,17 +147,17 @@ nsMsgQuote::QuoteMessage(const char *msg
     if (NS_FAILED(rv)) return rv;
     rv = msgService->GetUrlForUri(msgURI, getter_AddRefs(aURL), nullptr);
   }
   if (NS_FAILED(rv)) return rv;
 
   nsCOMPtr <nsIURL> mailNewsUrl = do_QueryInterface(aURL, &rv);
   NS_ENSURE_SUCCESS(rv,rv);
 
-  nsCAutoString queryPart;
+  nsAutoCString queryPart;
   rv = mailNewsUrl->GetQuery(queryPart);
   if (!queryPart.IsEmpty())
     queryPart.Append('&');
 
   if (headersOnly) /* We don't need to quote the message body but we still need to extract the headers */
     queryPart.Append("header=only");
   else if (quoteHeaders)
     queryPart.Append("header=quote");
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -553,17 +553,17 @@ nsMsgComposeAndSend::GatherMimeAttachmen
     tempfile->Close();
 
     m_plaintext = new nsMsgAttachmentHandler;
     if (!m_plaintext)
       goto FAILMEM;
     m_plaintext->SetMimeDeliveryState(this);
     m_plaintext->m_bogus_attachment = true;
 
-    nsCAutoString tempURL;
+    nsAutoCString tempURL;
     rv = NS_GetURLSpecFromFile(mHTMLFile, tempURL);
     if (NS_FAILED(rv) || NS_FAILED(nsMsgNewURL(getter_AddRefs(m_plaintext->mURL), tempURL.get())))
     {
       delete m_plaintext;
       m_plaintext = nullptr;
       goto FAILMEM;
     }
 
@@ -1312,47 +1312,47 @@ nsMsgComposeAndSend::GetEmbeddedObjectIn
   nsCOMPtr<nsIDOMHTMLAnchorElement>   anchor = (do_QueryInterface(node));
 
   // First, try to see if the body as a background image
   if (body)
   {
     nsAutoString    tUrl;
     if (NS_SUCCEEDED(body->GetBackground(tUrl)))
     {
-      nsCAutoString turlC;
+      nsAutoCString turlC;
       CopyUTF16toUTF8(tUrl, turlC);
       if (NS_FAILED(nsMsgNewURL(getter_AddRefs(attachment->m_url), turlC.get())))
         return NS_OK;
      }
   }
   else if (image)        // Is this an image?
   {
     nsString    tUrl;
     nsString    tName;
     nsString    tDesc;
 
     // Create the URI
     if (NS_FAILED(image->GetSrc(tUrl)))
       return NS_ERROR_FAILURE;
-    nsCAutoString turlC;
+    nsAutoCString turlC;
     CopyUTF16toUTF8(tUrl, turlC);
     if (NS_FAILED(nsMsgNewURL(getter_AddRefs(attachment->m_url), turlC.get())))
     {
       // Well, the first time failed...which means we probably didn't get
       // the full path name...
       //
       nsIDOMDocument    *ownerDocument = nullptr;
       node->GetOwnerDocument(&ownerDocument);
       if (ownerDocument)
       {
         nsIDocument     *doc = nullptr;
         if (NS_FAILED(ownerDocument->QueryInterface(NS_GET_IID(nsIDocument),(void**)&doc)) || !doc)
           return NS_ERROR_OUT_OF_MEMORY;
 
-        nsCAutoString spec;
+        nsAutoCString spec;
         nsIURI *uri = doc->GetDocumentURI();
 
         if (!uri)
           return NS_ERROR_OUT_OF_MEMORY;
 
         uri->GetSpec(spec);
 
         // Ok, now get the path to the root doc and tack on the name we
@@ -1380,30 +1380,30 @@ nsMsgComposeAndSend::GetEmbeddedObjectIn
   }
   else if (link)        // Is this a link?
   {
     nsString    tUrl;
 
     // Create the URI
     rv = link->GetHref(tUrl);
     NS_ENSURE_SUCCESS(rv, rv);
-    nsCAutoString turlC;
+    nsAutoCString turlC;
     CopyUTF16toUTF8(tUrl, turlC);
     rv = nsMsgNewURL(getter_AddRefs(attachment->m_url), turlC.get());
     NS_ENSURE_SUCCESS(rv, rv);
   }
   else if (anchor)
   {
     nsString    tUrl;
     nsString    tName;
 
     // Create the URI
     rv = anchor->GetHref(tUrl);
     NS_ENSURE_SUCCESS(rv, rv);
-    nsCAutoString turlC;
+    nsAutoCString turlC;
     CopyUTF16toUTF8(tUrl, turlC);
     // ignore errors here.
     (void) nsMsgNewURL(getter_AddRefs(attachment->m_url), turlC.get());
     rv = anchor->GetName(tName);
     NS_ENSURE_SUCCESS(rv, rv);
     LossyCopyUTF16toASCII(tName, attachment->m_realName);
   }
   else
@@ -1435,17 +1435,17 @@ nsMsgComposeAndSend::GetEmbeddedObjectIn
         if (NS_FAILED(rv))
           isAValidFile = false;
         else
         {
           if (anchor)
           {
             // One more test, if the anchor points to a local network server, let's check what the pref
             // mail.compose.dont_attach_source_of_local_network_links tells us to do.
-            nsCAutoString urlSpec;
+            nsAutoCString urlSpec;
             rv = attachment->m_url->GetSpec(urlSpec);
             if (NS_SUCCEEDED(rv))
               if (StringBeginsWith(urlSpec, NS_LITERAL_CSTRING("file://///")))
               {
                 nsCOMPtr<nsIPrefBranch> pPrefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
                 if (pPrefBranch)
                 {
                   bool dontSend = false;
@@ -2201,41 +2201,41 @@ nsMsgComposeAndSend::AddCompFieldLocalAt
           {
             nsresult  rv = NS_OK;
             nsCOMPtr<nsIMIMEService> mimeFinder (do_GetService(NS_MIMESERVICE_CONTRACTID, &rv));
             if (NS_SUCCEEDED(rv) && mimeFinder)
             {
               nsCOMPtr<nsIURL> fileUrl(do_CreateInstance(NS_STANDARDURL_CONTRACTID));
               if (fileUrl)
               {
-                nsCAutoString fileExt;
+                nsAutoCString fileExt;
                 //First try using the real file name
                 rv = fileUrl->SetFileName(m_attachments[newLoc].m_realName);
                 if (NS_SUCCEEDED(rv))
                 {
                   rv = fileUrl->GetFileExtension(fileExt);
                   if (NS_SUCCEEDED(rv) && !fileExt.IsEmpty()) {
-                    nsCAutoString type;
+                    nsAutoCString type;
                     mimeFinder->GetTypeFromExtension(fileExt, type);
   #ifndef XP_MACOSX
                     if (!type.Equals("multipart/appledouble"))  // can't do apple double on non-macs
   #endif
                     m_attachments[newLoc].m_type = type;
                   }
                 }
 
                 //Then try using the url if we still haven't figured out the content type
                 if (m_attachments[newLoc].m_type.IsEmpty())
                 {
                   rv = fileUrl->SetSpec(url);
                   if (NS_SUCCEEDED(rv))
                   {
                     rv = fileUrl->GetFileExtension(fileExt);
                     if (NS_SUCCEEDED(rv) && !fileExt.IsEmpty()) {
-                      nsCAutoString type;
+                      nsAutoCString type;
                       mimeFinder->GetTypeFromExtension(fileExt, type);
   #ifndef XP_MACOSX
                     if (!type.Equals("multipart/appledouble"))  // can't do apple double on non-macs
   #endif
                       m_attachments[newLoc].m_type = type;
                     // rtf and vcs files may look like text to sniffers,
                     // but they're not human readable.
                     if (type.IsEmpty() && !fileExt.IsEmpty() &&
@@ -2969,27 +2969,27 @@ nsMsgComposeAndSend::AddDefaultCustomHea
   nsCString headersList;
   // get names of prefs containing headers to add
   nsresult rv = mUserIdentity->GetCharAttribute("headers", headersList);
   if (NS_SUCCEEDED(rv) && !headersList.IsEmpty()) {
     int32_t start = 0;
     int32_t end = 0;
     int32_t len = 0;
     // preserve any custom headers that have been added through the UI
-    nsCAutoString newHeaderVal(mCompFields->GetOtherRandomHeaders());
+    nsAutoCString newHeaderVal(mCompFields->GetOtherRandomHeaders());
 
     while (end != -1) {
       end = headersList.FindChar(',', start);
       if (end == -1) {
         len = headersList.Length() - start;
       } else {
         len = end - start;
       }
       // grab the name of the current header pref
-      nsCAutoString headerName("header.");
+      nsAutoCString headerName("header.");
       headerName.Append(Substring(headersList, start, len));
       start = end + 1;
 
       nsCString headerVal;
       rv = mUserIdentity->GetCharAttribute(headerName.get(), headerVal);
       if (NS_SUCCEEDED(rv)) {
         int32_t colonIdx = headerVal.FindChar(':') + 1;
         if (colonIdx != 0) { // check that the header is *most likely* valid.
@@ -3025,26 +3025,26 @@ nsMsgComposeAndSend::AddMailFollowupToHe
   nsDependentCString customHeaders(mCompFields->GetOtherRandomHeaders());
   // ...and look for MFT-Header.  Stop here if MFT is already set.
   NS_NAMED_LITERAL_CSTRING(mftHeaderLabel, "Mail-Followup-To: ");
   if (StringBeginsWith(customHeaders, mftHeaderLabel) ||
       customHeaders.Find("\r\nMail-Followup-To: ") != -1)
     return NS_OK;
 
   // Get list of subscribed mailing lists
-  nsCAutoString mailing_lists;
+  nsAutoCString mailing_lists;
   rv = mUserIdentity->GetCharAttribute("subscribed_mailing_lists", mailing_lists);
   // Stop here if this list is missing or empty
   if (NS_FAILED(rv) || mailing_lists.IsEmpty())
     return NS_OK;
 
   // Get a list of all recipients excluding bcc
   nsDependentCString to(mCompFields->GetTo());
   nsDependentCString cc(mCompFields->GetCc());
-  nsCAutoString recipients;
+  nsAutoCString recipients;
 
   if (to.IsEmpty() && cc.IsEmpty())
     // We have bcc recipients only, so we don't add the Mail-Followup-To header
     return NS_OK;
 
   if (!to.IsEmpty() && cc.IsEmpty())
     recipients = to;
   else if (to.IsEmpty() && !cc.IsEmpty())
@@ -3097,40 +3097,40 @@ nsMsgComposeAndSend::AddMailFollowupToHe
 nsresult
 nsMsgComposeAndSend::AddMailReplyToHeader() {
   nsresult rv;
 
   // Get OtherRandomHeaders...
   nsDependentCString customHeaders(mCompFields->GetOtherRandomHeaders());
   // ...and look for MRT-Header.  Stop here if MRT is already set.
   NS_NAMED_LITERAL_CSTRING(mrtHeaderLabel, "Mail-Reply-To: ");
-  nsCAutoString headers_match = nsCAutoString("\r\n");
+  nsAutoCString headers_match = nsAutoCString("\r\n");
   headers_match.Append(mrtHeaderLabel);
   if ((StringHead(customHeaders, mrtHeaderLabel.Length()) == mrtHeaderLabel) ||
       (customHeaders.Find(headers_match) != -1))
     return NS_OK;
 
   // Get list of reply-to mangling mailing lists
-  nsCAutoString mailing_lists;
+  nsAutoCString mailing_lists;
   rv = mUserIdentity->GetCharAttribute("replyto_mangling_mailing_lists", mailing_lists);
   // Stop here if this list is missing or empty
   if (NS_FAILED(rv) || mailing_lists.IsEmpty())
     return NS_OK;
 
   // MRT will be set if the recipients of the message contains at least one
   // of the addresses in mailing_lists or if mailing_lists has '*' as first
   // character.  The latter case gives the user an easy way to always set
   // the MRT header.  Notice that this behaviour wouldn't make sense for MFT
   // in AddMailFollowupToHeader() above.
 
   if (mailing_lists[0] != '*') {
     // Get a list of all recipients excluding bcc
     nsDependentCString to(mCompFields->GetTo());
     nsDependentCString cc(mCompFields->GetCc());
-    nsCAutoString recipients;
+    nsAutoCString recipients;
 
     if (to.IsEmpty() && cc.IsEmpty())
       // We have bcc recipients only, so we don't add the Mail-Reply-To header
       return NS_OK;
 
     if (!to.IsEmpty() && cc.IsEmpty())
       recipients = to;
     else if (to.IsEmpty() && !cc.IsEmpty())
@@ -3162,17 +3162,17 @@ nsMsgComposeAndSend::AddMailReplyToHeade
 
     // ... If the result is equal to the input, none of the recipients
     // occure in the MRT addresses and therefore we stop here.
     if (recipients_no_dups == recipients_without_mailing_lists)
       return NS_OK;
   }
 
   // Set Mail-Reply-To
-  nsCAutoString replyTo, mailReplyTo;
+  nsAutoCString replyTo, mailReplyTo;
   replyTo = mCompFields->GetReplyTo();
   if (replyTo.IsEmpty())
     mailReplyTo = mCompFields->GetFrom();
   else
     mailReplyTo = replyTo;
   char * mimeHeader = nsMsgI18NEncodeMimePartIIStr(mailReplyTo.get(), true,
     mCompFields->GetCharacterSet(), mrtHeaderLabel.Length(), true);
   if (!mimeHeader)
@@ -3183,17 +3183,17 @@ nsMsgComposeAndSend::AddMailReplyToHeade
   customHeaders.AppendLiteral("\r\n");
   mCompFields->SetOtherRandomHeaders(customHeaders.get());
   PR_Free(mimeHeader);
   return NS_OK;
 }
 
 nsresult
 nsMsgComposeAndSend::AddXForwardedMessageIdHeader() {
-  nsCAutoString otherHeaders;
+  nsAutoCString otherHeaders;
   otherHeaders.Append(nsDependentCString(mCompFields->GetOtherRandomHeaders()));
   otherHeaders.Append(NS_LITERAL_CSTRING("X-Forwarded-Message-Id: "));
   otherHeaders.Append(nsDependentCString(mCompFields->GetReferences()));
   otherHeaders.Append(NS_LITERAL_CSTRING("\r\n"));
   return mCompFields->SetOtherRandomHeaders(otherHeaders.get());
 }
 
 nsresult
@@ -4335,17 +4335,17 @@ BuildURLAttachmentData(nsIURI *url)
   if (!url)
     return nullptr;
 
   attachments = new nsMsgAttachmentData[attachCount];
   if (!attachments)
     return nullptr;
 
   // Now get a readable name...
-  nsCAutoString spec;
+  nsAutoCString spec;
   url->GetSpec(spec);
   if (!spec.IsEmpty())
   {
     theName = strrchr(spec.get(), '/');
   }
 
   if (!theName)
     theName = "Unknown"; // Don't I18N this string...should never happen...
--- a/mailnews/compose/src/nsSmtpProtocol.cpp
+++ b/mailnews/compose/src/nsSmtpProtocol.cpp
@@ -279,17 +279,17 @@ void nsSmtpProtocol::Initialize(nsIURI *
     if (smtpServer) {
         smtpServer->GetAuthMethod(&authMethod);
         smtpServer->GetSocketType(&m_prefSocketType);
         smtpServer->GetHelloArgument(getter_Copies(m_helloArgument));
     }
     InitPrefAuthMethods(authMethod);
 
 #if defined(PR_LOGGING)
-    nsCAutoString hostName;
+    nsAutoCString hostName;
     aURL->GetAsciiHost(hostName);
     PR_LOG(SMTPLogModule, PR_LOG_ALWAYS, ("SMTP Connecting to: %s", hostName.get()));
 #endif
 
     // When we are making a secure connection, we need to make sure that we
     // pass an interface requestor down to the socket transport so that PSM can
     // retrieve a nsIPrompt instance if needed.
     nsCOMPtr<nsIInterfaceRequestor> callbacks;
@@ -524,33 +524,33 @@ nsresult nsSmtpProtocol::ExtensionLoginR
     nsExplainErrorDetails(m_runningURL, NS_ERROR_SMTP_GREETING,
                           m_responseText.get());
     NS_ASSERTION(NS_SUCCEEDED(rv), "failed to explain SMTP error");
 
     m_urlErrorState = NS_ERROR_BUT_DONT_SHOW_ALERT;
     return NS_ERROR_SMTP_AUTH_FAILURE;
   }
 
-  nsCAutoString buffer("EHLO ");
+  nsAutoCString buffer("EHLO ");
   AppendHelloArgument(buffer);
   buffer += CRLF;
 
   status = SendData(buffer.get());
 
   m_nextState = SMTP_RESPONSE;
   m_nextStateAfterResponse = SMTP_SEND_EHLO_RESPONSE;
   SetFlag(SMTP_PAUSE_FOR_READ);
 
   return(status);
 }
 
 nsresult nsSmtpProtocol::SendHeloResponse(nsIInputStream * inputStream, uint32_t length)
 {
   nsresult status = NS_OK;
-  nsCAutoString buffer;
+  nsAutoCString buffer;
   nsresult rv;
 
   if (m_responseCode != 250)
   {
 #ifdef DEBUG
     rv =
 #endif
     nsExplainErrorDetails(m_runningURL, NS_ERROR_SMTP_SERVER_ERROR,
@@ -669,17 +669,17 @@ nsresult nsSmtpProtocol::SendEhloRespons
             if (m_prefSocketType == nsMsgSocketType::alwaysSTARTTLS &&
                 !m_tlsEnabled)
             {
                 m_nextState = SMTP_ERROR_DONE;
                 m_urlErrorState = NS_ERROR_STARTTLS_FAILED_EHLO_STARTTLS;
                 return(NS_ERROR_STARTTLS_FAILED_EHLO_STARTTLS);
             }
 
-            nsCAutoString buffer("HELO ");
+            nsAutoCString buffer("HELO ");
             AppendHelloArgument(buffer);
             buffer += CRLF;
 
             status = SendData(buffer.get());
 
             m_nextState = SMTP_RESPONSE;
             m_nextStateAfterResponse = SMTP_SEND_HELO_RESPONSE;
             SetFlag(SMTP_PAUSE_FOR_READ);
@@ -703,17 +703,17 @@ nsresult nsSmtpProtocol::SendEhloRespons
     }
 
     int32_t responseLength = m_responseText.Length();
     int32_t startPos = 0;
     int32_t endPos;
     do
     {
         endPos = m_responseText.FindChar('\n', startPos + 1);
-        nsCAutoString responseLine;
+        nsAutoCString responseLine;
         responseLine.Assign(Substring(m_responseText, startPos,
             (endPos >= 0 ? endPos : responseLength) - startPos));
 
         MsgCompressWhitespace(responseLine);
         if (responseLine.LowerCaseEqualsLiteral("starttls"))
         {
             SetFlag(SMTP_EHLO_STARTTLS_ENABLED);
         }
@@ -922,17 +922,17 @@ void nsSmtpProtocol::ResetAuthMethods()
 {
   m_currentAuthMethod = 0;
   m_failedAuthMethods = 0;
 }
 
 nsresult nsSmtpProtocol::ProcessAuth()
 {
     nsresult status = NS_OK;
-    nsCAutoString buffer;
+    nsAutoCString buffer;
 
     if (!m_tlsEnabled)
     {
         if (TestFlag(SMTP_EHLO_STARTTLS_ENABLED))
         {
             // Do not try to combine SMTPS with STARTTLS.
             // If nsMsgSocketType::SSL is set,
             // we are alrady using a secure connection.
@@ -1143,19 +1143,19 @@ nsresult nsSmtpProtocol::AuthLoginRespon
   }
 
   return (status);
 }
 
 nsresult nsSmtpProtocol::AuthGSSAPIFirst()
 {
   NS_ASSERTION(m_currentAuthMethod == SMTP_AUTH_GSSAPI_ENABLED, "called in invalid state");
-  nsCAutoString command("AUTH GSSAPI ");
-  nsCAutoString resp;
-  nsCAutoString service("smtp@");
+  nsAutoCString command("AUTH GSSAPI ");
+  nsAutoCString resp;
+  nsAutoCString service("smtp@");
   nsCString hostName;
   nsCString userName;
   nsresult rv;
   nsCOMPtr<nsISmtpServer> smtpServer;
   rv = m_runningURL->GetSmtpServer(getter_AddRefs(smtpServer));
   if (NS_FAILED(rv))
     return NS_ERROR_FAILURE;
 
@@ -1189,17 +1189,17 @@ nsresult nsSmtpProtocol::AuthGSSAPIFirst
 
 // GSSAPI may consist of multiple round trips
 
 nsresult nsSmtpProtocol::AuthGSSAPIStep()
 {
   PR_LOG(SMTPLogModule, PR_LOG_DEBUG, ("SMTP: GSSAPI auth step 2"));
   NS_ASSERTION(m_currentAuthMethod == SMTP_AUTH_GSSAPI_ENABLED, "called in invalid state");
   nsresult rv;
-  nsCAutoString cmd;
+  nsAutoCString cmd;
 
   // Check to see what the server said
   if (m_responseCode / 100 != 3) {
     m_nextState = SMTP_AUTH_LOGIN_RESPONSE;
     return NS_OK;
   }
 
   rv = DoGSSAPIStep2(m_responseText, cmd);
@@ -1220,17 +1220,17 @@ nsresult nsSmtpProtocol::AuthGSSAPIStep(
 // PLAIN or CRAM-MD5, so we've to start here and continue with AuthStep1
 // if the server responds with with a 3xx code to "AUTH LOGIN" or "AUTH MSN"
 nsresult nsSmtpProtocol::AuthLoginStep0()
 {
     NS_ASSERTION(m_currentAuthMethod == SMTP_AUTH_MSN_ENABLED ||
         m_currentAuthMethod == SMTP_AUTH_LOGIN_ENABLED,
         "called in invalid state");
     PR_LOG(SMTPLogModule, PR_LOG_DEBUG, ("SMTP: MSN or LOGIN auth, step 0"));
-    nsCAutoString command(m_currentAuthMethod == SMTP_AUTH_MSN_ENABLED
+    nsAutoCString command(m_currentAuthMethod == SMTP_AUTH_MSN_ENABLED
         ? "AUTH MSN" CRLF : "AUTH LOGIN" CRLF);
     m_nextState = SMTP_RESPONSE;
     m_nextStateAfterResponse = SMTP_AUTH_LOGIN_STEP0_RESPONSE;
     SetFlag(SMTP_PAUSE_FOR_READ);
 
     return SendData(command.get());
 }
 
@@ -1242,22 +1242,22 @@ void nsSmtpProtocol::AuthLoginStep0Respo
     // need the test to be here instead in AuthLoginResponse() to
     // continue with step 1 instead of 2 in case of a code 3xx
     m_nextState = (m_responseCode/100 == 3) ?
                   SMTP_SEND_AUTH_LOGIN_STEP1 : SMTP_AUTH_LOGIN_RESPONSE;
 }
 
 nsresult nsSmtpProtocol::AuthLoginStep1()
 {
-  char buffer[512]; // TODO nsCAutoString
+  char buffer[512]; // TODO nsAutoCString
   nsresult rv;
   nsresult status = NS_OK;
   nsCString username;
   char *base64Str = nullptr;
-  nsCAutoString password;
+  nsAutoCString password;
   nsCOMPtr<nsISmtpServer> smtpServer;
   rv = m_runningURL->GetSmtpServer(getter_AddRefs(smtpServer));
   if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
 
   rv = smtpServer->GetUsername(username);
   if (username.IsEmpty())
   {
     rv = GetUsernamePassword(username, password);
@@ -1280,17 +1280,17 @@ nsresult nsSmtpProtocol::AuthLoginStep1(
   {
     PR_LOG(SMTPLogModule, PR_LOG_ERROR, ("CRAM auth, step 1"));
     PR_snprintf(buffer, sizeof(buffer), "AUTH CRAM-MD5" CRLF);
   }
   else if (m_currentAuthMethod == SMTP_AUTH_NTLM_ENABLED ||
            m_currentAuthMethod == SMTP_AUTH_MSN_ENABLED)
   {
     PR_LOG(SMTPLogModule, PR_LOG_DEBUG, ("NTLM/MSN auth, step 1"));
-    nsCAutoString response;
+    nsAutoCString response;
     rv = DoNtlmStep1(username.get(), password.get(), response);
     PR_snprintf(buffer, sizeof(buffer), TestFlag(SMTP_AUTH_NTLM_ENABLED) ?
                                         "AUTH NTLM %.256s" CRLF :
                                         "%.256s" CRLF, response.get());
   }
   else if (m_currentAuthMethod == SMTP_AUTH_PLAIN_ENABLED)
   {
     PR_LOG(SMTPLogModule, PR_LOG_DEBUG, ("PLAIN auth"));
@@ -1330,17 +1330,17 @@ nsresult nsSmtpProtocol::AuthLoginStep2(
 {
   /* use cached smtp password first
   * if not then use cached pop password
   * if pop password undefined
   * sync with smtp password
   */
   nsresult status = NS_OK;
   nsresult rv;
-  nsCAutoString password;
+  nsAutoCString password;
 
   GetPassword(password);
   if (password.IsEmpty())
   {
     m_urlErrorState = NS_ERROR_SMTP_PASSWORD_UNDEFINED;
     return NS_ERROR_SMTP_PASSWORD_UNDEFINED;
   }
   PR_LOG(SMTPLogModule, PR_LOG_MAX, ("SMTP AuthLoginStep2"));
@@ -1358,17 +1358,17 @@ nsresult nsSmtpProtocol::AuthLoginStep2(
       if (decodedChallenge)
         rv = MSGCramMD5(decodedChallenge, strlen(decodedChallenge), password.get(), password.Length(), digest);
       else
         rv = NS_ERROR_FAILURE;
 
       PR_Free(decodedChallenge);
       if (NS_SUCCEEDED(rv))
       {
-        nsCAutoString encodedDigest;
+        nsAutoCString encodedDigest;
         char hexVal[8];
 
         for (uint32_t j=0; j<16; j++)
         {
           PR_snprintf (hexVal,8, "%.2x", 0x0ff & (unsigned short)digest[j]);
           encodedDigest.Append(hexVal);
         }
 
@@ -1386,17 +1386,17 @@ nsresult nsSmtpProtocol::AuthLoginStep2(
       }
       if (NS_FAILED(rv))
         PR_snprintf(buffer, sizeof(buffer), "*" CRLF);
     }
     else if (m_currentAuthMethod == SMTP_AUTH_NTLM_ENABLED ||
              m_currentAuthMethod == SMTP_AUTH_MSN_ENABLED)
     {
       PR_LOG(SMTPLogModule, PR_LOG_DEBUG, ("NTLM/MSN auth, step 2"));
-      nsCAutoString response;
+      nsAutoCString response;
       rv = DoNtlmStep2(m_responseText, response);
       PR_snprintf(buffer, sizeof(buffer), "%.256s" CRLF, response.get());
     }
     else if (m_currentAuthMethod == SMTP_AUTH_PLAIN_ENABLED ||
              m_currentAuthMethod == SMTP_AUTH_LOGIN_ENABLED)
     {
       PR_LOG(SMTPLogModule, PR_LOG_DEBUG, ("PLAIN/LOGIN auth, step 2"));
       char *base64Str = PL_Base64Encode(password.get(), password.Length(), nullptr);
@@ -1416,17 +1416,17 @@ nsresult nsSmtpProtocol::AuthLoginStep2(
   // XXX -1 is not a valid nsresult
   return static_cast<nsresult>(-1);
 }
 
 
 nsresult nsSmtpProtocol::SendMailResponse()
 {
   nsresult status = NS_OK;
-  nsCAutoString buffer;
+  nsAutoCString buffer;
   nsresult rv;
 
   if (m_responseCode/10 != 25)
   {
     nsresult errorcode;
     if (TestFlag(SMTP_EHLO_SIZE_ENABLED))
       errorcode = (m_responseCode == 452) ? NS_ERROR_SMTP_TEMP_SIZE_EXCEEDED :
                   (m_responseCode == 552) ? NS_ERROR_SMTP_PERM_SIZE_EXCEEDED_2 :
@@ -1462,17 +1462,17 @@ nsresult nsSmtpProtocol::SendMailRespons
   rv = prefBranch->GetBoolPref("mail.dsn.request_on_delay_on", &requestOnDelay);
 
   bool requestOnNever = false;
   rv = prefBranch->GetBoolPref("mail.dsn.request_never_on", &requestOnNever);
 
   if (TestFlag(SMTP_EHLO_DSN_ENABLED) && requestDSN && (requestOnSuccess || requestOnFailure || requestOnDelay || requestOnNever))
     {
       char *encodedAddress = esmtp_value_encode(m_addresses);
-      nsCAutoString dsnBuffer;
+      nsAutoCString dsnBuffer;
 
       if (encodedAddress)
       {
         buffer = "RCPT TO:<";
         buffer += m_addresses;
         buffer += "> NOTIFY=";
 
         if (requestOnNever)
@@ -1515,17 +1515,17 @@ nsresult nsSmtpProtocol::SendMailRespons
     SetFlag(SMTP_PAUSE_FOR_READ);
 
     return(status);
 }
 
 nsresult nsSmtpProtocol::SendRecipientResponse()
 {
   nsresult status = NS_OK;
-  nsCAutoString buffer;
+  nsAutoCString buffer;
   nsresult rv;
 
   if (m_responseCode / 10 != 25)
   {
     nsresult errorcode;
     if (TestFlag(SMTP_EHLO_SIZE_ENABLED))
       errorcode = (m_responseCode == 452) ? NS_ERROR_SMTP_TEMP_SIZE_EXCEEDED :
                   (m_responseCode == 552) ? NS_ERROR_SMTP_PERM_SIZE_EXCEEDED_2 :
@@ -1691,17 +1691,17 @@ nsresult nsSmtpProtocol::LoadUrl(nsIURI 
   m_runningURL = do_QueryInterface(aURL);
   if (!m_runningURL)
     return NS_ERROR_FAILURE;
 
   // we had a bug where we failed to bring up an alert if the host
   // name was empty....so throw up an alert saying we don't have
   // a host name and inform the caller that we are not going to
   // run the url...
-  nsCAutoString hostName;
+  nsAutoCString hostName;
   aURL->GetHost(hostName);
   if (hostName.IsEmpty())
   {
     nsCOMPtr <nsIMsgMailNewsUrl> aMsgUrl = do_QueryInterface(aURL);
     if (aMsgUrl)
     {
       aMsgUrl->SetUrlState(true, NS_OK);
       // set the url as a url currently being run...
--- a/mailnews/compose/src/nsSmtpServer.cpp
+++ b/mailnews/compose/src/nsSmtpServer.cpp
@@ -56,17 +56,17 @@ nsSmtpServer::SetKey(const char * aKey)
 
 nsresult nsSmtpServer::getPrefs()
 {
     nsresult rv;
     nsCOMPtr<nsIPrefService> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
     if (NS_FAILED(rv))
         return rv;
 
-    nsCAutoString branchName;
+    nsAutoCString branchName;
     branchName.AssignLiteral("mail.smtpserver.");
     branchName += mKey;
     branchName.Append('.');
     rv = prefs->GetBranch(branchName.get(), getter_AddRefs(mPrefBranch));
     if (NS_FAILED(rv))
         return rv;
 
     if(!mDefPrefBranch) {
@@ -466,17 +466,17 @@ NS_IMETHODIMP
 nsSmtpServer::ForgetPassword()
 {
   nsresult rv;
   nsCOMPtr<nsILoginManager> loginMgr =
     do_GetService(NS_LOGINMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Get the current server URI without the username
-  nsCAutoString serverUri(NS_LITERAL_CSTRING("smtp://"));
+  nsAutoCString serverUri(NS_LITERAL_CSTRING("smtp://"));
 
   nsCString hostname;
   rv = GetHostname(hostname);
 
   if (NS_SUCCEEDED(rv) && !hostname.IsEmpty()) {
     nsCString escapedHostname;
     MsgEscapeString(hostname, nsINetUtil::ESCAPE_URL_PATH, escapedHostname);
     // not all servers have a hostname
@@ -516,17 +516,17 @@ nsSmtpServer::ForgetPassword()
   rv = SetPassword(EmptyCString());
   m_logonFailed = true;
   return rv;
 }
 
 NS_IMETHODIMP
 nsSmtpServer::GetServerURI(nsACString &aResult)
 {
-    nsCAutoString uri(NS_LITERAL_CSTRING("smtp://"));
+    nsAutoCString uri(NS_LITERAL_CSTRING("smtp://"));
 
     nsCString username;
     nsresult rv = GetUsername(username);
 
     if (NS_SUCCEEDED(rv) && !username.IsEmpty()) {
         nsCString escapedUsername;
         MsgEscapeString(username, nsINetUtil::ESCAPE_XALPHAS, escapedUsername);
         // not all servers have a username
--- a/mailnews/compose/src/nsSmtpService.cpp
+++ b/mailnews/compose/src/nsSmtpService.cpp
@@ -145,17 +145,17 @@ nsresult NS_MsgBuildSmtpUrl(nsIFile * aF
     if (!smtpPort)
       smtpPort = (socketType == nsMsgSocketType::SSL) ?
         nsISmtpUrl::DEFAULT_SMTPS_PORT :  nsISmtpUrl::DEFAULT_SMTP_PORT;
 
   nsresult rv;
   nsCOMPtr<nsISmtpUrl> smtpUrl(do_CreateInstance(kCSmtpUrlCID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString urlSpec("smtp://");
+  nsAutoCString urlSpec("smtp://");
 
   if (!smtpUserName.IsEmpty())
   {
     nsCString escapedUsername;
     MsgEscapeString(smtpUserName, nsINetUtil::ESCAPE_XALPHAS,
                     escapedUsername);
     urlSpec.Append(escapedUsername);
     urlSpec.Append('@');
@@ -289,17 +289,17 @@ NS_IMETHODIMP nsSmtpService::NewURI(cons
                                     nsIURI *aBaseURI,
                                     nsIURI **_retval)
 {
   // get a new smtp url
   nsresult rv;
   nsCOMPtr<nsIURI> mailtoUrl = do_CreateInstance(kCMailtoUrlCID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString utf8Spec;
+  nsAutoCString utf8Spec;
   if (aOriginCharset)
   {
     nsCOMPtr<nsIUTF8ConverterService>
       utf8Converter(do_GetService(NS_UTF8CONVERTERSERVICE_CONTRACTID, &rv));
     if (NS_SUCCEEDED(rv))
       rv = utf8Converter->ConvertURISpecToUTF8(aSpec, aOriginCharset, utf8Spec);
   }
 
@@ -581,17 +581,17 @@ nsSmtpService::CreateSmtpServer(nsISmtpS
     if (!aResult) return NS_ERROR_NULL_POINTER;
 
     loadSmtpServers();
     nsresult rv;
     int32_t i = 0;
     bool unique = false;
 
     findServerByKeyEntry entry;
-    nsCAutoString key;
+    nsAutoCString key;
 
     do {
         key = "smtp";
         key.AppendInt(++i);
         entry.key = key.get();
         entry.server = nullptr;
 
         mSmtpServers.EnumerateForwards(findServerByKey, (void *)&entry);
@@ -643,17 +643,17 @@ nsSmtpService::DeleteSmtpServer(nsISmtpS
     
     mSmtpServers.RemoveObjectAt(idx);
 
     if (mDefaultSmtpServer.get() == aServer)
         mDefaultSmtpServer = nullptr;
     if (mSessionDefaultServer.get() == aServer)
         mSessionDefaultServer = nullptr;
     
-    nsCAutoString newServerList;
+    nsAutoCString newServerList;
     nsCString tmpStr = mServerKeyList;
     char *newStr = tmpStr.BeginWriting();
     char *token = NS_strtok(",", &newStr);
     while (token) {
       // only re-add the string if it's not the key
       if (strcmp(token, serverKey.get()) != 0) {
           if (newServerList.IsEmpty())
               newServerList = token;
--- a/mailnews/compose/src/nsSmtpUrl.cpp
+++ b/mailnews/compose/src/nsSmtpUrl.cpp
@@ -353,17 +353,17 @@ nsresult nsMailtoUrl::ParseMailtoUrl(cha
       // If References is not set, set it to be the In-Reply-To.
       m_referencePart = inReplyToPart;
     }
     else
     {
       // References is set. Add the In-Reply-To as last header unless it's
       // set as last reference already.
       int32_t lastRefStart = m_referencePart.RFindChar('<');
-      nsCAutoString lastReference;
+      nsAutoCString lastReference;
       if (lastRefStart != -1)
         lastReference = StringTail(m_referencePart, lastRefStart);
       else
         lastReference = m_referencePart;
 
       if (lastReference != inReplyToPart)
       {
         m_referencePart += " ";
@@ -404,17 +404,17 @@ nsresult nsMailtoUrl::ParseUrl()
   // we can get the path from the simple url.....
   nsCString escapedPath;
   m_baseURL->GetPath(escapedPath);
 
   int32_t startOfSearchPart = escapedPath.FindChar('?');
   if (startOfSearchPart >= 0)
   {
     // now parse out the search field...
-    nsCAutoString searchPart(Substring(escapedPath, startOfSearchPart));
+    nsAutoCString searchPart(Substring(escapedPath, startOfSearchPart));
 
     if (!searchPart.IsEmpty())
     {
       // now we need to strip off the search part from the
       // to part....
       escapedPath.SetLength(startOfSearchPart);
       MsgUnescapeString(escapedPath, 0, m_toPart);
       ParseMailtoUrl(searchPart.BeginWriting());
--- a/mailnews/compose/src/nsURLFetcher.cpp
+++ b/mailnews/compose/src/nsURLFetcher.cpp
@@ -440,26 +440,26 @@ NS_IMETHODIMP nsURLFetcherStreamConsumer
 
 /* void onStopRequest (in nsIRequest request, in nsISupports ctxt, in nsresult status); */
 NS_IMETHODIMP nsURLFetcherStreamConsumer::OnStopRequest(nsIRequest *aRequest, nsISupports *ctxt, nsresult status)
 {
   if (!mURLFetcher)
     return NS_ERROR_FAILURE;
 
   // Check the content type!
-  nsCAutoString contentType;
-  nsCAutoString charset;
+  nsAutoCString contentType;
+  nsAutoCString charset;
 
   nsCOMPtr<nsIChannel> channel = do_QueryInterface(aRequest);
   if(!channel) return NS_ERROR_FAILURE;
 
   if (NS_SUCCEEDED(channel->GetContentType(contentType)) &&
       !contentType.EqualsLiteral(UNKNOWN_CONTENT_TYPE))
   {
-    nsCAutoString uriSpec;
+    nsAutoCString uriSpec;
     nsCOMPtr <nsIURI> channelURI;
     channel->GetURI(getter_AddRefs(channelURI));
     channelURI->GetSpec(uriSpec);
     if (uriSpec.Find("&realtype=message/rfc822") >= 0)
       mURLFetcher->mContentType = MESSAGE_RFC822;
     else
       mURLFetcher->mContentType = contentType;
   }
--- a/mailnews/db/msgdb/public/nsMsgHdr.h
+++ b/mailnews/db/msgdb/public/nsMsgHdr.h
@@ -40,17 +40,17 @@ public:
     bool        IsAncestorKilled(uint32_t ancestorsToCheck);
     void        ReparentInThread(nsIMsgThread *thread);
 protected:
     nsresult SetStringColumn(const char *str, mdb_token token);
     nsresult SetUInt32Column(uint32_t value, mdb_token token);
     nsresult GetUInt32Column(mdb_token token, uint32_t *pvalue, uint32_t defaultValue = 0);
     nsresult SetUInt64Column(uint64_t value, mdb_token token);
     nsresult GetUInt64Column(mdb_token token, uint64_t *pvalue, uint64_t defaultValue = 0);
-    nsresult BuildRecipientsFromArray(const char *names, const char *addresses, uint32_t numAddresses, nsCAutoString& allRecipients);
+    nsresult BuildRecipientsFromArray(const char *names, const char *addresses, uint32_t numAddresses, nsAutoCString& allRecipients);
 
     // reference and threading stuff.
     nsresult	ParseReferences(const char *references);
     const char* GetNextReference(const char *startNextRef, nsCString &reference,
                                  bool acceptNonDelimitedReferences);
 
     nsMsgKey	m_threadId; 
     nsMsgKey	m_messageKey; 	//news: article number, mail mbox offset, imap uid...
--- a/mailnews/db/msgdb/src/nsMsgDatabase.cpp
+++ b/mailnews/db/msgdb/src/nsMsgDatabase.cpp
@@ -114,17 +114,17 @@ NS_IMETHODIMP nsMsgDBService::OpenFolder
     // caller wants to synchronously open it, so just do it.
     if (cacheDB->m_thumb)
       return cacheDB->Open(summaryFilePath, false, aLeaveInvalidDB);
     return NS_OK;
   }
 
   nsCString localStoreType;
   incomingServer->GetLocalStoreType(localStoreType);
-  nsCAutoString dbContractID(NS_MSGDB_CONTRACTID);
+  nsAutoCString dbContractID(NS_MSGDB_CONTRACTID);
   dbContractID.Append(localStoreType.get());
   nsCOMPtr <nsIMsgDatabase> msgDB = do_CreateInstance(dbContractID.get(), &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Don't try to create the database yet--let the createNewDB call do that.
   nsMsgDatabase *msgDatabase = static_cast<nsMsgDatabase *>(msgDB.get());
   msgDatabase->m_folder = aFolder;
   rv = msgDatabase->Open(summaryFilePath, false, aLeaveInvalidDB);
@@ -179,17 +179,17 @@ NS_IMETHODIMP nsMsgDBService::AsyncOpenF
   rv = msgStore->GetSummaryFile(aFolder, getter_AddRefs(summaryFilePath));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr <nsIMsgIncomingServer> incomingServer;
   rv = aFolder->GetServer(getter_AddRefs(incomingServer));
   NS_ENSURE_SUCCESS(rv, rv);
   nsCString localStoreType;
   incomingServer->GetLocalStoreType(localStoreType);
-  nsCAutoString dbContractID(NS_MSGDB_CONTRACTID);
+  nsAutoCString dbContractID(NS_MSGDB_CONTRACTID);
   dbContractID.Append(localStoreType.get());
   nsCOMPtr <nsIMsgDatabase> msgDB = do_CreateInstance(dbContractID.get(), &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsMsgDatabase *msgDatabase = static_cast<nsMsgDatabase *>(msgDB.get());
   rv = msgDatabase->OpenInternal(summaryFilePath, false, aLeaveInvalidDB,
                                  false /* open asynchronously */);
 
@@ -356,17 +356,17 @@ NS_IMETHODIMP nsMsgDBService::CreateNewD
   rv = aFolder->GetMsgStore(getter_AddRefs(msgStore));
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsIFile> summaryFilePath;
   rv = msgStore->GetSummaryFile(aFolder, getter_AddRefs(summaryFilePath));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCString localStoreType;
   incomingServer->GetLocalStoreType(localStoreType);
-  nsCAutoString dbContractID(NS_MSGDB_CONTRACTID);
+  nsAutoCString dbContractID(NS_MSGDB_CONTRACTID);
   dbContractID.Append(localStoreType.get());
   
   nsCOMPtr <nsIMsgDatabase> msgDB = do_CreateInstance(dbContractID.get(), &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsMsgDatabase *msgDatabase = static_cast<nsMsgDatabase *>(msgDB.get());
 
   msgDatabase->m_folder = aFolder;
@@ -1111,17 +1111,17 @@ nsresult nsMsgDatabase::Open(nsIFile *aF
 {
   return nsMsgDatabase::OpenInternal(aFolderName, aCreate, aLeaveInvalidDB,
                                      true /* open synchronously */);
 }
 
 nsresult nsMsgDatabase::OpenInternal(nsIFile *summaryFile, bool aCreate,
                                      bool aLeaveInvalidDB, bool sync)
 {
-  nsCAutoString summaryFilePath;
+  nsAutoCString summaryFilePath;
   summaryFile->GetNativePath(summaryFilePath);
 
   PR_LOG(DBLog, PR_LOG_ALWAYS, ("nsMsgDatabase::Open(%s, %s, %p, %s)\n",
     (const char*)summaryFilePath.get(), aCreate ? "TRUE":"FALSE",
     this, aLeaveInvalidDB ? "TRUE":"FALSE"));
 
 
   nsresult rv = OpenMDB(summaryFilePath.get(), aCreate, sync);
@@ -1683,17 +1683,17 @@ nsresult nsMsgDatabase::InitExistingDB()
                hasMore)
         {
           nsCOMPtr <nsIMsgDBHdr> msgHdr;
           err = enumerator->GetNext(getter_AddRefs(msgHdr));
           NS_ASSERTION(NS_SUCCEEDED(err), "nsMsgDBEnumerator broken");
           if (msgHdr && NS_SUCCEEDED(err))
           {
             nsCString messageId;
-            nsCAutoString firstReference;
+            nsAutoCString firstReference;
             msgHdr->GetMessageId(getter_Copies(messageId));
             msgHdr->GetStringReference(0, firstReference);
             if (messageId.Equals(firstReference))
             {
               err = NS_MSG_ERROR_FOLDER_SUMMARY_OUT_OF_DATE;
               break;
             }
           }
@@ -4148,17 +4148,17 @@ nsresult nsMsgDatabase::AddMsgRefsToHash
   nsMsgKey threadId;
   nsresult rv = NS_OK;
 
   msgHdr->GetThreadId(&threadId);
   msgHdr->GetNumReferences(&numReferences);
 
   for (int32_t i = 0; i < numReferences; i++)
   {
-    nsCAutoString reference;
+    nsAutoCString reference;
     
     msgHdr->GetStringReference(i, reference);
     if (reference.IsEmpty())
       break;
 
     rv = AddRefToHash(reference, threadId);
     if (NS_FAILED(rv))
       break;
@@ -4188,17 +4188,17 @@ nsresult nsMsgDatabase::RemoveMsgRefsFro
 {
   uint16_t numReferences = 0;
   nsresult rv = NS_OK;
 
   msgHdr->GetNumReferences(&numReferences);
 
   for (int32_t i = 0; i < numReferences; i++)
   {
-    nsCAutoString reference;
+    nsAutoCString reference;
     
     msgHdr->GetStringReference(i, reference);
     if (reference.IsEmpty())
       break;
 
     rv = RemoveRefFromHash(reference);
     if (NS_FAILED(rv))
       break;
@@ -4445,17 +4445,17 @@ nsresult nsMsgDatabase::ThreadNewHdr(nsM
   // in m_newSet yet.
   newHdr->GetRawFlags(&newHdrFlags);
   newHdr->GetNumReferences(&numReferences);
   newHdr->GetMessageKey(&newHdrKey);
 
   // try reference threading first
   for (int32_t i = numReferences - 1; i >= 0;  i--)
   {
-    nsCAutoString reference;
+    nsAutoCString reference;
 
     newHdr->GetStringReference(i, reference);
     // first reference we have hdr for is best top-level hdr.
     // but we have to handle case of promoting new header to top-level
     // in case the top-level header comes after a reply.
 
     if (reference.IsEmpty())
       break;
@@ -4485,17 +4485,17 @@ nsresult nsMsgDatabase::ThreadNewHdr(nsM
   // if user hasn't said "only thread by ref headers", thread by subject
   if (!thread && !UseStrictThreading())
   {
     // try subject threading if we couldn't find a reference and the subject starts with Re:
     nsCString subject;
     newHdr->GetSubject(getter_Copies(subject));
     if (ThreadBySubjectWithoutRe() || (newHdrFlags & nsMsgMessageFlags::HasRe))
     {
-      nsCAutoString cSubject(subject);
+      nsAutoCString cSubject(subject);
       thread = getter_AddRefs(GetThreadForSubject(cSubject));
       if(thread)
       {
         thread->GetThreadKey(&threadId);
         newHdr->SetThreadId(threadId);
         //TRACE("threading based on subject %s\n", (const char *) msgHdr->m_subject);
         // if we move this and do subject threading after, ref threading,
         // don't thread within children, since we know it won't work. But for now, pass TRUE.
--- a/mailnews/db/msgdb/src/nsMsgHdr.cpp
+++ b/mailnews/db/msgdb/src/nsMsgHdr.cpp
@@ -309,17 +309,17 @@ NS_IMETHODIMP nsMsgHdr::GetNumReferences
   // there is no real failure here; if there are no references, there are no
   //  references.
   return NS_OK;
 }
 
 nsresult nsMsgHdr::ParseReferences(const char *references)
 {
   const char *startNextRef = references;
-  nsCAutoString resultReference;
+  nsAutoCString resultReference;
   nsCString messageId;
   GetMessageId(getter_Copies(messageId));
 
   while (startNextRef && *startNextRef)
   {
     startNextRef = GetNextReference(startNextRef, resultReference,
                                     startNextRef == references);
     // Don't add self-references.
@@ -356,17 +356,17 @@ NS_IMETHODIMP nsMsgHdr::GetDateInSeconds
 {
   return GetUInt32Column(m_mdb->m_dateColumnToken, aResult);
 }
 
 NS_IMETHODIMP nsMsgHdr::SetMessageId(const char *messageId)
 {
   if (messageId && *messageId == '<')
   {
-    nsCAutoString tempMessageID(messageId + 1);
+    nsAutoCString tempMessageID(messageId + 1);
     if (tempMessageID.CharAt(tempMessageID.Length() - 1) == '>')
       tempMessageID.SetLength(tempMessageID.Length() - 1);
     return SetStringColumn(tempMessageID.get(), m_mdb->m_messageIdColumnToken);
   }
   return SetStringColumn(messageId, m_mdb->m_messageIdColumnToken);
 }
 
 NS_IMETHODIMP nsMsgHdr::SetSubject(const char *subject)
@@ -391,17 +391,17 @@ NS_IMETHODIMP nsMsgHdr::SetReferences(co
 }
 
 NS_IMETHODIMP nsMsgHdr::SetRecipients(const char *recipients)
 {
   // need to put in rfc822 address parsing code here (or make caller do it...)
   return SetStringColumn(recipients, m_mdb->m_recipientsColumnToken);
 }
 
-nsresult nsMsgHdr::BuildRecipientsFromArray(const char *names, const char *addresses, uint32_t numAddresses, nsCAutoString& allRecipients)
+nsresult nsMsgHdr::BuildRecipientsFromArray(const char *names, const char *addresses, uint32_t numAddresses, nsAutoCString& allRecipients)
 {
   NS_ENSURE_ARG_POINTER(names);
   NS_ENSURE_ARG_POINTER(addresses);
   nsresult ret = NS_OK;
   const char *curName = names;
   const char *curAddress = addresses;
   nsIMsgHeaderParser *headerParser = m_mdb->GetHeaderParser();
 
@@ -438,17 +438,17 @@ nsresult nsMsgHdr::BuildRecipientsFromAr
   }
 
   return ret;
 }
 
 NS_IMETHODIMP nsMsgHdr::SetRecipientsArray(const char *names, const char *addresses, uint32_t numAddresses)
 {
 	nsresult ret;
-	nsCAutoString	allRecipients;
+	nsAutoCString	allRecipients;
 
     ret = BuildRecipientsFromArray(names, addresses, numAddresses, allRecipients);
     if (NS_FAILED(ret))
         return ret;
 
 	ret = SetRecipients(allRecipients.get());
 	return ret;
 }
@@ -457,17 +457,17 @@ NS_IMETHODIMP nsMsgHdr::SetCcList(const 
 {
 	return SetStringColumn(ccList, m_mdb->m_ccListColumnToken);
 }
 
 // ###should make helper routine that takes column token!
 NS_IMETHODIMP nsMsgHdr::SetCCListArray(const char *names, const char *addresses, uint32_t numAddresses)
 {
 	nsresult ret;
-	nsCAutoString	allRecipients;
+	nsAutoCString	allRecipients;
 
     ret = BuildRecipientsFromArray(names, addresses, numAddresses, allRecipients);
     if (NS_FAILED(ret))
         return ret;
 
 	ret = SetCcList(allRecipients.get());
 	return ret;
 }
@@ -477,17 +477,17 @@ NS_IMETHODIMP nsMsgHdr::SetBccList(const
   return SetStringColumn(bccList, m_mdb->m_bccListColumnToken);
 }
 
 NS_IMETHODIMP
 nsMsgHdr::SetBCCListArray(const char *names,
                           const char *addresses,
                           uint32_t numAddresses)
 {
-  nsCAutoString allRecipients;
+  nsAutoCString allRecipients;
 
   nsresult rv = BuildRecipientsFromArray(names, addresses, numAddresses,
                                          allRecipients);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return SetBccList(allRecipients.get());
 }
 
@@ -870,17 +870,17 @@ const char *nsMsgHdr::GetNextReference(c
     reference = whitespaceEndedAt;
   return ptr;
 }
 
 bool nsMsgHdr::IsParentOf(nsIMsgDBHdr *possibleChild)
 {
   uint16_t referenceToCheck = 0;
   possibleChild->GetNumReferences(&referenceToCheck);
-  nsCAutoString reference;
+  nsAutoCString reference;
 
   nsCString messageId;
   GetMessageId(getter_Copies(messageId));
 
   while (referenceToCheck > 0)
   {
     possibleChild->GetStringReference(referenceToCheck - 1, reference);
 
--- a/mailnews/db/msgdb/src/nsMsgOfflineImapOperation.cpp
+++ b/mailnews/db/msgdb/src/nsMsgOfflineImapOperation.cpp
@@ -243,17 +243,17 @@ NS_IMETHODIMP nsMsgOfflineImapOperation:
   SetOperation(kRemoveKeywords);
   return AddKeyword(aKeyword, m_keywordsToRemove, PROP_KEYWORD_REMOVE, m_keywordsToAdd, PROP_KEYWORD_ADD);
 }
 
 
 NS_IMETHODIMP nsMsgOfflineImapOperation::AddMessageCopyOperation(const char *destinationBox)
 {
   SetOperation(kMsgCopy);
-  nsCAutoString newDest(destinationBox);
+  nsAutoCString newDest(destinationBox);
   nsresult rv = GetCopiesFromDB();
   NS_ENSURE_SUCCESS(rv, rv);
   m_copyDestinations.AppendElement(newDest);
   return SetCopiesToDB();
 }
 
 // we write out the folders as one string, separated by 0x1.
 #define FOLDER_SEP_CHAR '\001'
@@ -281,17 +281,17 @@ nsresult nsMsgOfflineImapOperation::GetC
       m_copyDestinations.AppendElement(curDest);
     }
   }
   return rv;
 }
 
 nsresult nsMsgOfflineImapOperation::SetCopiesToDB()
 {
-  nsCAutoString copyDests;
+  nsAutoCString copyDests;
 
   // use 0x1 as the delimiter between folders
   for (uint32_t i = 0; i < m_copyDestinations.Length(); i++)
   {
     if (i > 0)
       copyDests.Append(FOLDER_SEP_CHAR);
     copyDests.Append(m_copyDestinations.ElementAt(i));
   }
--- a/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
+++ b/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
@@ -495,33 +495,33 @@ void Tokenizer::addTokenForHeader(const 
         }
       }
     }
   }
 }
 
 void Tokenizer::tokenizeAttachment(const char * aContentType, const char * aFileName)
 {
-  nsCAutoString contentType;
-  nsCAutoString fileName;
+  nsAutoCString contentType;
+  nsAutoCString fileName;
   fileName.Assign(aFileName);
   contentType.Assign(aContentType);
 
   // normalize the content type and the file name
   ToLowerCase(fileName);
   ToLowerCase(contentType);
   addTokenForHeader("attachment/filename", fileName);
 
   addTokenForHeader("attachment/content-type", contentType);
 }
 
 void Tokenizer::tokenizeHeaders(nsIUTF8StringEnumerator * aHeaderNames, nsIUTF8StringEnumerator * aHeaderValues)
 {
   nsCString headerValue;
-  nsCAutoString headerName; // we'll be normalizing all header names to lower case
+  nsAutoCString headerName; // we'll be normalizing all header names to lower case
   bool hasMore;
  
   while (aHeaderNames->HasMore(&hasMore), hasMore)
   {
     aHeaderNames->GetNext(headerName);
     ToLowerCase(headerName);
     aHeaderValues->GetNext(headerValue);
 
@@ -858,17 +858,17 @@ void Tokenizer::tokenize(const char* aTe
         }
     }
   }
 }
 
 // helper function to escape \n, \t, etc from a CString
 void Tokenizer::UnescapeCString(nsCString& aCString)
 {
-  nsCAutoString result;
+  nsAutoCString result;
 
   const char* readEnd = aCString.EndReading();
   char* writeStart = result.BeginWriting();
   char* writeIter = writeStart;
 
   bool inEscape = false;
   for (const char* readIter = aCString.BeginReading(); readIter != readEnd; readIter++)
   {
--- a/mailnews/extensions/mdn/src/nsMsgMdnGenerator.cpp
+++ b/mailnews/extensions/mdn/src/nsMsgMdnGenerator.cpp
@@ -666,17 +666,17 @@ nsresult nsMsgMdnGenerator::CreateSecond
     tmpBuffer = PR_smprintf("Content-Transfer-Encoding: %s" CRLF CRLF,
                             ENCODING_7BIT);
     PUSH_N_FREE_STRING(tmpBuffer);
 
     nsCOMPtr<nsIHttpProtocolHandler> pHTTPHandler =
         do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &rv);
     if (NS_SUCCEEDED(rv) && pHTTPHandler)
     {
-      nsCAutoString userAgentString;
+      nsAutoCString userAgentString;
       pHTTPHandler->GetUserAgent(userAgentString);
 
       if (!userAgentString.IsEmpty())
       {
         // Prepend the product name with the dns name according to RFC 3798.
         char hostName[256];
         PR_GetSystemInfo(PR_SI_HOSTNAME_UNTRUNCATED, hostName, sizeof hostName);
         if ((hostName[0] != '\0') && (strchr(hostName, '.') != NULL))
--- a/mailnews/extensions/smime/src/nsMsgComposeSecure.cpp
+++ b/mailnews/extensions/smime/src/nsMsgComposeSecure.cpp
@@ -622,17 +622,17 @@ nsresult nsMsgComposeSecure::MimeFinishM
   sMIMEBundle->GetStringFromName(NS_LITERAL_STRING("mime_smimeSignatureContentDesc").get(),
                                  getter_Copies(mime_smime_sig_content_desc));
 
   NS_ConvertUTF16toUTF8 sig_content_desc_utf8(mime_smime_sig_content_desc);
 
   /* Compute the hash...
    */
 
-  nsCAutoString hashString;
+  nsAutoCString hashString;
   mDataHash->Finish(false, hashString);
 
   mDataHash = 0;
 
   status = PR_GetError();
   if (status < 0) goto FAIL;
 
   /* Write out the headers for the signature.
--- a/mailnews/imap/src/nsAutoSyncState.cpp
+++ b/mailnews/imap/src/nsAutoSyncState.cpp
@@ -623,17 +623,17 @@ NS_IMETHODIMP nsAutoSyncState::DownloadM
   
   uint32_t count;
   nsresult rv = aMessagesList->GetLength(&count);
   NS_ENSURE_SUCCESS(rv,rv);
   
   nsCOMPtr<nsIImapService> imapService = do_GetService(NS_IMAPSERVICE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv,rv);
   
-  nsCAutoString messageIds;
+  nsAutoCString messageIds;
   nsTArray<nsMsgKey> msgKeys;
   
   rv = nsImapMailFolder::BuildIdsAndKeyArray(aMessagesList, messageIds, msgKeys);  
   if (NS_FAILED(rv) || messageIds.IsEmpty()) 
     return rv;
 
   // acquire semaphore for offline store. If it fails, we won't download
   nsCOMPtr <nsIMsgFolder> folder = do_QueryReferent(mOwnerFolder, &rv);
--- a/mailnews/imap/src/nsImapIncomingServer.cpp
+++ b/mailnews/imap/src/nsImapIncomingServer.cpp
@@ -102,17 +102,17 @@ NS_IMETHODIMP nsImapIncomingServer::SetK
 
   nsCString key(aKey);
   hostSession->AddHostToList(key.get(), this);
   nsMsgImapDeleteModel deleteModel = nsMsgImapDeleteModels::MoveToTrash; // default to trash
   GetDeleteModel(&deleteModel);
   hostSession->SetDeleteIsMoveToTrashForHost(key.get(), deleteModel == nsMsgImapDeleteModels::MoveToTrash);
   hostSession->SetShowDeletedMessagesForHost(key.get(), deleteModel == nsMsgImapDeleteModels::IMAPDelete);
 
-  nsCAutoString onlineDir;
+  nsAutoCString onlineDir;
   rv = GetServerDirectory(onlineDir);
   NS_ENSURE_SUCCESS(rv, rv);
   if (!onlineDir.IsEmpty())
     hostSession->SetOnlineDirForHost(key.get(), onlineDir.get());
 
   nsCString personalNamespace;
   nsCString publicNamespace;
   nsCString otherUsersNamespace;
@@ -140,18 +140,18 @@ NS_IMETHODIMP nsImapIncomingServer::SetK
   return rv;
 }
 
 // construct the pretty name to show to the user if they haven't
 // specified one. This should be overridden for news and mail.
 NS_IMETHODIMP
 nsImapIncomingServer::GetConstructedPrettyName(nsAString& retval)
 {
-  nsCAutoString username;
-  nsCAutoString hostName;
+  nsAutoCString username;
+  nsAutoCString hostName;
   nsresult rv;
 
   nsCOMPtr<nsIMsgAccountManager> accountManager =
            do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv,rv);
 
   nsCOMPtr<nsIMsgIdentity> identity;
   rv = accountManager->GetFirstIdentityForServer(this, getter_AddRefs(identity));
@@ -325,17 +325,17 @@ nsImapIncomingServer::SetDeleteModel(int
     NS_ENSURE_SUCCESS(rv,rv);
     hostSession->SetDeleteIsMoveToTrashForHost(m_serverKey.get(), ivalue == nsMsgImapDeleteModels::MoveToTrash);
     hostSession->SetShowDeletedMessagesForHost(m_serverKey.get(), ivalue == nsMsgImapDeleteModels::IMAPDelete);
 
     nsAutoString trashFolderName;
     nsresult rv = GetTrashFolderName(trashFolderName);
     if (NS_SUCCEEDED(rv))
     {
-      nsCAutoString trashFolderNameUtf7;
+      nsAutoCString trashFolderNameUtf7;
       rv = CopyUTF16toMUTF7(trashFolderName, trashFolderNameUtf7);
       if (NS_SUCCEEDED(rv))
       {
         nsCOMPtr<nsIMsgFolder> trashFolder;
         rv = GetFolder(trashFolderNameUtf7, getter_AddRefs(trashFolder));
         NS_ENSURE_SUCCESS(rv, rv);
         nsCString trashURI;
         trashFolder->GetURI(trashURI);
@@ -723,30 +723,30 @@ nsImapIncomingServer::GetImapConnection(
     {
       bool badConnection = ConnectionTimeOut(connection);
       if (!badConnection)
       {
         badConnection = NS_FAILED(connection->CanHandleUrl(aImapUrl,
                                                            &canRunUrlImmediately,
                                                            &canRunButBusy));
 #ifdef DEBUG_bienvenu
-        nsCAutoString curSelectedFolderName;
+        nsAutoCString curSelectedFolderName;
         if (connection)
           connection->GetSelectedMailboxName(getter_Copies(curSelectedFolderName));
         // check that no other connection is in the same selected state.
         if (!curSelectedFolderName.IsEmpty())
         {
           for (uint32_t j = 0; j < cnt; j++)
           {
             if (j != i)
             {
               nsCOMPtr<nsIImapProtocol> otherConnection = do_QueryElementAt(m_connectionCache, j);
               if (otherConnection)
               {
-                nsCAutoString otherSelectedFolderName;
+                nsAutoCString otherSelectedFolderName;
                 otherConnection->GetSelectedMailboxName(getter_Copies(otherSelectedFolderName));
                 NS_ASSERTION(!curSelectedFolderName.Equals(otherSelectedFolderName), "two connections selected on same folder");
               }
 
             }
           }
         }
 #endif // DEBUG_bienvenu
@@ -767,17 +767,17 @@ nsImapIncomingServer::GetImapConnection(
           continue;
         // if max connections is <= 1, we have to re-use the inbox connection.
         if (!isBusy && (!isInboxConnection || maxConnections <= 1))
         {
           if (!freeConnection)
             freeConnection = connection;
           else  // check which is the better free connection to use.
           {     // We prefer one not in the selected state.
-            nsCAutoString selectedFolderName;
+            nsAutoCString selectedFolderName;
             connection->GetSelectedMailboxName(getter_Copies(selectedFolderName));
             if (selectedFolderName.IsEmpty())
               freeConnection = connection;
           }
         }
     }
     // don't leave this loop with connection set if we can't use it!
     if (!canRunButBusy && !canRunUrlImmediately)
@@ -1045,17 +1045,17 @@ NS_IMETHODIMP nsImapIncomingServer::Poss
 
   *aNewFolder = false;
   nsCOMPtr<nsIMsgFolder> a_nsIFolder;
   rv = GetRootFolder(getter_AddRefs(a_nsIFolder));
 
   if(NS_FAILED(rv))
     return rv;
 
-  nsCAutoString dupFolderPath(folderPath);
+  nsAutoCString dupFolderPath(folderPath);
   if (dupFolderPath.Last() == '/')
   {
     dupFolderPath.SetLength(dupFolderPath.Length()-1);
     if (dupFolderPath.IsEmpty())
       return NS_ERROR_FAILURE;
     // *** this is what we did in 4.x in order to list uw folder only
     // mailbox in order to get the \NoSelect flag
     explicitlyVerify = !(boxFlags & kNameSpace);
@@ -1085,18 +1085,18 @@ NS_IMETHODIMP nsImapIncomingServer::Poss
       return rv;
     }
   }
 
   hostFolder = do_QueryInterface(a_nsIFolder, &rv);
   if (NS_FAILED(rv))
     return rv;
 
-  nsCAutoString tempFolderName(dupFolderPath);
-  nsCAutoString tokenStr, remStr, changedStr;
+  nsAutoCString tempFolderName(dupFolderPath);
+  nsAutoCString tokenStr, remStr, changedStr;
   int32_t slashPos = tempFolderName.FindChar('/');
   if (slashPos > 0)
   {
     tokenStr = StringHead(tempFolderName, slashPos);
     remStr = Substring(tempFolderName, slashPos);
   }
   else
     tokenStr.Assign(tempFolderName);
@@ -1105,25 +1105,25 @@ NS_IMETHODIMP nsImapIncomingServer::Poss
     changedStr.Append("INBOX");
   else
     changedStr.Append(tokenStr);
 
   if (slashPos > 0 )
     changedStr.Append(remStr);
 
   dupFolderPath.Assign(changedStr);
-  nsCAutoString folderName(dupFolderPath);
-
-  nsCAutoString uri;
+  nsAutoCString folderName(dupFolderPath);
+
+  nsAutoCString uri;
   nsCString serverUri;
   GetServerURI(serverUri);
   uri.Assign(serverUri);
   int32_t leafPos = folderName.RFindChar('/');
-  nsCAutoString parentName(folderName);
-  nsCAutoString parentUri(uri);
+  nsAutoCString parentName(folderName);
+  nsAutoCString parentUri(uri);
 
   if (leafPos > 0)
   {
     // If there is a hierarchy, there is a parent.
     // Don't strip off slash if it's the first character
     parentName.SetLength(leafPos);
     folderName.Cut(0, leafPos + 1);	// get rid of the parent name
     haveParent = true;
@@ -1169,17 +1169,17 @@ NS_IMETHODIMP nsImapIncomingServer::Poss
     caseInsensitive = MsgLowerCaseEqualsLiteral(dupFolderPath, "inbox");
     a_nsIFolder->GetChildWithURI(uri, true, caseInsensitive, getter_AddRefs(child));
   }
   if (child)
   {
     nsCOMPtr <nsIMsgImapMailFolder> imapFolder = do_QueryInterface(child);
     if (imapFolder)
     {
-      nsCAutoString onlineName;
+      nsAutoCString onlineName;
       nsAutoString unicodeName;
       imapFolder->SetVerifiedAsOnlineFolder(true);
       imapFolder->SetHierarchyDelimiter(hierarchyDelimiter);
       if (boxFlags & kImapTrash)
       {
         int32_t deleteModel;
         GetDeleteModel(&deleteModel);
         if (deleteModel == nsMsgImapDeleteModels::MoveToTrash)
@@ -1289,17 +1289,17 @@ nsresult nsImapIncomingServer::GetFolder
   nsCOMPtr<nsIMsgFolder> rootFolder;
   rv = GetRootFolder(getter_AddRefs(rootFolder));
   if (NS_SUCCEEDED(rv) && rootFolder)
   {
     nsCString uri;
     rv = rootFolder->GetURI(uri);
     if (NS_SUCCEEDED(rv) && !uri.IsEmpty())
     {
-      nsCAutoString uriString(uri);
+      nsAutoCString uriString(uri);
       uriString.Append('/');
       uriString.Append(name);
       nsCOMPtr<nsIRDFService> rdf(do_GetService(kRDFServiceCID, &rv));
       NS_ENSURE_SUCCESS(rv, rv);
       nsCOMPtr<nsIRDFResource> res;
       rv = rdf->GetResource(uriString, getter_AddRefs(res));
       if (NS_SUCCEEDED(rv))
       {
@@ -1780,17 +1780,17 @@ bool nsImapIncomingServer::AllDescendent
 #endif // 0
   return allDescendentsAreNoSelect;
 }
 
 NS_IMETHODIMP
 nsImapIncomingServer::PromptLoginFailed(nsIMsgWindow *aMsgWindow,
                                         int32_t *aResult)
 {
-  nsCAutoString hostName;
+  nsAutoCString hostName;
   GetRealHostName(hostName);
 
   return MsgPromptLoginFailed(aMsgWindow, hostName, aResult);
 }
 
 NS_IMETHODIMP
 nsImapIncomingServer::FEAlert(const nsAString& aString, nsIMsgMailNewsUrl *aUrl)
 {
@@ -2442,17 +2442,17 @@ nsImapIncomingServer::AddTo(const nsACSt
 
   // RFC 3501 allows UTF-8 in addition to modified UTF-7
   // If it's not UTF-8, it cannot be MUTF7, either. We just ignore it.
   // (otherwise we'll crash. see #63186)
   if (!MsgIsUTF8(aName))
     return NS_OK;
 
   if (!NS_IsAscii(aName.BeginReading(), aName.Length())) {
-    nsCAutoString name;
+    nsAutoCString name;
     CopyUTF16toMUTF7(NS_ConvertUTF8toUTF16(aName), name);
     return mInner->AddTo(name, addAsSubscribed, aSubscribable, changeIfExists);
   }
   return mInner->AddTo(aName, addAsSubscribed, aSubscribable, changeIfExists);
 }
 
 NS_IMETHODIMP
 nsImapIncomingServer::StopPopulating(nsIMsgWindow *aMsgWindow)
@@ -2700,17 +2700,17 @@ nsImapIncomingServer::GetCanEmptyTrashOn
   NS_ENSURE_ARG_POINTER(canEmptyTrashOnExit);
   // Initialize canEmptyTrashOnExit true, a default value for IMAP
   *canEmptyTrashOnExit = true;
   GetPrefForServerAttribute("canEmptyTrashOnExit", canEmptyTrashOnExit);
   return NS_OK;
 }
 
 nsresult
-nsImapIncomingServer::CreateHostSpecificPrefName(const char *prefPrefix, nsCAutoString &prefName)
+nsImapIncomingServer::CreateHostSpecificPrefName(const char *prefPrefix, nsAutoCString &prefName)
 {
   NS_ENSURE_ARG_POINTER(prefPrefix);
 
   nsCString hostName;
   nsresult rv = GetHostName(hostName);
   NS_ENSURE_SUCCESS(rv,rv);
 
   prefName = prefPrefix;
@@ -2718,17 +2718,17 @@ nsImapIncomingServer::CreateHostSpecific
   prefName.Append(hostName);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsImapIncomingServer::GetSupportsDiskSpace(bool *aSupportsDiskSpace)
 {
   NS_ENSURE_ARG_POINTER(aSupportsDiskSpace);
-  nsCAutoString prefName;
+  nsAutoCString prefName;
   nsresult rv = CreateHostSpecificPrefName("default_supports_diskspace", prefName);
   NS_ENSURE_SUCCESS(rv,rv);
 
   nsCOMPtr<nsIPrefBranch> prefBranch = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
   if (NS_SUCCEEDED(rv))
      rv = prefBranch->GetBoolPref(prefName.get(), aSupportsDiskSpace);
 
   // Couldn't get the default value with the hostname.
@@ -2793,17 +2793,17 @@ nsImapIncomingServer::GetOfflineSupportL
 {
   NS_ENSURE_ARG_POINTER(aSupportLevel);
   nsresult rv = NS_OK;
 
   rv = GetIntValue("offline_support_level", aSupportLevel);
   if (*aSupportLevel != OFFLINE_SUPPORT_LEVEL_UNDEFINED)
     return rv;
 
-  nsCAutoString prefName;
+  nsAutoCString prefName;
   rv = CreateHostSpecificPrefName("default_offline_support_level", prefName);
   NS_ENSURE_SUCCESS(rv,rv);
 
   nsCOMPtr<nsIPrefBranch> prefBranch = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
   if (NS_SUCCEEDED(rv))
     rv = prefBranch->GetIntPref(prefName.get(), aSupportLevel);
 
   // Couldn't get the pref value with the hostname.
@@ -3098,46 +3098,46 @@ nsImapIncomingServer::OnUserOrHostNameCh
   // 1. Do common things in the base class.
   rv = nsMsgIncomingServer::OnUserOrHostNameChanged(oldName, newName, hostnameChanged);
   NS_ENSURE_SUCCESS(rv,rv);
 
   // 2. Reset 'HaveWeEverDiscoveredFolders' flag so the new folder list can be
   //    reloaded (ie, DiscoverMailboxList() will be invoked in nsImapProtocol).
   nsCOMPtr<nsIImapHostSessionList> hostSessionList = do_GetService(kCImapHostSessionListCID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
-  nsCAutoString serverKey;
+  nsAutoCString serverKey;
   rv = GetKey(serverKey);
   NS_ENSURE_SUCCESS(rv, rv);
   hostSessionList->SetHaveWeEverDiscoveredFoldersForHost(serverKey.get(), false);
   // 3. Make all the existing folders 'unverified' so that they can be
   //    removed from the folder pane after users log into the new server.
   ResetFoldersToUnverified(nullptr);
   return NS_OK;
 }
 
 // use canonical format in originalUri & convertedUri
 NS_IMETHODIMP
 nsImapIncomingServer::GetUriWithNamespacePrefixIfNecessary(int32_t namespaceType,
                                                            const nsACString& originalUri,
                                                            nsACString& convertedUri)
 {
   nsresult rv = NS_OK;
-  nsCAutoString serverKey;
+  nsAutoCString serverKey;
   rv = GetKey(serverKey);
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsIImapHostSessionList> hostSessionList = do_GetService(kCImapHostSessionListCID, &rv);
   nsIMAPNamespace *ns = nullptr;
   rv = hostSessionList->GetDefaultNamespaceOfTypeForHost(serverKey.get(), (EIMAPNamespaceType)namespaceType, ns);
   if (ns)
   {
-    nsCAutoString namespacePrefix(ns->GetPrefix());
+    nsAutoCString namespacePrefix(ns->GetPrefix());
     if (!namespacePrefix.IsEmpty())
     {
       // check if namespacePrefix is the same as the online directory; if so, ignore it.
-      nsCAutoString onlineDir;
+      nsAutoCString onlineDir;
       rv = GetServerDirectory(onlineDir);
       NS_ENSURE_SUCCESS(rv, rv);
       if (!onlineDir.IsEmpty())
       {
         char delimiter = ns->GetDelimiter();
           if ( onlineDir.Last() != delimiter )
             onlineDir += delimiter;
           if (onlineDir.Equals(namespacePrefix))
@@ -3172,17 +3172,17 @@ NS_IMETHODIMP nsImapIncomingServer::GetT
 
 NS_IMETHODIMP nsImapIncomingServer::SetTrashFolderName(const nsAString& chvalue)
 {
   // clear trash flag from the old pref
   nsAutoString oldTrashName;
   nsresult rv = GetTrashFolderName(oldTrashName);
   if (NS_SUCCEEDED(rv))
   {
-    nsCAutoString oldTrashNameUtf7;
+    nsAutoCString oldTrashNameUtf7;
     rv = CopyUTF16toMUTF7(oldTrashName, oldTrashNameUtf7);
     if (NS_SUCCEEDED(rv))
     {
       nsCOMPtr<nsIMsgFolder> oldFolder;
       rv = GetFolder(oldTrashNameUtf7, getter_AddRefs(oldFolder));
       if (NS_SUCCEEDED(rv) && oldFolder)
         oldFolder->ClearFlag(nsMsgFolderFlags::Trash);
     }
--- a/mailnews/imap/src/nsImapIncomingServer.h
+++ b/mailnews/imap/src/nsImapIncomingServer.h
@@ -84,17 +84,17 @@ protected:
   nsString GetImapStringByName(const nsString &aName);
   static nsresult AlertUser(const nsAString& aString, nsIMsgMailNewsUrl *aUrl);
 
 private:
   nsresult SubscribeToFolder(const PRUnichar *aName, bool subscribe);
   nsresult GetImapConnection(nsIImapUrl* aImapUrl,
                              nsIImapProtocol** aImapConnection);
   nsresult CreateProtocolInstance(nsIImapProtocol ** aImapConnection);
-  nsresult CreateHostSpecificPrefName(const char *prefPrefix, nsCAutoString &prefName);
+  nsresult CreateHostSpecificPrefName(const char *prefPrefix, nsAutoCString &prefName);
 
   nsresult DoomUrlIfChannelHasError(nsIImapUrl *aImapUrl, bool *urlDoomed);
   bool ConnectionTimeOut(nsIImapProtocol* aImapConnection);
   nsresult GetFormattedStringFromID(const nsAString& aValue, int32_t aID, nsAString& aResult);
   nsresult GetPrefForServerAttribute(const char *prefSuffix, bool *prefValue);
   bool CheckSpecialFolder(nsIRDFService *rdf, nsCString &folderUri,
                             uint32_t folderFlag, nsCString &existingUri);
 
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -278,23 +278,23 @@ NS_IMETHODIMP nsImapMailFolder::AddSubfo
 {
   NS_ENSURE_ARG_POINTER(aChild);
 
   int32_t flags = 0;
   nsresult rv;
   nsCOMPtr<nsIRDFService> rdf = do_GetService("@mozilla.org/rdf/rdf-service;1", &rv);
   NS_ENSURE_SUCCESS(rv,rv);
 
-  nsCAutoString uri(mURI);
+  nsAutoCString uri(mURI);
   uri.Append('/');
 
   // If AddSubFolder starts getting called for folders other than virtual folders,
   // we'll have to do convert those names to modified utf-7. For now, the account manager code
   // that loads the virtual folders for each account, expects utf8 not modified utf-7.
-  nsCAutoString escapedName;
+  nsAutoCString escapedName;
   rv = NS_MsgEscapeEncodeURLPath(aName, escapedName);
   NS_ENSURE_SUCCESS(rv, rv);
 
   uri += escapedName.get();
 
   nsCOMPtr <nsIMsgFolder> msgFolder;
   rv = GetChildWithURI(uri, false/*deep*/, true /*case Insensitive*/, getter_AddRefs(msgFolder));
   if (NS_SUCCEEDED(rv) && msgFolder)
@@ -348,17 +348,17 @@ nsresult nsImapMailFolder::AddSubfolderW
 {
   NS_ENSURE_ARG_POINTER(child);
 
   nsresult rv;
   nsCOMPtr<nsIRDFService> rdf(do_GetService(kRDFServiceCID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
   int32_t flags = 0;
 
-  nsCAutoString uri(mURI);
+  nsAutoCString uri(mURI);
   uri.Append('/');
   AppendUTF16toUTF8(name, uri);
 
   bool isServer;
   rv = GetIsServer(&isServer);
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool isInbox = isServer && name.LowerCaseEqualsLiteral("inbox");
@@ -703,17 +703,17 @@ NS_IMETHODIMP nsImapMailFolder::UpdateFo
                                            getter_AddRefs(term));
           nsMsgSearchAttribValue attrib;
           rv = term->GetAttrib(&attrib);
           NS_ENSURE_SUCCESS(rv, rv);
           if (attrib == nsMsgSearchAttrib::Body)
             m_filterListRequiresBody = true;
           else if (attrib == nsMsgSearchAttrib::Custom)
           {
-            nsCAutoString customId;
+            nsAutoCString customId;
             rv = term->GetCustomId(customId);
             nsCOMPtr<nsIMsgSearchCustomTerm> customTerm;
             if (NS_SUCCEEDED(rv) && filterService)
               rv = filterService->GetCustomTerm(customId,
                                                 getter_AddRefs(customTerm));
             bool needsBody = false;
             if (NS_SUCCEEDED(rv) && customTerm)
               rv = customTerm->GetNeedsBody(&needsBody);
@@ -899,31 +899,31 @@ NS_IMETHODIMP nsImapMailFolder::CreateCl
   // not be a leaf folder.
   int32_t folderStart = leafName.RFindChar('/');
   if (folderStart > 0)
   {
     nsCOMPtr<nsIRDFService> rdf(do_GetService(kRDFServiceCID, &rv));
     NS_ENSURE_SUCCESS(rv, rv);
     nsCOMPtr<nsIRDFResource> res;
     nsCOMPtr<nsIMsgImapMailFolder> parentFolder;
-    nsCAutoString uri (mURI);
+    nsAutoCString uri (mURI);
     leafName.Assign(Substring(parentName, folderStart + 1));
     parentName.SetLength(folderStart);
 
     rv = CreateDirectoryForFolder(getter_AddRefs(path));
     if (NS_FAILED(rv))
       return rv;
     uri.Append('/');
     uri.Append(NS_LossyConvertUTF16toASCII(parentName));
     rv = rdf->GetResource(uri, getter_AddRefs(res));
     if (NS_FAILED(rv))
       return rv;
     parentFolder = do_QueryInterface(res, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
-    nsCAutoString leafnameC;
+    nsAutoCString leafnameC;
     LossyCopyUTF16toASCII(leafName, leafnameC);
     return parentFolder->CreateClientSubfolderInfo(leafnameC, hierarchyDelimiter,flags, suppressNotification);
   }
 
   // if we get here, it's really a leaf, and "this" is the parent.
   folderNameStr = leafName;
 
   // Create an empty database for this mail folder, set its name from the user
@@ -950,17 +950,17 @@ NS_IMETHODIMP nsImapMailFolder::CreateCl
   if (NS_SUCCEEDED(rv) && unusedDB)
   {
   //need to set the folder name
     nsCOMPtr <nsIDBFolderInfo> folderInfo;
     rv = unusedDB->GetDBFolderInfo(getter_AddRefs(folderInfo));
     nsCOMPtr <nsIMsgImapMailFolder> imapFolder = do_QueryInterface(child, &rv);
     if (NS_SUCCEEDED(rv))
     {
-      nsCAutoString onlineName(m_onlineFolderName);
+      nsAutoCString onlineName(m_onlineFolderName);
       if (!onlineName.IsEmpty())
         onlineName.Append(hierarchyDelimiter);
       onlineName.Append(NS_LossyConvertUTF16toASCII(folderNameStr));
       imapFolder->SetVerifiedAsOnlineFolder(true);
       imapFolder->SetOnlineName(onlineName);
       imapFolder->SetHierarchyDelimiter(hierarchyDelimiter);
       imapFolder->SetBoxFlags(flags);
 
@@ -1031,20 +1031,20 @@ NS_IMETHODIMP nsImapMailFolder::CreateSt
   nsresult rv = NS_OK;
   nsCOMPtr <nsIMsgFolder> msgParent;
   GetParent(getter_AddRefs(msgParent));
 
   // parent is probably not set because *this* was probably created by rdf
   // and not by folder discovery. So, we have to compute the parent.
   if (!msgParent)
   {
-    nsCAutoString folderName(mURI);
+    nsAutoCString folderName(mURI);
 
     int32_t leafPos = folderName.RFindChar('/');
-    nsCAutoString parentName(folderName);
+    nsAutoCString parentName(folderName);
 
     if (leafPos > 0)
     {
       // If there is a hierarchy, there is a parent.
       // Don't strip off slash if it's the first character
       parentName.SetLength(leafPos);
       // get the corresponding RDF resource
       // RDF will create the folder resource if it doesn't already exist
@@ -1697,18 +1697,18 @@ NS_IMETHODIMP nsImapMailFolder::PrepareT
 }
 
 NS_IMETHODIMP nsImapMailFolder::RenameLocal(const nsACString& newName, nsIMsgFolder *parent)
 {
   // XXX Here it's assumed that IMAP folder names are stored locally
   // in modified UTF-7 (ASCII-only) as is stored remotely.  If we ever change
   // this, we have to work with nsString instead of nsCString
   // (ref. bug 264071)
-  nsCAutoString leafname(newName);
-  nsCAutoString parentName;
+  nsAutoCString leafname(newName);
+  nsAutoCString parentName;
   // newName always in the canonical form "greatparent/parentname/leafname"
   int32_t leafpos = leafname.RFindChar('/');
   if (leafpos >0)
       leafname.Cut(0, leafpos+1);
   m_msgParser = nullptr;
   PrepareToRename();
   CloseAndBackupFolderDB(leafname);
 
@@ -1731,24 +1731,24 @@ NS_IMETHODIMP nsImapMailFolder::RenameLo
   int32_t count = mSubFolders.Count();
   if (count > 0)
     rv = CreateDirectoryForFolder(getter_AddRefs(dirFile));
 
   nsCOMPtr <nsIFile> oldSummaryFile;
   rv = GetSummaryFileLocation(oldPathFile, getter_AddRefs(oldSummaryFile));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCAutoString newNameStr;
+  nsAutoCString newNameStr;
   oldSummaryFile->Remove(false);
   if (count > 0)
   {
     newNameStr = leafname;
     NS_MsgHashIfNecessary(newNameStr);
     newNameStr += ".sbd";
-    nsCAutoString leafName;
+    nsAutoCString leafName;
     dirFile->GetNativeLeafName(leafName);
     if (!leafName.Equals(newNameStr))
       return dirFile->MoveToNative(nullptr, newNameStr);      // in case of rename operation leaf names will differ
 
     parentPathFile->AppendNative(newNameStr);    //only for move we need to progress further in case the parent differs
     bool isDirectory = false;
     parentPathFile->IsDirectory(&isDirectory);
     if (!isDirectory)
@@ -1880,17 +1880,17 @@ nsImapMailFolder::AddMessageDispositionS
 
 NS_IMETHODIMP
 nsImapMailFolder::MarkMessagesRead(nsIArray *messages, bool markRead)
 {
   // tell the folder to do it, which will mark them read in the db.
   nsresult rv = nsMsgDBFolder::MarkMessagesRead(messages, markRead);
   if (NS_SUCCEEDED(rv))
   {
-    nsCAutoString messageIds;
+    nsAutoCString messageIds;
     nsTArray<nsMsgKey> keysToMarkRead;
     rv = BuildIdsAndKeyArray(messages, messageIds, keysToMarkRead);
     NS_ENSURE_SUCCESS(rv, rv);
 
     StoreImapFlags(kImapMsgSeenFlag, markRead, keysToMarkRead.Elements(), keysToMarkRead.Length(), nullptr);
     rv = GetDatabase();
     if (NS_SUCCEEDED(rv))
       mDatabase->Commit(nsMsgDBCommitType::kLargeCommit);
@@ -1901,17 +1901,17 @@ nsImapMailFolder::MarkMessagesRead(nsIAr
 NS_IMETHODIMP
 nsImapMailFolder::SetLabelForMessages(nsIArray *aMessages, nsMsgLabelValue aLabel)
 {
   NS_ENSURE_ARG(aMessages);
 
   nsresult rv = nsMsgDBFolder::SetLabelForMessages(aMessages, aLabel);
   if (NS_SUCCEEDED(rv))
   {
-    nsCAutoString messageIds;
+    nsAutoCString messageIds;
     nsTArray<nsMsgKey> keysToLabel;
     nsresult rv = BuildIdsAndKeyArray(aMessages, messageIds, keysToLabel);
     NS_ENSURE_SUCCESS(rv, rv);
     StoreImapFlags((aLabel << 9), true, keysToLabel.Elements(), keysToLabel.Length(), nullptr);
     rv = GetDatabase();
     if (NS_SUCCEEDED(rv))
       mDatabase->Commit(nsMsgDBCommitType::kLargeCommit);
   }
@@ -2022,17 +2022,17 @@ NS_IMETHODIMP nsImapMailFolder::WriteToF
 NS_IMETHODIMP
 nsImapMailFolder::MarkMessagesFlagged(nsIArray *messages, bool markFlagged)
 {
   nsresult rv;
   // tell the folder to do it, which will mark them read in the db.
   rv = nsMsgDBFolder::MarkMessagesFlagged(messages, markFlagged);
   if (NS_SUCCEEDED(rv))
   {
-    nsCAutoString messageIds;
+    nsAutoCString messageIds;
     nsTArray<nsMsgKey> keysToMarkFlagged;
     rv = BuildIdsAndKeyArray(messages, messageIds, keysToMarkFlagged);
     if (NS_FAILED(rv)) return rv;
     rv = StoreImapFlags(kImapMsgFlaggedFlag, markFlagged,  keysToMarkFlagged.Elements(),
                         keysToMarkFlagged.Length(), nullptr);
     mDatabase->Commit(nsMsgDBCommitType::kLargeCommit);
   }
   return rv;
@@ -2209,19 +2209,19 @@ nsresult nsImapMailFolder::MarkMessagesI
 NS_IMETHODIMP nsImapMailFolder::DeleteMessages(nsIArray *messages,
                                                nsIMsgWindow *msgWindow,
                                                bool deleteStorage, bool isMove,
                                                nsIMsgCopyServiceListener* listener,
                                                bool allowUndo)
 {
   // *** jt - assuming delete is move to the trash folder for now
   nsCOMPtr<nsIRDFResource> res;
-  nsCAutoString uri;
+  nsAutoCString uri;
   bool deleteImmediatelyNoTrash = false;
-  nsCAutoString messageIds;
+  nsAutoCString messageIds;
   nsTArray<nsMsgKey> srcKeyArray;
   bool deleteMsgs = true;  //used for toggling delete status - default is true
   nsMsgImapDeleteModel deleteModel = nsMsgImapDeleteModels::MoveToTrash;
   imapMessageFlagsType messageFlags = kImapMsgDeletedFlag;
 
   nsCOMPtr<nsIImapIncomingServer> imapServer;
   nsresult rv = GetFlag(nsMsgFolderFlags::Trash, &deleteImmediatelyNoTrash);
   rv = GetImapIncomingServer(getter_AddRefs(imapServer));
@@ -3465,17 +3465,17 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFil
         {
           NS_ASSERTION(false, "actionTargetFolderUri is empty");
           continue;
         }
       }
 
       uint32_t msgFlags;
       nsMsgKey    msgKey;
-      nsCAutoString trashNameVal;
+      nsAutoCString trashNameVal;
 
       msgHdr->GetFlags(&msgFlags);
       msgHdr->GetMessageKey(&msgKey);
       bool isRead = (msgFlags & nsMsgMessageFlags::Read);
       switch (actionType)
       {
         case nsMsgFilterAction::Delete:
         {
@@ -3637,17 +3637,17 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFil
           nsCOMPtr<nsIMutableArray> messageArray(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
           NS_ENSURE_TRUE(messageArray, rv);
           messageArray->AppendElement(msgHdr, false);
           AddKeywordsToMessages(messageArray, keyword);
           break;
         }
         case nsMsgFilterAction::JunkScore:
         {
-          nsCAutoString junkScoreStr;
+          nsAutoCString junkScoreStr;
           int32_t junkScore;
           filterAction->GetJunkScore(&junkScore);
           junkScoreStr.AppendInt(junkScore);
           mDatabase->SetStringProperty(msgKey, "junkscore", junkScoreStr.get());
           mDatabase->SetStringProperty(msgKey, "junkscoreorigin", "filter");
 
           // If score is available, set up to store junk status on server.
           if (junkScore == nsIJunkMailPlugin::IS_SPAM_SCORE ||
@@ -3726,17 +3726,17 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFil
         break;
 
         case nsMsgFilterAction::Custom:
         {
           nsCOMPtr<nsIMsgFilterCustomAction> customAction;
           rv = filterAction->GetCustomAction(getter_AddRefs(customAction));