Bug 1410794 - Update comm-central for nsIPrefBranch.idl changes. r=jorgk
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 24 Oct 2017 11:52:11 +1100
changeset 22453 5f5fbb45e801293526d7c6ab2158f7b7875c2828
parent 22452 1c73b7308c85927524207fbd0015b91a0b04deb8
child 22454 97bf29612932b32707ddd6838047d364947eca13
push id13687
push usermozilla@jorgk.com
push dateMon, 30 Oct 2017 12:13:49 +0000
treeherdercomm-central@97bf29612932 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk
bugs1410794
Bug 1410794 - Update comm-central for nsIPrefBranch.idl changes. r=jorgk This mostly involves removing getter_Copies() and get() calls. There are a few functions that have char* arguments changed to nsACString&, and a couple of members that are changed to nsCString. Finally, for a few places none of those approaches worked and I had to use moz_xstrdup().
mail/components/migration/src/nsMailProfileMigratorUtils.cpp
mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
mail/components/migration/src/nsNetscapeProfileMigratorBase.h
mail/components/migration/src/nsProfileMigrator.cpp
mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
mail/components/shell/DirectoryProvider.cpp
mailnews/addrbook/src/nsAbAddressCollector.cpp
mailnews/addrbook/src/nsAbDirProperty.cpp
mailnews/addrbook/src/nsAbLDAPDirectory.cpp
mailnews/addrbook/src/nsAbMDBDirectory.cpp
mailnews/addrbook/src/nsDirPrefs.cpp
mailnews/base/search/src/nsMsgSearchAdapter.cpp
mailnews/base/search/src/nsMsgSearchTerm.cpp
mailnews/base/src/nsMsgAccount.cpp
mailnews/base/src/nsMsgAccountManager.cpp
mailnews/base/src/nsMsgContentPolicy.cpp
mailnews/base/src/nsMsgTagService.cpp
mailnews/base/src/nsSpamSettings.cpp
mailnews/base/src/nsStatusBarBiffManager.cpp
mailnews/base/util/nsMsgIdentity.cpp
mailnews/base/util/nsMsgIncomingServer.cpp
mailnews/compose/public/nsISmtpServer.idl
mailnews/compose/src/nsMsgCompUtils.cpp
mailnews/compose/src/nsMsgCompose.cpp
mailnews/compose/src/nsMsgComposeService.cpp
mailnews/compose/src/nsSmtpProtocol.cpp
mailnews/compose/src/nsSmtpServer.cpp
mailnews/compose/src/nsSmtpService.cpp
mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/imap/src/nsImapProtocol.cpp
mailnews/import/text/src/nsTextImport.cpp
mailnews/local/src/nsLocalMailFolder.cpp
mailnews/local/src/nsParseMailbox.cpp
mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.cpp
mailnews/mime/emitters/nsMimeHtmlEmitter.cpp
mailnews/mime/src/mimedrft.cpp
mailnews/mime/src/mimemoz2.cpp
mailnews/mime/src/mimetpfl.cpp
mailnews/mime/src/mimetpfl.h
mailnews/mime/src/mimetpla.cpp
mailnews/mime/src/mimetpla.h
suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp
--- a/mail/components/migration/src/nsMailProfileMigratorUtils.cpp
+++ b/mail/components/migration/src/nsMailProfileMigratorUtils.cpp
@@ -17,23 +17,23 @@ void SetProxyPref(const nsACString& aHos
 {
   nsAutoCString hostPort(aHostPort);
   int32_t portDelimOffset = hostPort.RFindChar(':');
   if (portDelimOffset > 0) {
     nsAutoCString host(Substring(hostPort, 0, portDelimOffset));
     nsAutoCString port(Substring(hostPort, portDelimOffset + 1,
                                  hostPort.Length() - (portDelimOffset + 1)));
 
-    aPrefs->SetCharPref(aPref, host.get());
+    aPrefs->SetCharPref(aPref, host);
     nsresult stringErr;
     int32_t portValue = port.ToInteger(&stringErr);
     aPrefs->SetIntPref(aPortPref, portValue);
   }
   else
-    aPrefs->SetCharPref(aPref, hostPort.get());
+    aPrefs->SetCharPref(aPref, hostPort);
 }
 
 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"
@@ -45,17 +45,17 @@ void ParseOverrideServers(const char* aS
                                        (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)
       break;
     left = right + 1;
     override.Replace(right, 1, NS_LITERAL_CSTRING(","));
   }
-  aBranch->SetCharPref("network.proxy.no_proxies_on", override.get());
+  aBranch->SetCharPref("network.proxy.no_proxies_on", override);
 }
 
 void GetMigrateDataFromArray(MigrationData* aDataArray, int32_t aDataArrayLength,
                              bool aReplace, nsIFile* aSourceProfile,
                              uint16_t* aResult)
 {
   nsCOMPtr<nsIFile> sourceFile;
   bool exists;
--- a/mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
+++ b/mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
@@ -127,25 +127,27 @@ nsNetscapeProfileMigratorBase::GetProfil
   } \
   return NS_OK;
 
 nsresult
 nsNetscapeProfileMigratorBase::GetString(PrefTransform* aTransform,
                                          nsIPrefBranch* aBranch)
 {
   PrefTransform* xform = (PrefTransform*)aTransform;
-  GETPREF(xform, GetCharPref, &xform->stringValue);
+  nsCString str;
+  GETPREF(xform, GetCharPref, str);
+  xform->stringValue = moz_xstrdup(str.get());
 }
 
 nsresult
 nsNetscapeProfileMigratorBase::SetString(PrefTransform* aTransform,
                                          nsIPrefBranch* aBranch)
 {
   PrefTransform* xform = (PrefTransform*)aTransform;
-  SETPREF(xform, SetCharPref, xform->stringValue);
+  SETPREF(xform, SetCharPref, nsDependentCString(xform->stringValue));
 }
 
 nsresult
 nsNetscapeProfileMigratorBase::GetBool(PrefTransform* aTransform,
                                        nsIPrefBranch* aBranch)
 {
   PrefTransform* xform = (PrefTransform*)aTransform;
   GETPREF(xform, GetBoolPref, &xform->boolValue);
@@ -194,17 +196,17 @@ nsNetscapeProfileMigratorBase::CopyFile(
   targetFile->Exists(&exists);
   if (exists)
     targetFile->Remove(false);
 
   return sourceFile->CopyTo(mTargetProfile, aTargetFileName);
 }
 
 nsresult
-nsNetscapeProfileMigratorBase::GetSignonFileName(bool aReplace, char** aFileName)
+nsNetscapeProfileMigratorBase::GetSignonFileName(bool aReplace, nsACString& aFileName)
 {
   nsresult rv;
   if (aReplace) {
     // Find out what the signons file was called, this is stored in a pref
     // in Seamonkey.
     nsCOMPtr<nsIPrefService> psvc(do_GetService(NS_PREFSERVICE_CONTRACTID));
     psvc->ResetPrefs();
 
@@ -217,17 +219,17 @@ nsNetscapeProfileMigratorBase::GetSignon
     rv = branch->GetCharPref("signon.SignonFileName", aFileName);
   }
   else
     rv = LocateSignonsFile(aFileName);
   return rv;
 }
 
 nsresult
-nsNetscapeProfileMigratorBase::LocateSignonsFile(char** aResult)
+nsNetscapeProfileMigratorBase::LocateSignonsFile(nsACString& aResult)
 {
   nsCOMPtr<nsISimpleEnumerator> entries;
   nsresult rv = mSourceProfile->GetDirectoryEntries(getter_AddRefs(entries));
   if (NS_FAILED(rv)) return rv;
 
   nsAutoCString fileName;
   do {
     bool hasMore = false;
@@ -250,17 +252,17 @@ nsNetscapeProfileMigratorBase::LocateSig
 
     if (extn.EqualsIgnoreCase("s")) {
       url->GetFileName(fileName);
       break;
     }
   }
   while (1);
 
-  *aResult = ToNewCString(fileName);
+  aResult = fileName;
 
   return NS_OK;
 }
 
 // helper function, copies the contents of srcDir into destDir.
 // destDir will be created if it doesn't exist.
 
 nsresult nsNetscapeProfileMigratorBase::RecursiveCopy(nsIFile* srcDir, nsIFile* destDir)
--- a/mail/components/migration/src/nsNetscapeProfileMigratorBase.h
+++ b/mail/components/migration/src/nsNetscapeProfileMigratorBase.h
@@ -87,18 +87,18 @@ protected:
   void EndCopyFolders();
 
   nsresult GetProfileDataFromProfilesIni(nsIFile* aDataDir,
                                          nsIMutableArray* aProfileNames,
                                          nsIMutableArray* aProfileLocations);
 
   nsresult CopyFile(const nsAString& aSourceFileName, const nsAString& aTargetFileName);
 
-  nsresult GetSignonFileName(bool aReplace, char** aFileName);
-  nsresult LocateSignonsFile(char** aResult);
+  nsresult GetSignonFileName(bool aReplace, nsACString& aFileName);
+  nsresult LocateSignonsFile(nsACString& aResult);
 
   nsCOMPtr<nsIFile> mSourceProfile;
   nsCOMPtr<nsIFile> mTargetProfile;
 
   // List of src/destination files we still have to copy into the new profile
   // directory.
   nsTArray<fileTransactionEntry> mFileCopyTransactions;
   uint32_t mFileCopyTransactionIndex;
--- a/mail/components/migration/src/nsProfileMigrator.cpp
+++ b/mail/components/migration/src/nsProfileMigrator.cpp
@@ -77,17 +77,17 @@ nsProfileMigrator::GetDefaultMailMigrato
 {
   // look up the value of profile.force.migration in case we are supposed to force migration using a particular
   // migrator....
   nsresult rv = NS_OK;
   nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCString forceMigrationType;
-  prefs->GetCharPref("profile.force.migration", getter_Copies(forceMigrationType));
+  prefs->GetCharPref("profile.force.migration", 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);
   nsAutoCString migratorID;
   if (!forceMigrationType.IsEmpty())
   {
--- a/mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
+++ b/mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
@@ -133,17 +133,17 @@ nsSeamonkeyProfileMigrator::GetMigrateDa
                           };
 
   // Frees file name strings allocated above.
   GetMigrateDataFromArray(data, sizeof(data)/sizeof(MigrationData),
                           aReplace, mSourceProfile, aResult);
 
   // Now locate passwords
   nsCString signonsFileName;
-  GetSignonFileName(aReplace, getter_Copies(signonsFileName));
+  GetSignonFileName(aReplace, signonsFileName);
 
   if (!signonsFileName.IsEmpty()) {
     nsAutoString fileName;
     CopyASCIItoUTF16(signonsFileName, fileName);
     nsCOMPtr<nsIFile> sourcePasswordsFile;
     mSourceProfile->Clone(getter_AddRefs(sourcePasswordsFile));
     sourcePasswordsFile->Append(fileName);
 
@@ -496,17 +496,17 @@ nsSeamonkeyProfileMigrator::CopyMailFold
 
       nsCOMPtr<nsIPrefBranch> serverBranch;
       aPrefService->GetBranch(prefName.get(), getter_AddRefs(serverBranch));
 
       if (!serverBranch)
         break; // should we clear out this server pref from aMailServers?
 
       nsCString serverType;
-      serverBranch->GetCharPref("type", getter_Copies(serverType));
+      serverBranch->GetCharPref("type", serverType);
 
       nsCOMPtr<nsIFile> sourceMailFolder;
       serverBranch->GetComplexValue("directory", NS_GET_IID(nsIFile), getter_AddRefs(sourceMailFolder));
 
       // now based on type, we need to build a new destination path for the mail folders for this server
       nsCOMPtr<nsIFile> targetMailFolder;
       if (serverType.Equals("imap"))
       {
@@ -524,17 +524,17 @@ nsSeamonkeyProfileMigrator::CopyMailFold
         mTargetProfile->Clone(getter_AddRefs(targetMailFolder));
         targetMailFolder->Append(NEWS_DIR_50_NAME);
       }
 
       if (targetMailFolder)
       {
         // for all of our server types, append the host name to the directory as part of the new location
         nsCString hostName;
-        serverBranch->GetCharPref("hostname", getter_Copies(hostName));
+        serverBranch->GetCharPref("hostname", hostName);
         targetMailFolder->Append(NS_ConvertASCIItoUTF16(hostName));
 
         // we should make sure the host name based directory we are going to migrate
         // the accounts into is unique. This protects against the case where the user
         // has multiple servers with the same host name.
         rv = targetMailFolder->CreateUnique(nsIFile::DIRECTORY_TYPE, 0777);
         NS_ENSURE_SUCCESS(rv, rv);
 
@@ -651,19 +651,22 @@ nsSeamonkeyProfileMigrator::ReadBranch(c
     // Save each pref's value into an array
     char* currPref = prefs[i];
     int32_t type;
     branch->GetPrefType(currPref, &type);
     PrefBranchStruct* pref = new PrefBranchStruct;
     pref->prefName = currPref;
     pref->type = type;
     switch (type) {
-    case nsIPrefBranch::PREF_STRING:
-      rv = branch->GetCharPref(currPref, &pref->stringValue);
+    case nsIPrefBranch::PREF_STRING: {
+      nsCString str;
+      rv = branch->GetCharPref(currPref, str);
+      pref->stringValue = moz_xstrdup(str.get());
       break;
+    }
     case nsIPrefBranch::PREF_BOOL:
       rv = branch->GetBoolPref(currPref, &pref->boolValue);
       break;
     case nsIPrefBranch::PREF_INT:
       rv = branch->GetIntPref(currPref, &pref->intValue);
       break;
     default:
       NS_WARNING("Invalid Pref Type in "
@@ -685,17 +688,18 @@ nsSeamonkeyProfileMigrator::WriteBranch(
   nsCOMPtr<nsIPrefBranch> branch;
   aPrefService->GetBranch(branchName, getter_AddRefs(branch));
 
   uint32_t count = aPrefs.Length();
   for (uint32_t i = 0; i < count; ++i) {
     PrefBranchStruct* pref = aPrefs.ElementAt(i);
     switch (pref->type) {
     case nsIPrefBranch::PREF_STRING:
-      (void) branch->SetCharPref(pref->prefName, pref->stringValue);
+      (void) branch->SetCharPref(pref->prefName,
+                                 nsDependentCString(pref->stringValue));
       free(pref->stringValue);
       pref->stringValue = nullptr;
       break;
     case nsIPrefBranch::PREF_BOOL:
       (void) branch->SetBoolPref(pref->prefName, pref->boolValue);
       break;
     case nsIPrefBranch::PREF_INT:
       (void) branch->SetIntPref(pref->prefName, pref->intValue);
@@ -726,17 +730,17 @@ nsSeamonkeyProfileMigrator::CopyJunkTrai
 }
 
 nsresult
 nsSeamonkeyProfileMigrator::CopyPasswords(bool aReplace)
 {
   nsresult rv = NS_OK;
 
   nsCString signonsFileName;
-  GetSignonFileName(aReplace, getter_Copies(signonsFileName));
+  GetSignonFileName(aReplace, signonsFileName);
 
   if (signonsFileName.IsEmpty())
     return NS_ERROR_FILE_NOT_FOUND;
 
   nsAutoString fileName;
   CopyASCIItoUTF16(signonsFileName, fileName);
   if (aReplace)
     rv = CopyFile(fileName, fileName);
--- a/mail/components/shell/DirectoryProvider.cpp
+++ b/mail/components/shell/DirectoryProvider.cpp
@@ -115,17 +115,17 @@ AppendDistroSearchDirs(nsIProperties* aD
     if (NS_SUCCEEDED(rv))
     {
       nsAutoString wLocale;
       prefString->GetData(wLocale);
       CopyUTF16toUTF8(wLocale, locale);
     }
     else
     {
-      rv = prefs->GetCharPref("general.useragent.locale", getter_Copies(locale));
+      rv = prefs->GetCharPref("general.useragent.locale", locale);
     }
 
     if (NS_SUCCEEDED(rv))
     {
       nsCOMPtr<nsIFile> curLocalePlugins;
       rv = localePlugins->Clone(getter_AddRefs(curLocalePlugins));
       if (NS_SUCCEEDED(rv))
       {
@@ -137,17 +137,17 @@ AppendDistroSearchDirs(nsIProperties* aD
           return; // all done
         }
       }
     }
 
     // we didn't append the locale dir - try the default one
     nsCString defLocale;
     rv = prefs->GetCharPref("distribution.searchplugins.defaultLocale",
-                            getter_Copies(defLocale));
+                            defLocale);
     if (NS_SUCCEEDED(rv))
     {
       nsCOMPtr<nsIFile> defLocalePlugins;
       rv = localePlugins->Clone(getter_AddRefs(defLocalePlugins));
       if (NS_SUCCEEDED(rv))
       {
         defLocalePlugins->AppendNative(defLocale);
         rv = defLocalePlugins->Exists(&exists);
--- a/mailnews/addrbook/src/nsAbAddressCollector.cpp
+++ b/mailnews/addrbook/src/nsAbAddressCollector.cpp
@@ -292,18 +292,17 @@ nsAbAddressCollector::Init(void)
 }
 
 // Performs the necessary changes to set up the collector for the specified
 // collected address book.
 void
 nsAbAddressCollector::SetUpAbFromPrefs(nsIPrefBranch *aPrefBranch)
 {
   nsCString abURI;
-  aPrefBranch->GetCharPref(PREF_MAIL_COLLECT_ADDRESSBOOK,
-                           getter_Copies(abURI));
+  aPrefBranch->GetCharPref(PREF_MAIL_COLLECT_ADDRESSBOOK, abURI);
 
   if (abURI.IsEmpty())
     abURI.AssignLiteral(kPersonalAddressbookUri);
 
   if (abURI == mABURI)
     return;
 
   mDirectory = nullptr;
--- a/mailnews/addrbook/src/nsAbDirProperty.cpp
+++ b/mailnews/addrbook/src/nsAbDirProperty.cpp
@@ -498,17 +498,17 @@ NS_IMETHODIMP nsAbDirProperty::GetString
                                               nsACString &aResult)
 {
   if (!m_DirectoryPrefs && NS_FAILED(InitDirectoryPrefs()))
     return NS_ERROR_NOT_INITIALIZED;
 
   nsCString value;
 
     /* unfortunately, there may be some prefs out there which look like (null) */
-  if (NS_SUCCEEDED(m_DirectoryPrefs->GetCharPref(aName, getter_Copies(value))) &&
+  if (NS_SUCCEEDED(m_DirectoryPrefs->GetCharPref(aName, value)) &&
       !value.EqualsLiteral("(null"))
     aResult = value;
   else
     aResult = aDefaultValue;
 
   return NS_OK;
 }
 /*
@@ -564,17 +564,17 @@ NS_IMETHODIMP nsAbDirProperty::SetBoolVa
 }
 
 NS_IMETHODIMP nsAbDirProperty::SetStringValue(const char *aName,
                                               const nsACString &aValue)
 {
   if (!m_DirectoryPrefs && NS_FAILED(InitDirectoryPrefs()))
     return NS_ERROR_NOT_INITIALIZED;
 
-  return m_DirectoryPrefs->SetCharPref(aName, nsCString(aValue).get());
+  return m_DirectoryPrefs->SetCharPref(aName, aValue);
 }
 
 NS_IMETHODIMP nsAbDirProperty::SetLocalizedStringValue(const char *aName,
                                                        const nsACString &aValue)
 {
   if (!m_DirectoryPrefs && NS_FAILED(InitDirectoryPrefs()))
     return NS_ERROR_NOT_INITIALIZED;
 
--- a/mailnews/addrbook/src/nsAbLDAPDirectory.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPDirectory.cpp
@@ -507,17 +507,17 @@ NS_IMETHODIMP nsAbLDAPDirectory::UseForA
       return NS_OK;
   }
 
   // If we failed to get the identity preference, or the pref name is empty
   // try the global preference.
   if (prefName.IsEmpty())
   {
     nsresult rv = prefs->GetCharPref("ldap_2.autoComplete.directoryServer",
-                                     getter_Copies(prefName));
+                                     prefName);
     NS_ENSURE_SUCCESS(rv,rv);
   }
 
   // Now see if the pref name matches our pref id.
   if (prefName.Equals(m_DirPrefId))
   {
     // Yes it does, one last check - does the replication file exist?
     nsresult rv;
--- a/mailnews/addrbook/src/nsAbMDBDirectory.cpp
+++ b/mailnews/addrbook/src/nsAbMDBDirectory.cpp
@@ -97,18 +97,17 @@ NS_IMETHODIMP nsAbMDBDirectory::Init(con
     NS_ENSURE_SUCCESS(rv, rv);
 
     for (i = 0; i < childCount; ++i)
     {
       child.Assign(childArray[i]);
 
       if (StringEndsWith(child, NS_LITERAL_CSTRING(".filename")))
       {
-        if (NS_SUCCEEDED(prefBranch->GetCharPref(child.get(),
-                                                 getter_Copies(childValue))))
+        if (NS_SUCCEEDED(prefBranch->GetCharPref(child.get(), childValue)))
         {
           if (childValue == filename)
           {
             dotOffset = child.RFindChar('.');
             if (dotOffset != -1)
             {
               nsAutoCString prefName(StringHead(child, dotOffset));
               m_DirPrefId.AssignLiteral(PREF_LDAP_SERVER_TREE_NAME ".");
--- a/mailnews/addrbook/src/nsDirPrefs.cpp
+++ b/mailnews/addrbook/src/nsDirPrefs.cpp
@@ -770,30 +770,30 @@ static char *DIR_GetStringPref(const cha
         return nullptr;
 
     nsCString value;
     nsAutoCString prefLocation(prefRoot);
 
     prefLocation.Append('.');
     prefLocation.Append(prefLeaf);
 
-    if (NS_SUCCEEDED(pPref->GetCharPref(prefLocation.get(), getter_Copies(value))))
+    if (NS_SUCCEEDED(pPref->GetCharPref(prefLocation.get(), value)))
     {
         /* unfortunately, there may be some prefs out there which look like this */
         if (value.EqualsLiteral("(null)"))
         {
             if (defaultValue)
                 value = defaultValue;
             else
                 value.Truncate();
         }
 
         if (value.IsEmpty())
         {
-          rv = pPref->GetCharPref(prefLocation.get(), getter_Copies(value));
+          rv = pPref->GetCharPref(prefLocation.get(), value);
         }
     }
     else
         value = defaultValue;
 
     return ToNewCString(value);
 }
 
@@ -820,41 +820,41 @@ static char *DIR_GetLocalizedStringPref(
 
   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));
 
-  char *value = nullptr;
+  nsCString value;
   if (!wvalue.IsEmpty())
   {
-    value = ToNewCString(NS_ConvertUTF16toUTF8(wvalue));
+    value = NS_ConvertUTF16toUTF8(wvalue);
   }
   else
   {
     // In TB 2 only some prefs had chrome:// URIs. We had code in place that would
     // only get the localized string pref for the particular address books that
     // were built-in.
     // Additionally, nsIPrefBranch::getComplexValue will only get a non-user-set,
     // non-locked pref value if it is a chrome:// URI and will get the string
     // value at that chrome URI. This breaks extensions/autoconfig that want to
     // set default pref values and allow users to change directory names.
     //
     // Now we have to support this, and so if for whatever reason we fail to get
     // the localized version, then we try and get the non-localized version
     // instead. If the string value is empty, then we'll just get the empty value
     // back here.
-    rv = pPref->GetCharPref(prefLocation.get(), &value);
+    rv = pPref->GetCharPref(prefLocation.get(), value);
     if (NS_FAILED(rv))
-      value = nullptr;
+      value.Truncate();
   }
 
-  return value;
+  return moz_xstrdup(value.get());
 }
 
 static int32_t DIR_GetIntPref(const char *prefRoot, const char *prefLeaf, int32_t defaultValue)
 {
   nsresult rv;
   nsCOMPtr<nsIPrefBranch> pPref(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
 
   if (NS_FAILED(rv))
@@ -1233,43 +1233,43 @@ static void DIR_SetStringPref(const char
     return;
 
   nsCString defaultPref;
   nsAutoCString prefLocation(prefRoot);
 
   prefLocation.Append('.');
   prefLocation.Append(prefLeaf);
 
-  if (NS_SUCCEEDED(pPref->GetCharPref(prefLocation.get(), getter_Copies(defaultPref))))
+  if (NS_SUCCEEDED(pPref->GetCharPref(prefLocation.get(), defaultPref)))
   {
     /* If there's a default pref, just set ours in and let libpref worry
      * about potential defaults in all.js
      */
     if (value) /* added this check to make sure we have a value before we try to set it..*/
-      rv = pPref->SetCharPref (prefLocation.get(), value);
+      rv = pPref->SetCharPref(prefLocation.get(), nsDependentCString(value));
     else
       rv = pPref->ClearUserPref(prefLocation.get());
   }
   else
   {
     /* If there's no default pref, look for a user pref, and only set our value in
      * if the user pref is different than one of them.
      */
     nsCString userPref;
-    if (NS_SUCCEEDED(pPref->GetCharPref (prefLocation.get(), getter_Copies(userPref))))
+    if (NS_SUCCEEDED(pPref->GetCharPref(prefLocation.get(), userPref)))
     {
       if (value && (defaultValue ? PL_strcasecmp(value, defaultValue) : value != defaultValue))
-        rv = pPref->SetCharPref (prefLocation.get(), value);
+        rv = pPref->SetCharPref(prefLocation.get(), nsDependentCString(value));
       else
         rv = pPref->ClearUserPref(prefLocation.get());
     }
     else
     {
       if (value && (defaultValue ? PL_strcasecmp(value, defaultValue) : value != defaultValue))
-        rv = pPref->SetCharPref (prefLocation.get(), value);
+        rv = pPref->SetCharPref(prefLocation.get(), nsDependentCString(value));
     }
   }
 
   NS_ASSERTION(NS_SUCCEEDED(rv), "Could not set pref in DIR_SetStringPref");
 }
 
 static void DIR_SetLocalizedStringPref
 (const char *prefRoot, const char *prefLeaf, const char *value)
--- a/mailnews/base/search/src/nsMsgSearchAdapter.cpp
+++ b/mailnews/base/search/src/nsMsgSearchAdapter.cpp
@@ -958,17 +958,17 @@ NS_IMETHODIMP nsMsgSearchValidityManager
   NS_ENSURE_ARG_POINTER(ppOutTable);
 
   nsresult rv;
   *ppOutTable = nullptr;
 
   nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
   nsCString customHeaders;
   if (NS_SUCCEEDED(rv))
-    pref->GetCharPref(PREF_CUSTOM_HEADERS, getter_Copies(customHeaders));
+    pref->GetCharPref(PREF_CUSTOM_HEADERS, customHeaders);
 
   switch (whichTable)
   {
   case nsMsgSearchScope::offlineMail:
     if (!m_offlineMailTable)
       rv = InitOfflineMailTable ();
     if (m_offlineMailTable)
       rv = SetOtherHeadersInTable(m_offlineMailTable, customHeaders.get());
--- a/mailnews/base/search/src/nsMsgSearchTerm.cpp
+++ b/mailnews/base/search/src/nsMsgSearchTerm.cpp
@@ -144,17 +144,17 @@ nsresult NS_MsgGetAttributeFromString(co
     nsCOMPtr<nsIPrefService> prefService = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsIPrefBranch> prefBranch;
     rv = prefService->GetBranch(nullptr, getter_AddRefs(prefBranch));
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCString headers;
-    prefBranch->GetCharPref(MAILNEWS_CUSTOM_HEADERS, getter_Copies(headers));
+    prefBranch->GetCharPref(MAILNEWS_CUSTOM_HEADERS, headers);
 
     if (!headers.IsEmpty())
     {
       nsAutoCString hdrStr(headers);
       hdrStr.StripWhitespace();  //remove whitespace before parsing
 
       char *newStr= hdrStr.BeginWriting();
       char *token = NS_strtok(":", &newStr);
--- a/mailnews/base/src/nsMsgAccount.cpp
+++ b/mailnews/base/src/nsMsgAccount.cpp
@@ -87,17 +87,17 @@ nsMsgAccount::createIncomingServer()
   //
   // ex) mail.account.myaccount.server = "myserver"
 
   nsresult rv = getPrefService();
   NS_ENSURE_SUCCESS(rv, rv);
 
   // get the "server" pref
   nsCString serverKey;
-  rv = m_prefs->GetCharPref("server", getter_Copies(serverKey));
+  rv = m_prefs->GetCharPref("server", serverKey);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // get the server from the account manager
   nsCOMPtr<nsIMsgAccountManager> accountManager =
            do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIMsgIncomingServer> server;
@@ -118,17 +118,17 @@ nsMsgAccount::SetIncomingServer(nsIMsgIn
   NS_ENSURE_ARG_POINTER(aIncomingServer);
 
   nsCString key;
   nsresult rv = aIncomingServer->GetKey(key);
 
   if (NS_SUCCEEDED(rv)) {
     rv = getPrefService();
     NS_ENSURE_SUCCESS(rv, rv);
-    m_prefs->SetCharPref("server", key.get());
+    m_prefs->SetCharPref("server", key);
   }
 
   m_incomingServer = aIncomingServer;
 
   bool serverValid;
   (void) aIncomingServer->GetValid(&serverValid);
   // only notify server loaded if server is valid so
   // account manager only gets told about finished accounts.
@@ -195,17 +195,17 @@ nsMsgAccount::createIdentities()
   nsresult rv;
   m_identities = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCString identityKey;
   rv = getPrefService();
   NS_ENSURE_SUCCESS(rv, rv);
 
-  m_prefs->GetCharPref("identities", getter_Copies(identityKey));
+  m_prefs->GetCharPref("identities", identityKey);
   if (identityKey.IsEmpty())    // not an error if no identities, but
     return NS_OK;               // strtok will be unhappy
   // get the server from the account manager
   nsCOMPtr<nsIMsgAccountManager> accountManager =
            do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   char* newStr = identityKey.BeginWriting();
@@ -294,17 +294,17 @@ nsMsgAccount::AddIdentity(nsIMsgIdentity
   // hack hack - need to add this to the list of identities.
   // for now just treat this as a Setxxx accessor
   // 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));
+    m_prefs->GetCharPref("identities", identityList);
 
     nsAutoCString newIdentityList(identityList);
 
     nsAutoCString testKey;      // temporary to strip whitespace
     bool foundIdentity = false; // if the input identity is found
 
     if (!identityList.IsEmpty()) {
       char *newStr = identityList.BeginWriting();
@@ -327,17 +327,17 @@ nsMsgAccount::AddIdentity(nsIMsgIdentity
       if (newIdentityList.IsEmpty())
         newIdentityList = key;
       else {
         newIdentityList.Append(',');
         newIdentityList.Append(key);
       }
     }
 
-    m_prefs->SetCharPref("identities", newIdentityList.get());
+    m_prefs->SetCharPref("identities", newIdentityList);
   }
 
   // now add it to the in-memory list
   return addIdentityInternal(identity);
 }
 
 /* void removeIdentity (in nsIMsgIdentity identity); */
 NS_IMETHODIMP
@@ -390,17 +390,17 @@ nsMsgAccount::saveIdentitiesPref()
       {
         newIdentityList.Append(',');
         newIdentityList.Append(key);
       }
     }
   }
 
   // Save the pref.
-  m_prefs->SetCharPref("identities", newIdentityList.get());
+  m_prefs->SetCharPref("identities", newIdentityList);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgAccount::GetKey(nsACString& accountKey)
 {
   accountKey = m_accountKey;
   return NS_OK;
--- a/mailnews/base/src/nsMsgAccountManager.cpp
+++ b/mailnews/base/src/nsMsgAccountManager.cpp
@@ -342,17 +342,17 @@ nsMsgAccountManager::GetUniqueServerKey(
     nsAutoCString type;
     nsAutoCString typeKey;
     for (uint32_t lastKey = 1; ; lastKey++)
     {
       aResult.AssignLiteral(SERVER_PREFIX);
       aResult.AppendInt(lastKey);
       typeKey.Assign(aResult);
       typeKey.AppendLiteral(".type");
-      prefBranchServer->GetCharPref(typeKey.get(), getter_Copies(type));
+      prefBranchServer->GetCharPref(typeKey.get(), 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.
@@ -437,17 +437,17 @@ nsMsgAccountManager::CreateIncomingServe
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoCString key;
   GetUniqueServerKey(key);
   rv = createKeyedServer(key, username, hostname, type, _retval);
   if (*_retval)
   {
     nsCString defaultStore;
-    m_prefs->GetCharPref("mail.serverDefaultStoreContractID", getter_Copies(defaultStore));
+    m_prefs->GetCharPref("mail.serverDefaultStoreContractID", defaultStore);
     (*_retval)->SetCharValue("storeContractID", defaultStore);
 
     // From when we first create the account until we have created some folders,
     // we can change the store type.
     (*_retval)->SetBoolValue("canChangeStoreType", true);
   }
   return rv;
 }
@@ -471,31 +471,31 @@ nsMsgAccountManager::GetIncomingServer(c
   // 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
   nsAutoCString serverPrefPrefix(PREF_MAIL_SERVER_PREFIX);
   serverPrefPrefix.Append(key);
 
   nsCString serverType;
   nsAutoCString serverPref (serverPrefPrefix);
   serverPref.AppendLiteral(".type");
-  rv = m_prefs->GetCharPref(serverPref.get(), getter_Copies(serverType));
+  rv = m_prefs->GetCharPref(serverPref.get(), serverType);
   NS_ENSURE_SUCCESS(rv, NS_ERROR_NOT_INITIALIZED);
 
   //
   // .userName
   serverPref = serverPrefPrefix;
   serverPref.AppendLiteral(".userName");
   nsCString username;
-  rv = m_prefs->GetCharPref(serverPref.get(), getter_Copies(username));
+  rv = m_prefs->GetCharPref(serverPref.get(), username);
 
   // .hostname
   serverPref = serverPrefPrefix;
   serverPref.AppendLiteral(".hostname");
   nsCString hostname;
-  rv = m_prefs->GetCharPref(serverPref.get(), getter_Copies(hostname));
+  rv = m_prefs->GetCharPref(serverPref.get(), hostname);
   NS_ENSURE_SUCCESS(rv, NS_ERROR_NOT_INITIALIZED);
 
   return createKeyedServer(key, username, hostname, serverType, _retval);
 }
 
 NS_IMETHODIMP
 nsMsgAccountManager::RemoveIncomingServer(nsIMsgIncomingServer *aServer,
                                           bool aRemoveFiles)
@@ -714,17 +714,17 @@ nsMsgAccountManager::OutputAccountsPref(
   for (uint32_t index = 0; index < m_accounts.Length(); index++)
   {
     m_accounts[index]->GetKey(accountKey);
     if (index)
       mAccountKeyList.Append(ACCOUNT_DELIMITER);
     mAccountKeyList.Append(accountKey);
   }
   return m_prefs->SetCharPref(PREF_MAIL_ACCOUNTMANAGER_ACCOUNTS,
-                                mAccountKeyList.get());
+                              mAccountKeyList);
 }
 
 /* get the default account. If no default account, pick the first account */
 NS_IMETHODIMP
 nsMsgAccountManager::GetDefaultAccount(nsIMsgAccount **aDefaultAccount)
 {
   NS_ENSURE_ARG_POINTER(aDefaultAccount);
 
@@ -734,17 +734,17 @@ nsMsgAccountManager::GetDefaultAccount(n
   if (!m_defaultAccount) {
     uint32_t count = m_accounts.Length();
     if (!count) {
       *aDefaultAccount = nullptr;
       return NS_ERROR_FAILURE;
     }
 
     nsCString defaultKey;
-    rv = m_prefs->GetCharPref(PREF_MAIL_ACCOUNTMANAGER_DEFAULTACCOUNT, getter_Copies(defaultKey));
+    rv = m_prefs->GetCharPref(PREF_MAIL_ACCOUNTMANAGER_DEFAULTACCOUNT, defaultKey);
 
     if (NS_SUCCEEDED(rv))
       rv = GetAccount(defaultKey, getter_AddRefs(m_defaultAccount));
 
     if (NS_FAILED(rv) || !m_defaultAccount) {
       nsCOMPtr<nsIMsgAccount> firstAccount;
       uint32_t index;
       bool foundValidDefaultAccount = false;
@@ -857,17 +857,17 @@ nsMsgAccountManager::setDefaultAccountPr
 {
   nsresult rv;
 
   if (aDefaultAccount) {
     nsCString key;
     rv = aDefaultAccount->GetKey(key);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    rv = m_prefs->SetCharPref(PREF_MAIL_ACCOUNTMANAGER_DEFAULTACCOUNT, key.get());
+    rv = m_prefs->SetCharPref(PREF_MAIL_ACCOUNTMANAGER_DEFAULTACCOUNT, key);
     NS_ENSURE_SUCCESS(rv,rv);
   }
   else
     m_prefs->ClearUserPref(PREF_MAIL_ACCOUNTMANAGER_DEFAULTACCOUNT);
 
   return NS_OK;
 }
 
@@ -1065,17 +1065,17 @@ nsMsgAccountManager::LoadAccounts()
   // Ensure messenger OS integration service has started
   // note, you can't expect the integrationService to be there
   // we don't have OS integration on all platforms.
   nsCOMPtr<nsIMessengerOSIntegration> integrationService =
            do_GetService(NS_MESSENGEROSINTEGRATION_CONTRACTID, &rv);
 
   // mail.accountmanager.accounts is the main entry point for all accounts
   nsCString accountList;
-  rv = m_prefs->GetCharPref(PREF_MAIL_ACCOUNTMANAGER_ACCOUNTS, getter_Copies(accountList));
+  rv = m_prefs->GetCharPref(PREF_MAIL_ACCOUNTMANAGER_ACCOUNTS, accountList);
 
   /**
    * Check to see if we need to add pre-configured accounts.
    * Following prefs are important to note in understanding the procedure here.
    *
    * 1. pref("mailnews.append_preconfig_accounts.version", version number);
    * This pref registers the current version in the user prefs file. A default value
    * is stored in mailnews.js file. If a given vendor needs to add more preconfigured
@@ -1104,17 +1104,17 @@ nsMsgAccountManager::LoadAccounts()
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Update the account list if needed
   if ((appendAccountsCurrentVersion <= appendAccountsDefaultVersion)) {
 
     // Get a list of pre-configured accounts
     nsCString appendAccountList;
     rv = m_prefs->GetCharPref(PREF_MAIL_ACCOUNTMANAGER_APPEND_ACCOUNTS,
-                              getter_Copies(appendAccountList));
+                              appendAccountList);
     appendAccountList.StripWhitespace();
 
     // If there are pre-configured accounts, we need to add them to the
     // existing list.
     if (!appendAccountList.IsEmpty())
     {
       if (!accountList.IsEmpty())
       {
@@ -1181,17 +1181,17 @@ nsMsgAccountManager::LoadAccounts()
 
     nsCOMPtr<nsIPrefBranch> accountPrefBranch;
     rv = prefservice->GetBranch(serverKeyPref.get(),
                                 getter_AddRefs(accountPrefBranch));
     NS_ENSURE_SUCCESS(rv,rv);
 
     serverKeyPref += ".server";
     nsCString serverKey;
-    rv = m_prefs->GetCharPref(serverKeyPref.get(), getter_Copies(serverKey));
+    rv = m_prefs->GetCharPref(serverKeyPref.get(), serverKey);
     if (NS_FAILED(rv))
       continue;
 
     nsCOMPtr<nsIMsgAccount> serverAccount;
     findAccountByServerKey(serverKey, getter_AddRefs(serverAccount));
     // If we have an existing account with the same server, ignore this account
     if (serverAccount)
       continue;
@@ -1310,35 +1310,35 @@ nsMsgAccountManager::LoadAccounts()
               continue;
             }
             nsCOMPtr<nsIPrefBranch> prefBranch(
               do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
             if (NS_FAILED(rv)) {
               continue;
             }
             rv = prefBranch->GetCharPref(accountPref.get(),
-                                         getter_Copies(dupAccountServerKey));
+                                         dupAccountServerKey);
             if (NS_FAILED(rv)) {
               continue;
             }
             nsCOMPtr<nsIPrefBranch> serverPrefBranch;
             nsCString serverKeyPref(PREF_MAIL_SERVER_PREFIX);
             serverKeyPref.Append(dupAccountServerKey);
             serverKeyPref.Append('.');
             rv = prefservice->GetBranch(serverKeyPref.get(),
                                         getter_AddRefs(serverPrefBranch));
             if (NS_FAILED(rv)) {
               continue;
             }
             nsCString userName;
             nsCString hostName;
             nsCString type;
-            serverPrefBranch->GetCharPref("userName", getter_Copies(userName));
-            serverPrefBranch->GetCharPref("hostname", getter_Copies(hostName));
-            serverPrefBranch->GetCharPref("type", getter_Copies(type));
+            serverPrefBranch->GetCharPref("userName", userName);
+            serverPrefBranch->GetCharPref("hostname", hostName);
+            serverPrefBranch->GetCharPref("type", type);
             // Find a server with the same info.
             nsCOMPtr<nsIMsgAccountManager> accountManager =
                      do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
             if (NS_FAILED(rv)) {
               continue;
             }
             nsCOMPtr<nsIMsgIncomingServer> server;
             accountManager->FindServer(userName, hostName, type,
@@ -1373,17 +1373,17 @@ nsMsgAccountManager::LoadAccounts()
                                 getter_AddRefs(accountPrefBranch));
     if (accountPrefBranch)
       accountPrefBranch->DeleteBranch("");
   }
 
   // Make sure we have an account that points at the local folders server
   nsCString localFoldersServerKey;
   rv = m_prefs->GetCharPref(PREF_MAIL_ACCOUNTMANAGER_LOCALFOLDERSSERVER,
-                            getter_Copies(localFoldersServerKey));
+                            localFoldersServerKey);
 
   if (!localFoldersServerKey.IsEmpty())
   {
     nsCOMPtr<nsIMsgIncomingServer> server;
     rv = GetIncomingServer(localFoldersServerKey, getter_AddRefs(server));
     if (server)
     {
       nsCOMPtr<nsIMsgAccount> localFoldersAccount;
@@ -1729,17 +1729,17 @@ nsMsgAccountManager::createKeyedAccount(
   // add to string list
   if (mAccountKeyList.IsEmpty())
     mAccountKeyList = key;
   else {
     mAccountKeyList.Append(',');
     mAccountKeyList.Append(key);
   }
 
-  m_prefs->SetCharPref(PREF_MAIL_ACCOUNTMANAGER_ACCOUNTS, mAccountKeyList.get());
+  m_prefs->SetCharPref(PREF_MAIL_ACCOUNTMANAGER_ACCOUNTS, mAccountKeyList);
   account.forget(aAccount);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgAccountManager::CreateAccount(nsIMsgAccount **_retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
@@ -2227,26 +2227,26 @@ nsMsgAccountManager::RemoveRootFolderLis
 
 NS_IMETHODIMP nsMsgAccountManager::SetLocalFoldersServer(nsIMsgIncomingServer *aServer)
 {
   NS_ENSURE_ARG_POINTER(aServer);
   nsCString key;
   nsresult rv = aServer->GetKey(key);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  return m_prefs->SetCharPref(PREF_MAIL_ACCOUNTMANAGER_LOCALFOLDERSSERVER, key.get());
+  return m_prefs->SetCharPref(PREF_MAIL_ACCOUNTMANAGER_LOCALFOLDERSSERVER, key);
 }
 
 NS_IMETHODIMP nsMsgAccountManager::GetLocalFoldersServer(nsIMsgIncomingServer **aServer)
 {
   NS_ENSURE_ARG_POINTER(aServer);
 
   nsCString serverKey;
 
-  nsresult rv = m_prefs->GetCharPref(PREF_MAIL_ACCOUNTMANAGER_LOCALFOLDERSSERVER, getter_Copies(serverKey));
+  nsresult rv = m_prefs->GetCharPref(PREF_MAIL_ACCOUNTMANAGER_LOCALFOLDERSSERVER, serverKey);
 
   if (NS_SUCCEEDED(rv) && !serverKey.IsEmpty())
   {
     rv = GetIncomingServer(serverKey, aServer);
     if (NS_SUCCEEDED(rv))
       return rv;
     // otherwise, we're going to fall through to looking for an existing local
     // folders account, because now we fail creating one if one already exists.
--- a/mailnews/base/src/nsMsgContentPolicy.cpp
+++ b/mailnews/base/src/nsMsgContentPolicy.cpp
@@ -68,17 +68,17 @@ nsresult nsMsgContentPolicy::Init()
   nsresult rv;
 
   // register ourself as an observer on the mail preference to block remote images
   nsCOMPtr<nsIPrefBranch> prefInternal = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   prefInternal->AddObserver(kBlockRemoteImages, this, true);
 
-  prefInternal->GetCharPref(kTrustedDomains, getter_Copies(mTrustedMailDomains));
+  prefInternal->GetCharPref(kTrustedDomains, mTrustedMailDomains);
   prefInternal->GetBoolPref(kBlockRemoteImages, &mBlockRemoteImages);
 
   // Grab a handle on the PermissionManager service for managing allowed remote
   // content senders.
   mPermissionManager = do_GetService(NS_PERMISSIONMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_OK;
--- a/mailnews/base/src/nsMsgTagService.cpp
+++ b/mailnews/base/src/nsMsgTagService.cpp
@@ -273,61 +273,61 @@ NS_IMETHODIMP nsMsgTagService::AddTag(co
 /* long getColorForKey (in string key); */
 NS_IMETHODIMP nsMsgTagService::GetColorForKey(const nsACString &key, nsACString  &_retval)
 {
   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));
+  nsresult rv = m_tagPrefBranch->GetCharPref(prefName.get(), 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)
 {
   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());
+  return m_tagPrefBranch->SetCharPref(prefName.get(), color);
 }
 
 /* ACString getOrdinalForKey (in ACString key); */
 NS_IMETHODIMP nsMsgTagService::GetOrdinalForKey(const nsACString & key, nsACString & _retval)
 {
   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));
+  nsresult rv = m_tagPrefBranch->GetCharPref(prefName.get(), ordinal);
   _retval = ordinal;
   return rv;
 }
 
 /* void setOrdinalForKey (in ACString key, in ACString ordinal); */
 NS_IMETHODIMP nsMsgTagService::SetOrdinalForKey(const nsACString & key, const nsACString & ordinal)
 {
   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());
+  return m_tagPrefBranch->SetCharPref(prefName.get(), ordinal);
 }
 
 /* void deleteTag (in wstring tag); */
 NS_IMETHODIMP nsMsgTagService::DeleteKey(const nsACString &key)
 {
   // clear the associated prefs
   nsAutoCString prefName(key);
   if (!gMigratingKeys)
@@ -508,17 +508,17 @@ nsresult nsMsgTagService::MigrateLabelsT
                                      NS_GET_IID(nsIPrefLocalizedString),
                                      getter_AddRefs(pls));
       NS_ENSURE_SUCCESS(rv, rv);
       pls->ToString(getter_Copies(ucsval));
 
       prefString.Assign(PREF_LABELS_COLOR);
       prefString.AppendInt(i + 1);
       nsCString csval;
-      rv = prefRoot->GetCharPref(prefString.get(), getter_Copies(csval));
+      rv = prefRoot->GetCharPref(prefString.get(), csval);
       NS_ENSURE_SUCCESS(rv, rv);
 
       rv = AddTagForKey(labelKey, ucsval, csval, EmptyCString());
       NS_ENSURE_SUCCESS(rv, rv);
       labelKey.SetCharAt(++i + '1', 6);
     }
   }
   m_tagPrefBranch->SetIntPref(TAG_PREF_VERSION, 2);
--- a/mailnews/base/src/nsSpamSettings.cpp
+++ b/mailnews/base/src/nsSpamSettings.cpp
@@ -305,18 +305,17 @@ NS_IMETHODIMP nsSpamSettings::Initialize
   int32_t serverFilterTrustFlags = 0;
   rv = aServer->GetIntValue("serverFilterTrustFlags", &serverFilterTrustFlags);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = SetServerFilterTrustFlags(serverFilterTrustFlags);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
   if (prefBranch)
-    prefBranch->GetCharPref("mail.trusteddomains",
-                            getter_Copies(mTrustedMailDomains));
+    prefBranch->GetCharPref("mail.trusteddomains", mTrustedMailDomains);
 
   mWhiteListDirArray.Clear();
   if (!mWhiteListAbURI.IsEmpty())
   {
     nsCOMPtr<nsIAbManager> abManager(do_GetService(NS_ABMANAGER_CONTRACTID, &rv));
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsTArray<nsCString> whiteListArray;
--- a/mailnews/base/src/nsStatusBarBiffManager.cpp
+++ b/mailnews/base/src/nsStatusBarBiffManager.cpp
@@ -108,17 +108,17 @@ nsresult nsStatusBarBiffManager::PlayBif
   int32_t soundType = SYSTEM_SOUND_TYPE;
   rv = pref->GetIntPref(PREF_SOUND_TYPE, &soundType);
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool customSoundPlayed = false;
 
   if (soundType == CUSTOM_SOUND_TYPE) {
     nsCString soundURLSpec;
-    rv = pref->GetCharPref(PREF_SOUND_URL, getter_Copies(soundURLSpec));
+    rv = pref->GetCharPref(PREF_SOUND_URL, soundURLSpec);
 
     if (NS_SUCCEEDED(rv) && !soundURLSpec.IsEmpty()) {
       if (!strncmp(soundURLSpec.get(), "file://", 7)) {
         nsCOMPtr<nsIURI> fileURI;
         rv = NS_NewURI(getter_AddRefs(fileURI), soundURLSpec);
         NS_ENSURE_SUCCESS(rv,rv);
         nsCOMPtr<nsIFileURL> soundURL = do_QueryInterface(fileURI,&rv);
         if (NS_SUCCEEDED(rv)) {
--- a/mailnews/base/util/nsMsgIdentity.cpp
+++ b/mailnews/base/util/nsMsgIdentity.cpp
@@ -221,17 +221,17 @@ nsMsgIdentity::SetDoBcc(bool aValue)
 
 NS_IMETHODIMP
 nsMsgIdentity::GetDoBccList(nsACString& aValue)
 {
   if (!mPrefBranch)
     return NS_ERROR_NOT_INITIALIZED;
 
   nsCString val;
-  nsresult rv = mPrefBranch->GetCharPref("doBccList", getter_Copies(val));
+  nsresult rv = mPrefBranch->GetCharPref("doBccList", val);
   aValue = val;
   if (NS_SUCCEEDED(rv))
     return rv;
 
   bool bccSelf = false;
   rv = GetBccSelf(&bccSelf);
   NS_ENSURE_SUCCESS(rv,rv);
 
@@ -278,17 +278,17 @@ NS_IMPL_IDPREF_BOOL(Valid, "valid")
 
 nsresult
 nsMsgIdentity::getFolderPref(const char *prefname, nsCString& retval,
                              const char *folderName, uint32_t folderflag)
 {
   if (!mPrefBranch)
     return NS_ERROR_NOT_INITIALIZED;
 
-  nsresult rv = mPrefBranch->GetCharPref(prefname, getter_Copies(retval));
+  nsresult rv = mPrefBranch->GetCharPref(prefname, retval);
   if (NS_SUCCEEDED(rv) && !retval.IsEmpty()) {
     // get the corresponding RDF resource
     // RDF will create the folder resource if it doesn't already exist
     nsCOMPtr<nsIRDFService> rdf(do_GetService(kRDFServiceCID, &rv));
     if (NS_FAILED(rv)) return rv;
     nsCOMPtr<nsIRDFResource> resource;
     rdf->GetResource(retval, getter_AddRefs(resource));
 
@@ -313,17 +313,17 @@ nsMsgIdentity::getFolderPref(const char 
           rv = server->GetMsgFolderFromURI(folderResource, retval, getter_AddRefs(msgFolder));
           return NS_SUCCEEDED(rv) ? msgFolder->GetURI(retval) : rv;
         }
       }
     }
   }
 
   // if the server doesn't exist, fall back to the default pref.
-  rv = mDefPrefBranch->GetCharPref(prefname, getter_Copies(retval));
+  rv = mDefPrefBranch->GetCharPref(prefname, retval);
   if (NS_SUCCEEDED(rv) && !retval.IsEmpty())
     return setFolderPref(prefname, retval, folderflag);
 
   // here I think we need to create a uri for the folder on the
   // default server for this identity.
   nsCOMPtr<nsIMsgAccountManager> accountManager =
   do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv,rv);
@@ -390,17 +390,17 @@ nsMsgIdentity::setFolderPref(const char 
     {
       nsCOMPtr<nsIMsgIncomingServer> server(do_QueryElementAt(servers, 0, &rv));
       if (NS_SUCCEEDED(rv))
         server->ClearTemporaryReturnReceiptsFilter(); // okay to fail; no need to check for return code
     }
   }
 
   // get the old folder, and clear the special folder flag on it
-  rv = mPrefBranch->GetCharPref(prefname, getter_Copies(oldpref));
+  rv = mPrefBranch->GetCharPref(prefname, oldpref);
   if (NS_SUCCEEDED(rv) && !oldpref.IsEmpty())
   {
     rv = rdf->GetResource(oldpref, getter_AddRefs(res));
     if (NS_SUCCEEDED(rv) && res)
     {
       folder = do_QueryInterface(res, &rv);
       if (NS_SUCCEEDED(rv))
         rv = folder->ClearFlag(folderflag);
@@ -466,30 +466,30 @@ NS_IMETHODIMP nsMsgIdentity::GetUnicharA
 }
 
 NS_IMETHODIMP nsMsgIdentity::SetCharAttribute(const char *aName, const nsACString& val)
 {
   if (!mPrefBranch)
     return NS_ERROR_NOT_INITIALIZED;
 
   if (!val.IsEmpty())
-    return mPrefBranch->SetCharPref(aName, nsCString(val).get());
+    return mPrefBranch->SetCharPref(aName, val);
 
   mPrefBranch->ClearUserPref(aName);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgIdentity::GetCharAttribute(const char *aName, nsACString& val)
 {
   if (!mPrefBranch)
     return NS_ERROR_NOT_INITIALIZED;
 
   nsCString tmpVal;
-  if (NS_FAILED(mPrefBranch->GetCharPref(aName, getter_Copies(tmpVal))))
-    mDefPrefBranch->GetCharPref(aName, getter_Copies(tmpVal));
+  if (NS_FAILED(mPrefBranch->GetCharPref(aName, tmpVal)))
+    mDefPrefBranch->GetCharPref(aName, tmpVal);
   val = tmpVal;
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgIdentity::SetBoolAttribute(const char *aName, bool val)
 {
   if (!mPrefBranch)
     return NS_ERROR_NOT_INITIALIZED;
--- a/mailnews/base/util/nsMsgIncomingServer.cpp
+++ b/mailnews/base/util/nsMsgIncomingServer.cpp
@@ -504,18 +504,18 @@ nsMsgIncomingServer::SetIntValue(const c
 NS_IMETHODIMP
 nsMsgIncomingServer::GetCharValue(const char *prefname,
                                   nsACString& val)
 {
   if (!mPrefBranch)
     return NS_ERROR_NOT_INITIALIZED;
 
   nsCString tmpVal;
-  if (NS_FAILED(mPrefBranch->GetCharPref(prefname, getter_Copies(tmpVal))))
-    mDefPrefBranch->GetCharPref(prefname, getter_Copies(tmpVal));
+  if (NS_FAILED(mPrefBranch->GetCharPref(prefname, tmpVal)))
+    mDefPrefBranch->GetCharPref(prefname, tmpVal);
   val = tmpVal;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgIncomingServer::GetUnicharValue(const char *prefname,
                                      nsAString& val)
 {
@@ -544,22 +544,22 @@ nsMsgIncomingServer::SetCharValue(const 
     return NS_ERROR_NOT_INITIALIZED;
 
   if (val.IsEmpty()) {
     mPrefBranch->ClearUserPref(prefname);
     return NS_OK;
   }
 
   nsCString defaultVal;
-  nsresult rv = mDefPrefBranch->GetCharPref(prefname, getter_Copies(defaultVal));
+  nsresult rv = mDefPrefBranch->GetCharPref(prefname, defaultVal);
 
   if (NS_SUCCEEDED(rv) && defaultVal.Equals(val))
     mPrefBranch->ClearUserPref(prefname);
   else
-    rv = mPrefBranch->SetCharPref(prefname, nsCString(val).get());
+    rv = mPrefBranch->SetCharPref(prefname, val);
 
   return rv;
 }
 
 NS_IMETHODIMP
 nsMsgIncomingServer::SetUnicharValue(const char *prefname,
                                      const nsAString& val)
 {
--- a/mailnews/compose/public/nsISmtpServer.idl
+++ b/mailnews/compose/public/nsISmtpServer.idl
@@ -68,17 +68,17 @@ interface nsISmtpServer : nsISupports {
 
   /**
    * May contain an alternative argument to EHLO or HELO to provide to the
    * server. Reflects the value of the mail.smtpserver.*.hello_argument pref.
    * This is mainly useful where ISPs don't bother providing PTR records for
    * their servers and therefore users get an error on sending. See bug 244030
    * for more discussion.
    */
-  readonly attribute string helloArgument;
+  readonly attribute ACString helloArgument;
 
   /// Returns the URI of the server (smtp:///)
   readonly attribute ACString serverURI;
 
   /**
    * Gets a password for this server, using a UI prompt if necessary.
    *
    * @param promptString  The string to prompt the user with when asking for
--- a/mailnews/compose/src/nsMsgCompUtils.cpp
+++ b/mailnews/compose/src/nsMsgCompUtils.cpp
@@ -1736,26 +1736,26 @@ GetFolderURIFromUserPrefs(nsMsgDeliverMo
 
   // QueueForLater (Outbox)
   if (aMode == nsIMsgSend::nsMsgQueueForLater ||
       aMode == nsIMsgSend::nsMsgDeliverBackground)
   {
     nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
     if (NS_FAILED(rv))
       return;
-    rv = prefs->GetCharPref("mail.default_sendlater_uri", getter_Copies(uri));
+    rv = prefs->GetCharPref("mail.default_sendlater_uri", uri);
     if (NS_FAILED(rv) || uri.IsEmpty())
       uri.AssignLiteral(ANY_SERVER);
     else
     {
       // check if uri is unescaped, and if so, escape it and reset the pef.
       if (uri.FindChar(' ') != kNotFound)
       {
         MsgReplaceSubstring(uri, " ", "%20");
-        prefs->SetCharPref("mail.default_sendlater_uri", uri.get());
+        prefs->SetCharPref("mail.default_sendlater_uri", uri);
       }
     }
     return;
   }
 
   if (!identity)
     return;
 
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -2189,17 +2189,17 @@ nsresult nsMsgCompose::CreateMessage(con
               attachment->SetName(sanitizedSubj);
               attachment->SetUrl(nsDependentCString(uri));
               m_compFields->AddAttachment(attachment);
             }
 
             if (isFirstPass)
             {
               nsCString fwdPrefix;
-              prefs->GetCharPref("mail.forward_subject_prefix", getter_Copies(fwdPrefix));
+              prefs->GetCharPref("mail.forward_subject_prefix", fwdPrefix);
               if (!fwdPrefix.IsEmpty())
               {
                 nsString unicodeFwdPrefix;
                 CopyUTF8toUTF16(fwdPrefix, unicodeFwdPrefix);
                 unicodeFwdPrefix.AppendLiteral(": ");
                 subject.Insert(unicodeFwdPrefix, 0);
               }
               else
--- a/mailnews/compose/src/nsMsgComposeService.cpp
+++ b/mailnews/compose/src/nsMsgComposeService.cpp
@@ -277,17 +277,17 @@ nsMsgComposeService::GetOrigWindowSelect
   NS_ENSURE_TRUE(domWindow, NS_ERROR_FAILURE);
   nsCOMPtr<nsPIDOMWindowOuter> privateWindow = nsPIDOMWindowOuter::From(domWindow);
   nsCOMPtr<nsISelection> sel = privateWindow->GetSelection();
   NS_ENSURE_TRUE(sel, NS_ERROR_FAILURE);
 
   bool requireMultipleWords = true;
   nsAutoCString charsOnlyIf;
   prefs->GetBoolPref(PREF_MAILNEWS_REPLY_QUOTING_SELECTION_MULTI_WORD, &requireMultipleWords);
-  prefs->GetCharPref(PREF_MAILNEWS_REPLY_QUOTING_SELECTION_ONLY_IF, getter_Copies(charsOnlyIf));
+  prefs->GetCharPref(PREF_MAILNEWS_REPLY_QUOTING_SELECTION_ONLY_IF, charsOnlyIf);
   if (sel && (requireMultipleWords || !charsOnlyIf.IsEmpty()))
   {
     nsAutoString selPlain;
     rv = sel->ToString(selPlain);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // If "mailnews.reply_quoting_selection.multi_word" is on, then there must be at least
     // two words selected in order to quote just the selected text
@@ -1115,33 +1115,33 @@ nsresult nsMsgComposeService::AddGlobalH
 
   rv = defaultsPrefBranch->GetIntPref(HTMLDOMAINUPDATE_VERSION_PREF_NAME, &htmlDomainListDefaultVersion);
   NS_ENSURE_SUCCESS(rv,rv);
 
   // Update the list as needed
   if (htmlDomainListCurrentVersion <= htmlDomainListDefaultVersion) {
     // Get list of global domains need to be added
     nsCString globalHtmlDomainList;
-    rv = prefBranch->GetCharPref(HTMLDOMAINUPDATE_DOMAINLIST_PREF_NAME, getter_Copies(globalHtmlDomainList));
+    rv = prefBranch->GetCharPref(HTMLDOMAINUPDATE_DOMAINLIST_PREF_NAME, globalHtmlDomainList);
 
     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));
+      rv = prefBranch->GetCharPref(USER_CURRENT_HTMLDOMAINLIST_PREF_NAME, currentHtmlDomainList);
       NS_ENSURE_SUCCESS(rv,rv);
 
       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));
+      rv = prefBranch->GetCharPref(USER_CURRENT_PLAINTEXTDOMAINLIST_PREF_NAME, currentPlaintextDomainList);
       NS_ENSURE_SUCCESS(rv,rv);
 
       // Get the current plaintext domain list into new list var
       ParseString(currentPlaintextDomainList, DOMAIN_DELIMITER, domainArray);
 
       size_t i = domainArray.Length();
       if (i > 0) {
         // Append each domain in the preconfigured html domain list
@@ -1161,17 +1161,17 @@ nsresult nsMsgComposeService::AddGlobalH
       else
       {
         // User has no domains listed either in html or plain text category.
         // Assign the global list to be the user's current html domain list
         newHtmlDomainList = globalHtmlDomainList;
       }
 
       // Set user's html domain pref with the updated list
-      rv = prefBranch->SetCharPref(USER_CURRENT_HTMLDOMAINLIST_PREF_NAME, newHtmlDomainList.get());
+      rv = prefBranch->SetCharPref(USER_CURRENT_HTMLDOMAINLIST_PREF_NAME, newHtmlDomainList);
       NS_ENSURE_SUCCESS(rv,rv);
 
       // Increase the version to avoid running the update code unless needed (based on default version)
       rv = prefBranch->SetIntPref(HTMLDOMAINUPDATE_VERSION_PREF_NAME, htmlDomainListCurrentVersion + 1);
       NS_ENSURE_SUCCESS(rv,rv);
     }
   }
   return NS_OK;
--- a/mailnews/compose/src/nsSmtpProtocol.cpp
+++ b/mailnews/compose/src/nsSmtpProtocol.cpp
@@ -283,17 +283,17 @@ nsresult nsSmtpProtocol::Initialize(nsIU
     // ** may want to consider caching the server capability to save lots of
     // round trip communication between the client and server
     int32_t authMethod = 0;
     nsCOMPtr<nsISmtpServer> smtpServer;
     m_runningURL->GetSmtpServer(getter_AddRefs(smtpServer));
     if (smtpServer) {
         smtpServer->GetAuthMethod(&authMethod);
         smtpServer->GetSocketType(&m_prefSocketType);
-        smtpServer->GetHelloArgument(getter_Copies(m_helloArgument));
+        smtpServer->GetHelloArgument(m_helloArgument);
 
         // Query for OAuth2 support. If the SMTP server preferences don't allow
         // for OAuth2, then don't carry around the OAuth2 module any longer
         // since we won't need it.
         mOAuth2Support = do_CreateInstance(MSGIOAUTH2MODULE_CONTRACTID);
         if (mOAuth2Support)
         {
           bool supportsOAuth = false;
--- a/mailnews/compose/src/nsSmtpServer.cpp
+++ b/mailnews/compose/src/nsSmtpServer.cpp
@@ -80,51 +80,51 @@ nsresult nsSmtpServer::getPrefs()
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSmtpServer::GetHostname(nsACString &aHostname)
 {
   nsCString result;
-  nsresult rv = mPrefBranch->GetCharPref("hostname", getter_Copies(result));
+  nsresult rv = mPrefBranch->GetCharPref("hostname", result);
   if (NS_FAILED(rv))
     aHostname.Truncate();
   else
     aHostname = result;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSmtpServer::SetHostname(const nsACString &aHostname)
 {
   if (!aHostname.IsEmpty())
-    return mPrefBranch->SetCharPref("hostname", PromiseFlatCString(aHostname).get());
+    return mPrefBranch->SetCharPref("hostname", aHostname);
 
   // If the pref value is already empty, ClearUserPref will return
   // NS_ERROR_UNEXPECTED, so don't check the rv here.
   mPrefBranch->ClearUserPref("hostname");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSmtpServer::GetDescription(nsACString &aDescription)
 {
     nsCString temp;
-    mPrefBranch->GetCharPref("description", getter_Copies(temp));
+    mPrefBranch->GetCharPref("description", temp);
     aDescription.Assign(temp);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSmtpServer::SetDescription(const nsACString &aDescription)
 {
     if (!aDescription.IsEmpty())
-        return mPrefBranch->SetCharPref("description", PromiseFlatCString(aDescription).get());
+        return mPrefBranch->SetCharPref("description", aDescription);
     else
         mPrefBranch->ClearUserPref("description");
     return NS_OK;
 }
 
 // if GetPort returns 0, it means default port
 NS_IMETHODIMP
 nsSmtpServer::GetPort(int32_t *aPort)
@@ -147,17 +147,17 @@ nsSmtpServer::SetPort(int32_t aPort)
 
 NS_IMETHODIMP
 nsSmtpServer::GetDisplayname(char * *aDisplayname)
 {
     nsresult rv;
     NS_ENSURE_ARG_POINTER(aDisplayname);
 
     nsCString hostname;
-    rv = mPrefBranch->GetCharPref("hostname", getter_Copies(hostname));
+    rv = mPrefBranch->GetCharPref("hostname", hostname);
     if (NS_FAILED(rv)) {
         *aDisplayname=nullptr;
         return NS_OK;
     }
     int32_t port;
     rv = mPrefBranch->GetIntPref("port", &port);
     if (NS_FAILED(rv))
         port = 0;
@@ -181,26 +181,25 @@ nsSmtpServer::GetSocketType(int32_t *soc
 
 NS_IMETHODIMP
 nsSmtpServer::SetSocketType(int32_t socketType)
 {
     return mPrefBranch->SetIntPref("try_ssl", socketType);
 }
 
 NS_IMETHODIMP
-nsSmtpServer::GetHelloArgument(char * *aHelloArgument)
+nsSmtpServer::GetHelloArgument(nsACString& aHelloArgument)
 {
     nsresult rv;
-    NS_ENSURE_ARG_POINTER(aHelloArgument);
     rv = mPrefBranch->GetCharPref("hello_argument", aHelloArgument);
     if (NS_FAILED(rv))
     {
         rv = mDefPrefBranch->GetCharPref("hello_argument", aHelloArgument);
         if (NS_FAILED(rv))
-            *aHelloArgument = nullptr;
+            aHelloArgument.Truncate();
     }
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSmtpServer::GetAuthMethod(int32_t *authMethod)
 {
   NS_ENSURE_ARG_POINTER(authMethod);
@@ -228,29 +227,29 @@ nsSmtpServer::SetAuthMethod(int32_t auth
 {
     return mPrefBranch->SetIntPref("authMethod", authMethod);
 }
 
 NS_IMETHODIMP
 nsSmtpServer::GetUsername(nsACString &aUsername)
 {
   nsCString result;
-  nsresult rv = mPrefBranch->GetCharPref("username", getter_Copies(result));
+  nsresult rv = mPrefBranch->GetCharPref("username", result);
   if (NS_FAILED(rv))
     aUsername.Truncate();
   else
     aUsername = result;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSmtpServer::SetUsername(const nsACString &aUsername)
 {
   if (!aUsername.IsEmpty())
-    return mPrefBranch->SetCharPref("username", PromiseFlatCString(aUsername).get());
+    return mPrefBranch->SetCharPref("username", aUsername);
 
   // If the pref value is already empty, ClearUserPref will return
   // NS_ERROR_UNEXPECTED, so don't check the rv here.
   mPrefBranch->ClearUserPref("username");
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -271,17 +270,17 @@ nsSmtpServer::GetPassword(nsAString& aPa
       // if this is set, and we don't find an exact match of user and host name,
       // we'll accept a match of username and domain, where domain
       // is everything after the first '.'
       // user_pref("mail.smtp.useMatchingDomainServer", true);
 
       nsCString accountKey;
       bool useMatchingHostNameServer = false;
       bool useMatchingDomainServer = false;
-      mPrefBranch->GetCharPref("incomingAccount", getter_Copies(accountKey));
+      mPrefBranch->GetCharPref("incomingAccount", accountKey);
 
       nsCOMPtr<nsIMsgAccountManager> accountManager = do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID);
       nsCOMPtr<nsIMsgIncomingServer> incomingServerToUse;
       if (accountManager)
       {
         if (!accountKey.IsEmpty())
           accountManager->GetIncomingServer(accountKey, getter_AddRefs(incomingServerToUse));
         else
--- a/mailnews/compose/src/nsSmtpService.cpp
+++ b/mailnews/compose/src/nsSmtpService.cpp
@@ -391,17 +391,17 @@ nsSmtpService::loadSmtpServers()
   if (NS_FAILED(rv))
     return rv;
   nsCOMPtr<nsIPrefBranch> prefRootBranch;
   prefService->GetBranch(nullptr, getter_AddRefs(prefRootBranch));
   if (NS_FAILED(rv))
     return rv;
 
   nsCString serverList;
-  rv = prefRootBranch->GetCharPref(PREF_MAIL_SMTPSERVERS, getter_Copies(serverList));
+  rv = prefRootBranch->GetCharPref(PREF_MAIL_SMTPSERVERS, serverList);
   serverList.StripWhitespace();
 
   nsTArray<nsCString> servers;
   ParseString(serverList, SERVER_DELIMITER, servers);
 
   /**
    * Check to see if we need to add pre-configured smtp servers.
    * Following prefs are important to note in understanding the procedure here.
@@ -432,17 +432,17 @@ nsSmtpService::loadSmtpServers()
 
   rv = defaultsPrefBranch->GetIntPref(APPEND_SERVERS_VERSION_PREF_NAME, &appendSmtpServersDefaultVersion);
   NS_ENSURE_SUCCESS(rv,rv);
 
   // Update the smtp server list if needed
   if (appendSmtpServersCurrentVersion <= appendSmtpServersDefaultVersion) {
     // If there are pre-configured servers, add them to the existing server list
     nsCString appendServerList;
-    rv = prefRootBranch->GetCharPref(PREF_MAIL_SMTPSERVERS_APPEND_SERVERS, getter_Copies(appendServerList));
+    rv = prefRootBranch->GetCharPref(PREF_MAIL_SMTPSERVERS_APPEND_SERVERS, appendServerList);
     appendServerList.StripWhitespace();
     ParseString(appendServerList, SERVER_DELIMITER, servers);
 
     // Increase the version number so that updates will happen as and when needed
     prefBranch->SetIntPref(APPEND_SERVERS_VERSION_PREF_NAME, appendSmtpServersCurrentVersion + 1);
   }
 
   // use GetServerByKey to check if the key (pref) is already in
@@ -462,17 +462,17 @@ nsSmtpService::loadSmtpServers()
 // save the list of keys
 nsresult
 nsSmtpService::saveKeyList()
 {
     nsresult rv;
     nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
     if (NS_FAILED(rv)) return rv;
 
-    return prefBranch->SetCharPref(PREF_MAIL_SMTPSERVERS, mServerKeyList.get());
+    return prefBranch->SetCharPref(PREF_MAIL_SMTPSERVERS, mServerKeyList);
 }
 
 nsresult
 nsSmtpService::createKeyedServer(const char *key, nsISmtpServer** aResult)
 {
     if (!key) return NS_ERROR_NULL_POINTER;
 
     nsresult rv;
@@ -525,17 +525,17 @@ nsSmtpService::GetDefaultServer(nsISmtpS
   // always returns NS_OK, just leaving *aServer at nullptr
   if (!mDefaultSmtpServer) {
       nsresult rv;
       nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
       if (NS_FAILED(rv)) return rv;
 
       // try to get it from the prefs
       nsCString defaultServerKey;
-      rv = prefBranch->GetCharPref(PREF_MAIL_SMTP_DEFAULTSERVER, getter_Copies(defaultServerKey));
+      rv = prefBranch->GetCharPref(PREF_MAIL_SMTP_DEFAULTSERVER, defaultServerKey);
       if (NS_SUCCEEDED(rv) &&
           !defaultServerKey.IsEmpty()) {
 
           nsCOMPtr<nsISmtpServer> server;
           rv = GetServerByKey(defaultServerKey.get(),
                               getter_AddRefs(mDefaultSmtpServer));
       } else {
         // no pref set, so just return the first one, and set the pref
@@ -551,17 +551,17 @@ nsSmtpService::GetDefaultServer(nsISmtpS
 
         mDefaultSmtpServer = mSmtpServers[0];
         NS_ENSURE_TRUE(mDefaultSmtpServer, NS_ERROR_NULL_POINTER);
 
         // now we have a default server, set the prefs correctly
         nsCString serverKey;
         mDefaultSmtpServer->GetKey(getter_Copies(serverKey));
         if (NS_SUCCEEDED(rv))
-          prefBranch->SetCharPref(PREF_MAIL_SMTP_DEFAULTSERVER, serverKey.get());
+          prefBranch->SetCharPref(PREF_MAIL_SMTP_DEFAULTSERVER, serverKey);
       }
   }
 
   // at this point:
   // * mDefaultSmtpServer has a valid server
   // * the key has been set in the prefs
 
   NS_IF_ADDREF(*aServer = mDefaultSmtpServer);
@@ -577,17 +577,17 @@ nsSmtpService::SetDefaultServer(nsISmtpS
     mDefaultSmtpServer = aServer;
 
     nsCString serverKey;
     nsresult rv = aServer->GetKey(getter_Copies(serverKey));
     NS_ENSURE_SUCCESS(rv,rv);
 
     nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
     NS_ENSURE_SUCCESS(rv,rv);
-    prefBranch->SetCharPref(PREF_MAIL_SMTP_DEFAULTSERVER, serverKey.get());
+    prefBranch->SetCharPref(PREF_MAIL_SMTP_DEFAULTSERVER, serverKey);
     return NS_OK;
 }
 
 bool
 nsSmtpService::findServerByKey(nsISmtpServer *aServer, void *aData)
 {
   findServerByKeyEntry *entry = (findServerByKeyEntry*) aData;
 
--- a/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
+++ b/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
@@ -249,23 +249,23 @@ Tokenizer::Tokenizer() :
    * set with the following preferences for the body and header
    * separately.
    *
    * \t, \n, \v, \f, \r, and \\ will be escaped to their normal
    * C-library values, all other two-letter combinations beginning with \
    * will be ignored.
    */
 
-  prefBranch->GetCharPref("body_delimiters", getter_Copies(mBodyDelimiters));
+  prefBranch->GetCharPref("body_delimiters", mBodyDelimiters);
   if (!mBodyDelimiters.IsEmpty())
     UnescapeCString(mBodyDelimiters);
   else // prefBranch empties the result when it fails :(
     mBodyDelimiters.Assign(kBayesianFilterTokenDelimiters);
 
-  prefBranch->GetCharPref("header_delimiters", getter_Copies(mHeaderDelimiters));
+  prefBranch->GetCharPref("header_delimiters", mHeaderDelimiters);
   if (!mHeaderDelimiters.IsEmpty())
     UnescapeCString(mHeaderDelimiters);
   else
     mHeaderDelimiters.Assign(kBayesianFilterTokenDelimiters);
 
   /*
    * Extensions may wish to enable or disable tokenization of certain headers.
    * Define any headers to enable/disable in a string preference like this:
@@ -309,17 +309,17 @@ Tokenizer::Tokenizer() :
     rv = prefBranch->GetChildList("", &count, &headers);
 
   if (NS_SUCCEEDED(rv))
   {
     mCustomHeaderTokenization = true;
     for (uint32_t i = 0; i < count; i++)
     {
       nsCString value;
-      prefBranch->GetCharPref(headers[i], getter_Copies(value));
+      prefBranch->GetCharPref(headers[i], value);
       if (value.EqualsLiteral("false"))
       {
         mDisabledHeaders.AppendElement(headers[i]);
         continue;
       }
       mEnabledHeaders.AppendElement(headers[i]);
       if (value.EqualsLiteral("standard"))
         value.SetIsVoid(true); // Void means use default delimiter
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -7441,20 +7441,20 @@ void nsImapMailFolder::SetPendingAttribu
 
   nsCString dontPreserve;
 
   // These preferences exist so that extensions can control which properties
   // are preserved in the database when a message is moved or copied. All
   // properties are preserved except those listed in these preferences
   if (aIsMove)
     prefBranch->GetCharPref("mailnews.database.summary.dontPreserveOnMove",
-                            getter_Copies(dontPreserve));
+                            dontPreserve);
   else
     prefBranch->GetCharPref("mailnews.database.summary.dontPreserveOnCopy",
-                            getter_Copies(dontPreserve));
+                            dontPreserve);
 
   // We'll add spaces at beginning and end so we can search for space-name-space
   nsCString dontPreserveEx(NS_LITERAL_CSTRING(" "));
   dontPreserveEx.Append(dontPreserve);
   dontPreserveEx.Append(' ');
 
   // these properties are set as integers below, so don't set them again
   // in the iteration through the properties
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -363,17 +363,17 @@ nsresult nsImapProtocol::GlobalInitializ
                              &gExpungeAfterDelete);
     aPrefBranch->GetBoolPref("mail.imap.check_deleted_before_expunge",
                              &gCheckDeletedBeforeExpunge);
     aPrefBranch->GetIntPref("mail.imap.expunge_option", &gExpungeOption);
     aPrefBranch->GetIntPref("mail.imap.expunge_threshold_number",
                             &gExpungeThreshold);
     aPrefBranch->GetIntPref("mailnews.tcptimeout", &gResponseTimeout);
     aPrefBranch->GetCharPref("mail.imap.force_select_detect",
-                             getter_Copies(gForceSelectDetect));
+                             gForceSelectDetect);
     ParseString(gForceSelectDetect, ';', gForceSelectServersArray);
 
     nsCOMPtr<nsIXULAppInfo> appInfo(do_GetService(XULAPPINFO_SERVICE_CONTRACTID));
 
     if (appInfo)
     {
       nsCString appName, appVersion;
       appInfo->GetName(appName);
@@ -426,25 +426,23 @@ nsImapProtocol::nsImapProtocol() : nsMsg
     nsCOMPtr<nsIPrefLocalizedString> prefString;
     prefBranch->GetComplexValue("intl.accept_languages",
                                 NS_GET_IID(nsIPrefLocalizedString),
                                 getter_AddRefs(prefString));
     if (prefString)
       prefString->ToString(getter_Copies(mAcceptLanguages));
 
     nsCString customDBHeaders;
-    prefBranch->GetCharPref("mailnews.customDBHeaders",
-                            getter_Copies(customDBHeaders));
+    prefBranch->GetCharPref("mailnews.customDBHeaders", customDBHeaders);
 
     ParseString(customDBHeaders, ' ', mCustomDBHeaders);
     prefBranch->GetBoolPref("mailnews.display.prefer_plaintext", &m_preferPlainText);
 
-    nsAutoCString customHeaders;;
-    prefBranch->GetCharPref("mailnews.customHeaders",
-                            getter_Copies(customHeaders));
+    nsAutoCString customHeaders;
+    prefBranch->GetCharPref("mailnews.customHeaders", customHeaders);
     customHeaders.StripWhitespace();
     ParseString(customHeaders, ':', mCustomHeaders);
   }
 
     // ***** Thread support *****
   m_thread = nullptr;
   m_imapThreadIsRunning = false;
   m_currentServerCommandTagNumber = 0;
--- a/mailnews/import/text/src/nsTextImport.cpp
+++ b/mailnews/import/text/src/nsTextImport.cpp
@@ -598,18 +598,18 @@ NS_IMETHODIMP ImportAddressImpl::InitFie
 {
   // Let's remember the last one the user used!
   // This should be normal for someone importing multiple times, it's usually
   // from the same file format.
 
   nsresult rv;
   nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
   if (NS_SUCCEEDED(rv)) {
-    nsCString  prefStr;
-    rv = prefs->GetCharPref("mailnews.import.text.fieldmap", getter_Copies(prefStr));
+    nsCString prefStr;
+    rv = prefs->GetCharPref("mailnews.import.text.fieldmap", prefStr);
     if (NS_SUCCEEDED(rv)) {
       const char *pStr = prefStr.get();
       if (pStr) {
         fieldMap->SetFieldMapSize(0);
         long fNum;
         bool active;
         long fIndex = 0;
         while (*pStr) {
@@ -683,19 +683,19 @@ void ImportAddressImpl::SaveFieldMap(nsI
     str.Append(',');
   }
 
   nsresult rv;
   nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
 
   if (NS_SUCCEEDED(rv)) {
     nsCString prefStr;
-    rv = prefs->GetCharPref("mailnews.import.text.fieldmap", getter_Copies(prefStr));
+    rv = prefs->GetCharPref("mailnews.import.text.fieldmap", prefStr);
     if (NS_FAILED(rv) || !str.Equals(prefStr))
-      rv = prefs->SetCharPref("mailnews.import.text.fieldmap", str.get());
+      rv = prefs->SetCharPref("mailnews.import.text.fieldmap", str);
   }
 
   // Now also save last used skip first record value.
   bool skipFirstRecord = false;
   rv = pMap->GetSkipFirstRecord(&skipFirstRecord);
   if (NS_SUCCEEDED(rv))
     prefs->SetBoolPref("mailnews.import.text.skipfirstrecord", skipFirstRecord);
 }
--- a/mailnews/local/src/nsLocalMailFolder.cpp
+++ b/mailnews/local/src/nsLocalMailFolder.cpp
@@ -2279,20 +2279,20 @@ void nsMsgLocalMailFolder::CopyPropertie
 
   nsCString dontPreserve;
 
   // These preferences exist so that extensions can control which properties
   // are preserved in the database when a message is moved or copied. All
   // properties are preserved except those listed in these preferences
   if (aIsMove)
     prefBranch->GetCharPref("mailnews.database.summary.dontPreserveOnMove",
-                            getter_Copies(dontPreserve));
+                            dontPreserve);
   else
     prefBranch->GetCharPref("mailnews.database.summary.dontPreserveOnCopy",
-                            getter_Copies(dontPreserve));
+                            dontPreserve);
 
   CopyHdrPropertiesWithSkipList(destHdr, srcHdr, dontPreserve);
 }
 
 void
 nsMsgLocalMailFolder::CopyHdrPropertiesWithSkipList(nsIMsgDBHdr *destHdr,
                                                     nsIMsgDBHdr *srcHdr,
                                                     const nsCString &skipList)
--- a/mailnews/local/src/nsParseMailbox.cpp
+++ b/mailnews/local/src/nsParseMailbox.cpp
@@ -524,26 +524,26 @@ nsParseMailMessageState::nsParseMailMess
   // E.g., if mailnews.customDBHeaders is "X-Spam-Score", and we're parsing
   // a mail message with the X-Spam-Score header, we'll set the
   // "x-spam-score" property of nsMsgHdr to the value of the header.
   m_customDBHeaderValues = nullptr;
   nsCString customDBHeaders; // not shown in search UI
   nsCOMPtr<nsIPrefBranch> pPrefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
   if (pPrefBranch)
   {
-     pPrefBranch->GetCharPref("mailnews.customDBHeaders",  getter_Copies(customDBHeaders));
+     pPrefBranch->GetCharPref("mailnews.customDBHeaders", customDBHeaders);
      ToLowerCase(customDBHeaders);
      if (customDBHeaders.Find("content-base") == -1)
       customDBHeaders.InsertLiteral("content-base ", 0);
      ParseString(customDBHeaders, ' ', m_customDBHeaders);
 
      // now add customHeaders
      nsCString customHeadersString; // shown in search UI
      nsTArray<nsCString> customHeadersArray;
-     pPrefBranch->GetCharPref("mailnews.customHeaders", getter_Copies(customHeadersString));
+     pPrefBranch->GetCharPref("mailnews.customHeaders", customHeadersString);
      ToLowerCase(customHeadersString);
      customHeadersString.StripWhitespace();
      ParseString(customHeadersString, ':', customHeadersArray);
      for (uint32_t i = 0; i < customHeadersArray.Length(); i++)
      {
        if (!m_customDBHeaders.Contains(customHeadersArray[i]))
          m_customDBHeaders.AppendElement(customHeadersArray[i]);
      }
--- a/mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.cpp
+++ b/mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.cpp
@@ -95,18 +95,17 @@ static void PgpMimeGetNeedsAddonString(n
   if (NS_FAILED(rv))
     return;
 
   nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
   if (NS_FAILED(rv))
     return;
 
   nsCString url;
-  if (NS_FAILED(prefs->GetCharPref("mail.pgpmime.addon_url",
-                                   getter_Copies(url))))
+  if (NS_FAILED(prefs->GetCharPref("mail.pgpmime.addon_url", url)))
     return;
 
   NS_ConvertUTF8toUTF16 url16(url);
   const char16_t *formatStrings[] = { url16.get() };
 
   nsString result;
   rv = stringBundle->FormatStringFromName(PGPMIME_STR_NOT_SUPPORTED_ID,
                                           formatStrings, 1, result);
--- a/mailnews/mime/emitters/nsMimeHtmlEmitter.cpp
+++ b/mailnews/mime/emitters/nsMimeHtmlEmitter.cpp
@@ -169,17 +169,17 @@ nsresult nsMimeHtmlDisplayEmitter::Broad
   nsCString extraExpandedHeaders;
   nsTArray<nsCString> extraExpandedHeadersArray;
   nsAutoCString convertedDateString;
 
   nsresult rv;
   nsCOMPtr<nsIPrefBranch> pPrefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
   if (pPrefBranch)
   {
-    pPrefBranch->GetCharPref("mailnews.headers.extraExpandedHeaders", getter_Copies(extraExpandedHeaders));
+    pPrefBranch->GetCharPref("mailnews.headers.extraExpandedHeaders", extraExpandedHeaders);
     // todo - should make this upper case
     if (!extraExpandedHeaders.IsEmpty())
     {
       ToLowerCase(extraExpandedHeaders);
       ParseString(extraExpandedHeaders, ' ', extraExpandedHeadersArray);
     }
   }
 
--- a/mailnews/mime/src/mimedrft.cpp
+++ b/mailnews/mime/src/mimedrft.cpp
@@ -1323,18 +1323,17 @@ mime_parse_stream_complete(nsMIMESession
     {
       if (subj)
       {
         nsresult rv;
         nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
         if (NS_SUCCEEDED(rv))
         {
           nsAutoCString fwdPrefix;
-          prefBranch->GetCharPref("mail.forward_subject_prefix",
-                                  getter_Copies(fwdPrefix));
+          prefBranch->GetCharPref("mail.forward_subject_prefix", fwdPrefix);
           char *newSubj = PR_smprintf("%s: %s", !fwdPrefix.IsEmpty() ?
                                                 fwdPrefix.get(): "Fwd", subj);
           if (newSubj)
           {
             PR_Free(subj);
             subj = newSubj;
           }
         }
--- a/mailnews/mime/src/mimemoz2.cpp
+++ b/mailnews/mime/src/mimemoz2.cpp
@@ -2092,17 +2092,17 @@ HTMLSanitize(const nsString& inString, n
   nsresult rv = prefs->GetBoolPref(
     "mailnews.display.html_sanitizer.allowed_tags.migrated",
     &migrated);
   if (NS_SUCCEEDED(rv) && !migrated) {
     prefs->SetBoolPref("mailnews.display.html_sanitizer.allowed_tags.migrated",
                        true);
     nsAutoCString legacy;
     rv = prefs->GetCharPref("mailnews.display.html_sanitizer.allowed_tags",
-                            getter_Copies(legacy));
+                            legacy);
     if (NS_SUCCEEDED(rv)) {
       prefs->SetBoolPref("mailnews.display.html_sanitizer.drop_non_css_presentation",
                          legacy.Find("font") < 0);
       prefs->SetBoolPref("mailnews.display.html_sanitizer.drop_media",
                          legacy.Find("img") < 0);
     }
   }
   // End pref migration.
--- a/mailnews/mime/src/mimetpfl.cpp
+++ b/mailnews/mime/src/mimetpfl.cpp
@@ -27,17 +27,17 @@ static int MimeInlineTextPlainFlowed_par
 static int MimeInlineTextPlainFlowed_parse_eof (MimeObject *, bool);
 
 static MimeInlineTextPlainFlowedExData *MimeInlineTextPlainFlowedExDataList = nullptr;
 
 // From mimetpla.cpp
 extern "C" void MimeTextBuildPrefixCSS(
                        int32_t quotedSizeSetting,      // mail.quoted_size
                        int32_t    quotedStyleSetting,  // mail.quoted_style
-                       char       *citationColor,      // mail.citation_color
+                       nsACString &citationColor,      // mail.citation_color
                        nsACString &style);
 // Definition below
 static
 nsresult Line_convert_whitespace(const nsString& a_line,
                                  const bool a_convert_all_whitespace,
                                  nsString& a_out_line);
 
 static int
@@ -105,25 +105,25 @@ MimeInlineTextPlainFlowed_parse_begin (M
   PR_Free(content_type_row);
 
   // Get Prefs for viewing
 
   exdata->fixedwidthfont = false;
   //  Quotes
   text->mQuotedSizeSetting = 0;   // mail.quoted_size
   text->mQuotedStyleSetting = 0;  // mail.quoted_style
-  text->mCitationColor = nullptr;  // mail.citation_color
+  text->mCitationColor.Truncate();  // mail.citation_color
   text->mStripSig = true; // mail.strip_sig_on_reply
 
   nsIPrefBranch *prefBranch = GetPrefBranch(obj->options);
   if (prefBranch)
   {
     prefBranch->GetIntPref("mail.quoted_size", &(text->mQuotedSizeSetting));
     prefBranch->GetIntPref("mail.quoted_style", &(text->mQuotedStyleSetting));
-    prefBranch->GetCharPref("mail.citation_color", &(text->mCitationColor));
+    prefBranch->GetCharPref("mail.citation_color", text->mCitationColor);
     prefBranch->GetBoolPref("mail.strip_sig_on_reply", &(text->mStripSig));
     mozilla::DebugOnly<nsresult> rv =
       prefBranch->GetBoolPref("mail.fixed_width_messages", &(exdata->fixedwidthfont));
     NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get pref");
          // Check at least the success of one
   }
 
   // Get font
@@ -238,20 +238,19 @@ MimeInlineTextPlainFlowed_parse_eof (Mim
     if (status<0) goto EarlyOut;
   }
 
   status = 0;
 
 EarlyOut:
   PR_Free(exdata);
 
-  // Free mCitationColor
+  // Clear mCitationColor
   MimeInlineTextPlainFlowed *text = (MimeInlineTextPlainFlowed *) obj;
-  PR_FREEIF(text->mCitationColor);
-  text->mCitationColor = nullptr;
+  text->mCitationColor.Truncate();
 
   return status;
 }
 
 
 static int
 MimeInlineTextPlainFlowed_parse_line (const char *aLine, int32_t length, MimeObject *obj)
 {
--- a/mailnews/mime/src/mimetpfl.h
+++ b/mailnews/mime/src/mimetpfl.h
@@ -24,17 +24,17 @@ struct MimeInlineTextPlainFlowedClass {
 
 extern MimeInlineTextPlainFlowedClass mimeInlineTextPlainFlowedClass;
 
 struct MimeInlineTextPlainFlowed {
   MimeInlineText  text;
   bool            delSp;                // DelSp=yes (RFC 3676)
   int32_t         mQuotedSizeSetting;   // mail.quoted_size
   int32_t         mQuotedStyleSetting;  // mail.quoted_style
-  char            *mCitationColor;      // mail.citation_color
+  nsCString       mCitationColor;       // mail.citation_color
   bool            mStripSig;            // mail.strip_sig_on_reply
 };
 
 
 /*
  * Made to contain information to be kept during the whole message parsing.
  */
 struct MimeInlineTextPlainFlowedExData {
--- a/mailnews/mime/src/mimetpla.cpp
+++ b/mailnews/mime/src/mimetpla.cpp
@@ -36,17 +36,17 @@ MimeInlineTextPlainClassInitialize(MimeI
   oclass->parse_eof   = MimeInlineTextPlain_parse_eof;
   return 0;
 }
 
 extern "C"
 void
 MimeTextBuildPrefixCSS(int32_t    quotedSizeSetting,   // mail.quoted_size
                        int32_t    quotedStyleSetting,  // mail.quoted_style
-                       char       *citationColor,      // mail.citation_color
+                       nsACString &citationColor,      // mail.citation_color
                        nsACString &style)
 {
   switch (quotedStyleSetting)
   {
   case 0:     // regular
     break;
   case 1:     // bold
     style.AppendLiteral("font-weight: bold; ");
@@ -66,17 +66,17 @@ MimeTextBuildPrefixCSS(int32_t    quoted
   case 1:     // large
     style.AppendLiteral("font-size: large; ");
     break;
   case 2:     // small
     style.AppendLiteral("font-size: small; ");
     break;
   }
 
-  if (citationColor && *citationColor)
+  if (!citationColor.IsEmpty())
   {
     style += "color: ";
     style += citationColor;
     style += ';';
   }
 }
 
 static int
@@ -109,26 +109,26 @@ MimeInlineTextPlain_parse_begin (MimeObj
       // Get the prefs
 
       // Quoting
       text->mBlockquoting = true; // mail.quoteasblock
 
       // Viewing
       text->mQuotedSizeSetting = 0;   // mail.quoted_size
       text->mQuotedStyleSetting = 0;  // mail.quoted_style
-      text->mCitationColor = nullptr;  // mail.citation_color
+      text->mCitationColor.Truncate();  // mail.citation_color
       text->mStripSig = true; // mail.strip_sig_on_reply
       bool graphicalQuote = true; // mail.quoted_graphical
 
       nsIPrefBranch *prefBranch = GetPrefBranch(obj->options);
       if (prefBranch)
       {
         prefBranch->GetIntPref("mail.quoted_size", &(text->mQuotedSizeSetting));
         prefBranch->GetIntPref("mail.quoted_style", &(text->mQuotedStyleSetting));
-        prefBranch->GetCharPref("mail.citation_color", &(text->mCitationColor));
+        prefBranch->GetCharPref("mail.citation_color", text->mCitationColor);
         prefBranch->GetBoolPref("mail.strip_sig_on_reply", &(text->mStripSig));
         prefBranch->GetBoolPref("mail.quoted_graphical", &graphicalQuote);
         prefBranch->GetBoolPref("mail.quoteasblock", &(text->mBlockquoting));
       }
 
       if (!rawPlainText)
       {
         // Get font
@@ -217,18 +217,18 @@ MimeInlineTextPlain_parse_eof (MimeObjec
   int status;
 
   // Has this method already been called for this object?
   // In that case return.
   if (obj->closed_p) return 0;
 
   nsCString citationColor;
   MimeInlineTextPlain *text = (MimeInlineTextPlain *) obj;
-  if (text && text->mCitationColor)
-    citationColor.Adopt(text->mCitationColor);
+  if (text && !text->mCitationColor.IsEmpty())
+    citationColor = text->mCitationColor;
 
   bool quoting = ( obj->options
     && ( obj->options->format_out == nsMimeOutput::nsMimeMessageQuoting ||
          obj->options->format_out == nsMimeOutput::nsMimeMessageBodyQuoting
        )           );  // see above
 
   bool rawPlainText = obj->options &&
        (obj->options->format_out == nsMimeOutput::nsMimeMessageFilterSniffer
--- a/mailnews/mime/src/mimetpla.h
+++ b/mailnews/mime/src/mimetpla.h
@@ -23,17 +23,17 @@ extern MimeInlineTextPlainClass mimeInli
 
 struct MimeInlineTextPlain {
   MimeInlineText text;
   uint32_t mCiteLevel;
   bool            mBlockquoting;
   //bool            mInsideQuote;
   int32_t         mQuotedSizeSetting;   // mail.quoted_size
   int32_t         mQuotedStyleSetting;  // mail.quoted_style
-  char            *mCitationColor;      // mail.citation_color
+  nsCString       mCitationColor;       // mail.citation_color
   bool            mStripSig;            // mail.strip_sig_on_reply
   bool            mIsSig;
 };
 
 #define MimeInlineTextPlainClassInitializer(ITYPE,CSUPER) \
   { MimeInlineTextClassInitializer(ITYPE,CSUPER) }
 
 #endif /* _MIMETPLA_H_ */
--- a/suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp
+++ b/suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp
@@ -265,17 +265,17 @@ nsNetscapeProfileMigratorBase::SetFile(P
     if (NS_SUCCEEDED(rv) && exists)
       rv = file->IsFile(&exists);
 
     if (NS_SUCCEEDED(rv) && exists) {
       // After all that let's just get the URL spec and set the pref to it.
       rv = fileHandler->GetURLSpecFromFile(file, fileURL);
       if (NS_FAILED(rv))
         return NS_OK;
-      rv = aBranch->SetCharPref(aTransform->sourcePrefName, fileURL.get());
+      rv = aBranch->SetCharPref(aTransform->sourcePrefName, fileURL);
       if (NS_SUCCEEDED(rv) && aTransform->targetPrefName)
         rv = aBranch->SetIntPref(aTransform->targetPrefName, 1);
     }
   }
   return rv;
 }
 
 nsresult