Bug 1060696: Stop using nsISupportsObsolete in comm-central, r=rkent
authorJoshua Cranmer <Pidgeot18@gmail.com>
Thu, 15 Jan 2015 18:41:23 -0600
changeset 17355 cdeb25624d5ef02b850576b37c12983939862d2d
parent 17354 7ee1e4040d498de68875c4a433cb7f1ebb3cdc41
child 17356 5c7840849e72dec392d20204cdfe15cbd3ae5259
push id10707
push userPidgeot18@gmail.com
push dateFri, 16 Jan 2015 00:50:21 +0000
treeherdercomm-central@5c7840849e72 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrkent
bugs1060696
Bug 1060696: Stop using nsISupportsObsolete in comm-central, r=rkent
mailnews/base/search/src/nsMsgFilter.cpp
mailnews/base/search/src/nsMsgFilterList.cpp
mailnews/base/search/src/nsMsgSearchTerm.cpp
mailnews/base/search/src/nsMsgSearchValue.cpp
mailnews/base/src/nsMessenger.cpp
mailnews/base/src/nsMsgAccount.cpp
mailnews/base/src/nsMsgFolderCacheElement.cpp
mailnews/base/src/nsMsgWindow.cpp
mailnews/base/src/nsSpamSettings.cpp
mailnews/base/util/nsMsgIdentity.cpp
mailnews/base/util/nsMsgIncomingServer.cpp
mailnews/base/util/nsMsgUtils.h
mailnews/compose/src/nsSmtpUrl.cpp
mailnews/db/msgdb/src/nsDBFolderInfo.cpp
mailnews/imap/src/nsImapIncomingServer.cpp
mailnews/imap/src/nsImapProtocol.cpp
mailnews/imap/src/nsImapUrl.cpp
mailnews/imap/src/nsImapUtils.cpp
mailnews/import/src/nsImportFieldMap.cpp
mailnews/local/src/nsMailboxUrl.cpp
mailnews/local/src/nsMailboxUrl.h
mailnews/news/src/nsNNTPNewsgroupPost.cpp
mailnews/news/src/nsNNTPNewsgroupPost.h
mailnews/news/src/nsNntpIncomingServer.cpp
mailnews/news/src/nsNntpService.cpp
mailnews/news/src/nsNntpUrl.cpp
--- a/mailnews/base/search/src/nsMsgFilter.cpp
+++ b/mailnews/base/search/src/nsMsgFilter.cpp
@@ -12,17 +12,16 @@
 #include "nsMsgFilter.h"
 #include "nsMsgUtils.h"
 #include "nsMsgLocalSearch.h"
 #include "nsMsgSearchTerm.h"
 #include "nsIMsgAccountManager.h"
 #include "nsIMsgIncomingServer.h"
 #include "nsMsgSearchValue.h"
 #include "nsMsgI18N.h"
-#include "nsISupportsObsolete.h"
 #include "nsIOutputStream.h"
 #include "nsIStringBundle.h"
 #include "nsDateTimeFormatCID.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIMsgFilterService.h"
 #include "nsIMutableArray.h"
 #include "prmem.h"
--- a/mailnews/base/search/src/nsMsgFilterList.cpp
+++ b/mailnews/base/search/src/nsMsgFilterList.cpp
@@ -12,17 +12,16 @@
 #include "nsMsgFilter.h"
 #include "nsIMsgFilterHitNotify.h"
 #include "nsMsgUtils.h"
 #include "nsMsgSearchTerm.h"
 #include "nsStringGlue.h"
 #include "nsMsgBaseCID.h"
 #include "nsIMsgFilterService.h"
 #include "nsMsgSearchScopeTerm.h"
-#include "nsISupportsObsolete.h"
 #include "nsNetUtil.h"
 #include "nsMsgI18N.h"
 #include "nsMemory.h"
 #include "prmem.h"
 #include "mozilla/ArrayUtils.h"
 #include <ctype.h>
 
 // unicode "%s" format string
--- a/mailnews/base/search/src/nsMsgSearchTerm.cpp
+++ b/mailnews/base/search/src/nsMsgSearchTerm.cpp
@@ -21,17 +21,16 @@
 #include "nsMsgSearchValue.h"
 #include "nsMsgI18N.h"
 #include "nsIMimeConverter.h"
 #include "nsMsgMimeCID.h"
 #include "nsIPrefBranch.h"
 #include "nsIPrefService.h"
 #include "nsIMsgFilterPlugin.h"
 #include "nsIFile.h"
-#include "nsISupportsObsolete.h"
 #include "nsISeekableStream.h"
 #include "nsNetCID.h"
 #include "nsIFileStreams.h"
 #include "nsUnicharUtils.h"
 #include "nsIAbCard.h"
 #include "nsServiceManagerUtils.h"
 #include "nsComponentManagerUtils.h"
 #include <ctype.h>
--- a/mailnews/base/search/src/nsMsgSearchValue.cpp
+++ b/mailnews/base/search/src/nsMsgSearchValue.cpp
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "MailNewsTypes.h"
 #include "nsMsgSearchValue.h"
 #include "nsIMsgFolder.h"
-#include "nsISupportsObsolete.h"
+#include "nsMsgUtils.h"
 #include "nsStringGlue.h"
 
 nsMsgSearchValueImpl::nsMsgSearchValueImpl(nsMsgSearchValue *aInitialValue)
 {
     mValue = *aInitialValue;
     if (IS_STRING_ATTRIBUTE(aInitialValue->attribute) && aInitialValue->string)
         mValue.string = NS_strdup(aInitialValue->string);
     else
--- a/mailnews/base/src/nsMessenger.cpp
+++ b/mailnews/base/src/nsMessenger.cpp
@@ -8,17 +8,16 @@
 #include "nsMessenger.h"
 
 // xpcom
 #include "nsIComponentManager.h"
 #include "nsIServiceManager.h"
 #include "nsIStringStream.h"
 #include "nsIFile.h"
 #include "nsDirectoryServiceDefs.h"
-#include "nsISupportsObsolete.h"
 #include "nsQuickSort.h"
 #include "nsAutoPtr.h"
 #include "nsNativeCharsetUtils.h"
 #include "nsIMutableArray.h"
 #include "mozilla/Services.h"
 
 // necko
 #include "nsMimeTypes.h"
--- a/mailnews/base/src/nsMsgAccount.cpp
+++ b/mailnews/base/src/nsMsgAccount.cpp
@@ -2,17 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "prprf.h"
 #include "plstr.h"
 #include "prmem.h"
-#include "nsISupportsObsolete.h"
 #include "nsIComponentManager.h"
 #include "nsIServiceManager.h"
 #include "nsCRTGlue.h"
 #include "nsCOMPtr.h"
 #include "nsIMsgFolderNotificationService.h"
 
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
--- a/mailnews/base/src/nsMsgFolderCacheElement.cpp
+++ b/mailnews/base/src/nsMsgFolderCacheElement.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "msgCore.h"
 #include "nsMsgFolderCacheElement.h"
 #include "prmem.h"
-#include "nsISupportsObsolete.h"
 #include "nsMsgUtils.h"
 
 nsMsgFolderCacheElement::nsMsgFolderCacheElement()
 {
   m_mdbRow = nullptr;
   m_owningCache = nullptr;
 }
 
--- a/mailnews/base/src/nsMsgWindow.cpp
+++ b/mailnews/base/src/nsMsgWindow.cpp
@@ -23,21 +23,21 @@
 #include "nsICharsetConverterManager.h"
 #include "nsIChannel.h"
 #include "nsIRequestObserver.h"
 #include "netCore.h"
 #include "prmem.h"
 #include "plbase64.h"
 #include "nsMsgI18N.h"
 #include "nsIWebNavigation.h"
-#include "nsISupportsObsolete.h"
 #include "nsMsgContentPolicy.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIAuthPrompt.h"
+#include "nsMsgUtils.h"
 
 // used to dispatch urls to default protocol handlers
 #include "nsCExternalHandlerService.h"
 #include "nsIExternalProtocolService.h"
 
 static NS_DEFINE_CID(kTransactionManagerCID, NS_TRANSACTIONMANAGER_CID);
 
 NS_IMPL_ISUPPORTS(nsMsgWindow,
--- a/mailnews/base/src/nsSpamSettings.cpp
+++ b/mailnews/base/src/nsSpamSettings.cpp
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsSpamSettings.h"
-#include "nsISupportsObsolete.h"
 #include "nsIFile.h"
 #include "plstr.h"
 #include "prmem.h"
 #include "nsIMsgHdr.h"
 #include "nsNetUtil.h"
 #include "nsIMsgFolder.h"
 #include "nsMsgUtils.h"
 #include "nsMsgFolderFlags.h"
--- a/mailnews/base/util/nsMsgIdentity.cpp
+++ b/mailnews/base/util/nsMsgIdentity.cpp
@@ -12,17 +12,16 @@
 #include "nsIRDFResource.h"
 #include "nsRDFCID.h"
 #include "nsMsgFolderFlags.h"
 #include "nsIMsgFolder.h"
 #include "nsIMsgIncomingServer.h"
 #include "nsIMsgAccountManager.h"
 #include "nsMsgBaseCID.h"
 #include "prprf.h"
-#include "nsISupportsObsolete.h"
 #include "nsISupportsPrimitives.h"
 #include "nsMsgUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsArrayUtils.h"
 
 static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
 
--- a/mailnews/base/util/nsMsgIncomingServer.cpp
+++ b/mailnews/base/util/nsMsgIncomingServer.cpp
@@ -7,17 +7,16 @@
 #include "nscore.h"
 #include "plstr.h"
 #include "prmem.h"
 #include "prprf.h"
 
 #include "nsIServiceManager.h"
 #include "nsCOMPtr.h"
 #include "nsStringGlue.h"
-#include "nsISupportsObsolete.h"
 #include "nsISupportsPrimitives.h"
 
 #include "nsMsgBaseCID.h"
 #include "nsMsgDBCID.h"
 #include "nsIMsgFolder.h"
 #include "nsIMsgFolderCache.h"
 #include "nsIMsgPluggableStore.h"
 #include "nsIMsgFolderCacheElement.h"
--- a/mailnews/base/util/nsMsgUtils.h
+++ b/mailnews/base/util/nsMsgUtils.h
@@ -551,9 +551,25 @@ NS_MSG_BASE bool MsgIsHex(const char *aH
  * nsMsgKey is an opaque value that can't be treated as a generic integer
  * (except when storing it into the database). It enables type safety checks and
  * may prevent coding errors.
  */
 NS_MSG_BASE nsMsgKey msgKeyFromInt(uint32_t aValue);
 
 NS_MSG_BASE nsMsgKey msgKeyFromInt(uint64_t aValue);
 
+/**
+ * Helper macro for defining getter/setters. Ported from nsISupportsObsolete.h
+ */
+#define NS_IMPL_GETSET(clazz, attr, type, member) \
+  NS_IMETHODIMP clazz::Get##attr(type *result) \
+  { \
+    NS_ENSURE_ARG_POINTER(result); \
+    *result = member; \
+    return NS_OK; \
+  } \
+  NS_IMETHODIMP clazz::Set##attr(type aValue) \
+  { \
+    member = aValue; \
+    return NS_OK; \
+  }
+
 #endif
--- a/mailnews/compose/src/nsSmtpUrl.cpp
+++ b/mailnews/compose/src/nsSmtpUrl.cpp
@@ -7,17 +7,16 @@
 
 #include "nsIURI.h"
 #include "nsNetCID.h"
 #include "nsSmtpUrl.h"
 #include "nsStringGlue.h"
 #include "nsMsgUtils.h"
 #include "nsIMimeConverter.h"
 #include "nsMsgMimeCID.h"
-#include "nsISupportsObsolete.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsCRT.h"
 #include "nsAutoPtr.h"
 
 /////////////////////////////////////////////////////////////////////////////////////
 // mailto url definition
 /////////////////////////////////////////////////////////////////////////////////////
--- a/mailnews/db/msgdb/src/nsDBFolderInfo.cpp
+++ b/mailnews/db/msgdb/src/nsDBFolderInfo.cpp
@@ -8,17 +8,16 @@
 #include "nsMsgDatabase.h"
 #include "nsMsgFolderFlags.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIPrefLocalizedString.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
 #include "nsIMsgDBView.h"
-#include "nsISupportsObsolete.h"
 #include "nsServiceManagerUtils.h"
 #include "nsImapCore.h"
 #include "mozilla/Services.h"
 
 static const char *kDBFolderInfoScope = "ns:msg:db:row:scope:dbfolderinfo:all";
 static const char *kDBFolderInfoTableKind = "ns:msg:db:table:kind:dbfolderinfo";
 
 struct mdbOid gDBFolderInfoOID;
--- a/mailnews/imap/src/nsImapIncomingServer.cpp
+++ b/mailnews/imap/src/nsImapIncomingServer.cpp
@@ -2,17 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "msgCore.h"
 #include "nsMsgImapCID.h"
 
 #include "netCore.h"
-#include "nsISupportsObsolete.h"
 #include "nsIMAPHostSessionList.h"
 #include "nsImapIncomingServer.h"
 #include "nsIMsgAccountManager.h"
 #include "nsIMsgIdentity.h"
 #include "nsIImapUrl.h"
 #include "nsIUrlListener.h"
 #include "nsThreadUtils.h"
 #include "nsImapProtocol.h"
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -9,17 +9,16 @@
 
 #include "nsIServiceManager.h"
 #include "nsICharsetConverterManager.h"
 #include "nsIStringBundle.h"
 #include "nsVersionComparator.h"
 
 #include "nsMsgImapCID.h"
 #include "nsThreadUtils.h"
-#include "nsISupportsObsolete.h"
 #include "nsIMsgStatusFeedback.h"
 #include "nsImapCore.h"
 #include "nsImapProtocol.h"
 #include "nsIMsgMailNewsUrl.h"
 #include "nsIMAPHostSessionList.h"
 #include "nsIMAPBodyShell.h"
 #include "nsImapMailFolder.h"
 #include "nsIMsgAccountManager.h"
--- a/mailnews/imap/src/nsImapUrl.cpp
+++ b/mailnews/imap/src/nsImapUrl.cpp
@@ -16,17 +16,16 @@
 #include "prprf.h"
 #include "nsMemory.h"
 #include "nsCOMPtr.h"
 #include "nsIImapIncomingServer.h"
 #include "nsMsgBaseCID.h"
 #include "nsImapUtils.h"
 #include "nsIMAPNamespace.h"
 #include "nsICacheEntryDescriptor.h"
-#include "nsISupportsObsolete.h"
 #include "nsIMsgFolder.h"
 #include "nsIDocShell.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsMsgUtils.h"
 #include "nsIMsgHdr.h"
 #include "nsIProgressEventSink.h"
 #include "nsAlgorithm.h"
@@ -1216,17 +1215,22 @@ NS_IMETHODIMP nsImapUrl::GetUri(char** a
     rv = nsBuildImapMessageURI(baseMessageURI.get(), key, uriStr);
     *aURI = ToNewCString(uriStr);
   }
   return rv;
 }
 
 NS_IMPL_GETSET(nsImapUrl, AddDummyEnvelope, bool, m_addDummyEnvelope)
 NS_IMPL_GETSET(nsImapUrl, CanonicalLineEnding, bool, m_canonicalLineEnding)
-NS_IMPL_GETTER(nsImapUrl::GetMsgLoadingFromCache, bool, m_msgLoadingFromCache)
+NS_IMETHODIMP nsImapUrl::GetMsgLoadingFromCache(bool *result)
+{
+  NS_ENSURE_ARG_POINTER(result);
+  *result = m_msgLoadingFromCache;
+  return NS_OK;
+}
 NS_IMPL_GETSET(nsImapUrl, LocalFetchOnly, bool, m_localFetchOnly)
 NS_IMPL_GETSET(nsImapUrl, ExternalLinkUrl, bool, m_externalLinkUrl)
 NS_IMPL_GETSET(nsImapUrl, RerunningUrl, bool, m_rerunningUrl)
 NS_IMPL_GETSET(nsImapUrl, ValidUrl, bool, m_validUrl)
 NS_IMPL_GETSET(nsImapUrl, MoreHeadersToDownload, bool, m_moreHeadersToDownload)
 
 NS_IMETHODIMP nsImapUrl::SetMsgLoadingFromCache(bool loadingFromCache)
 {
--- a/mailnews/imap/src/nsImapUtils.cpp
+++ b/mailnews/imap/src/nsImapUtils.cpp
@@ -14,17 +14,16 @@
 // stuff for temporary root folder hack
 #include "nsIMsgAccountManager.h"
 #include "nsIMsgIncomingServer.h"
 #include "nsIImapIncomingServer.h"
 #include "nsMsgBaseCID.h"
 #include "nsImapCore.h"
 #include "nsMsgUtils.h"
 #include "nsImapFlagAndUidState.h"
-#include "nsISupportsObsolete.h"
 #include "nsIMAPNamespace.h"
 #include "nsIImapFlagAndUidState.h"
 
 nsresult
 nsImapURI2FullName(const char* rootURI, const char* hostName, const char* uriStr,
                    char **name)
 {
     nsAutoCString uri(uriStr);
--- a/mailnews/import/src/nsImportFieldMap.cpp
+++ b/mailnews/import/src/nsImportFieldMap.cpp
@@ -3,17 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "nscore.h"
 #include "nsIStringBundle.h"
 #include "nsImportFieldMap.h"
 #include "nsImportStringBundle.h"
-#include "nsISupportsObsolete.h"
 #include "nsCRTGlue.h"
 #include "ImportDebug.h"
 #include "nsCOMPtr.h"
 
 ////////////////////////////////////////////////////////////////////////
 
 NS_METHOD nsImportFieldMap::Create(nsIStringBundle *aBundle, nsISupports *aOuter, REFNSIID aIID, void **aResult)
 {
@@ -27,17 +26,28 @@ NS_METHOD nsImportFieldMap::Create(nsISt
   NS_ADDREF(it);
   nsresult rv = it->QueryInterface(aIID, aResult);
   NS_RELEASE(it);
   return rv;
 }
 
 NS_IMPL_ISUPPORTS(nsImportFieldMap, nsIImportFieldMap)
 
-NS_IMPL_GETSET(nsImportFieldMap, SkipFirstRecord, bool, m_skipFirstRecord)
+NS_IMETHODIMP nsImportFieldMap::GetSkipFirstRecord(bool *result)
+{
+  NS_ENSURE_ARG_POINTER(result);
+  *result = m_skipFirstRecord;
+  return NS_OK;
+}
+
+NS_IMETHODIMP nsImportFieldMap::SetSkipFirstRecord(bool aResult)
+{
+  m_skipFirstRecord = aResult;
+  return NS_OK;
+}
 
 nsImportFieldMap::nsImportFieldMap(nsIStringBundle *aBundle)
 {
   m_numFields = 0;
   m_pFields = nullptr;
   m_pActive = nullptr;
   m_allocated = 0;
   // need to init the description array
--- a/mailnews/local/src/nsMailboxUrl.cpp
+++ b/mailnews/local/src/nsMailboxUrl.cpp
@@ -14,17 +14,16 @@
 #include "nsIMsgDatabase.h"
 #include "nsMsgDBCID.h"
 #include "nsMsgBaseCID.h"
 #include "nsIMsgHdr.h"
 
 #include "nsIMsgFolder.h"
 #include "prprf.h"
 #include "prmem.h"
-#include "nsISupportsObsolete.h"
 #include "nsIMsgMailSession.h"
 #include "nsNetUtil.h"
 #include "nsIFileURL.h"
 
 // this is totally lame and MUST be removed by M6
 // the real fix is to attach the URI to the URL as it runs through netlib
 // then grab it and use it on the other side
 #include "nsCOMPtr.h"
--- a/mailnews/local/src/nsMailboxUrl.h
+++ b/mailnews/local/src/nsMailboxUrl.h
@@ -8,17 +8,16 @@
 
 #include "mozilla/Attributes.h"
 #include "nsIMailboxUrl.h"
 #include "nsMsgMailNewsUrl.h"
 #include "nsIFile.h"
 #include "nsCOMPtr.h"
 #include "MailNewsTypes.h"
 #include "nsTArray.h"
-#include "nsISupportsObsolete.h"
 
 class nsMailboxUrl : public nsIMailboxUrl, public nsMsgMailNewsUrl, public nsIMsgMessageUrl, public nsIMsgI18NUrl
 {
 public:
   // nsIURI over-ride...
   NS_IMETHOD SetSpec(const nsACString &aSpec) MOZ_OVERRIDE;
   NS_IMETHOD SetQuery(const nsACString &aQuery) MOZ_OVERRIDE;
 
@@ -26,22 +25,42 @@ public:
   NS_IMETHOD SetMailboxParser(nsIStreamListener * aConsumer) MOZ_OVERRIDE;
   NS_IMETHOD GetMailboxParser(nsIStreamListener ** aConsumer) MOZ_OVERRIDE;
   NS_IMETHOD SetMailboxCopyHandler(nsIStreamListener *  aConsumer) MOZ_OVERRIDE;
   NS_IMETHOD GetMailboxCopyHandler(nsIStreamListener ** aConsumer) MOZ_OVERRIDE;
 
   NS_IMETHOD GetMessageKey(nsMsgKey* aMessageKey) MOZ_OVERRIDE;
   NS_IMETHOD GetMessageSize(uint32_t *aMessageSize) MOZ_OVERRIDE;
   NS_IMETHOD SetMessageSize(uint32_t aMessageSize) MOZ_OVERRIDE;
-  NS_IMPL_CLASS_GETSET(MailboxAction, nsMailboxAction, m_mailboxAction)
+  NS_IMETHOD GetMailboxAction(nsMailboxAction *result) MOZ_OVERRIDE
+  {
+    NS_ENSURE_ARG_POINTER(result);
+    *result = m_mailboxAction;
+    return NS_OK;
+  }
+  NS_IMETHOD SetMailboxAction(nsMailboxAction aAction) MOZ_OVERRIDE
+  {
+    m_mailboxAction = aAction;
+    return NS_OK;
+  }
   NS_IMETHOD IsUrlType(uint32_t type, bool *isType);
   NS_IMETHOD SetMoveCopyMsgKeys(nsMsgKey *keysToFlag, int32_t numKeys) MOZ_OVERRIDE;
   NS_IMETHOD GetMoveCopyMsgHdrForIndex(uint32_t msgIndex, nsIMsgDBHdr **msgHdr) MOZ_OVERRIDE;
   NS_IMETHOD GetNumMoveCopyMsgs(uint32_t *numMsgs) MOZ_OVERRIDE;
-  NS_IMPL_CLASS_GETSET(CurMoveCopyMsgIndex, uint32_t, m_curMsgIndex)
+  NS_IMETHOD GetCurMoveCopyMsgIndex(uint32_t *result) MOZ_OVERRIDE
+  {
+    NS_ENSURE_ARG_POINTER(result);
+    *result = m_curMsgIndex;
+    return NS_OK;
+  }
+  NS_IMETHOD SetCurMoveCopyMsgIndex(uint32_t aIndex) MOZ_OVERRIDE
+  {
+    m_curMsgIndex = aIndex;
+    return NS_OK;
+  }
 
   NS_IMETHOD GetFolder(nsIMsgFolder **msgFolder);
 
   // nsIMsgMailNewsUrl override
   NS_IMETHOD Clone(nsIURI **_retval) MOZ_OVERRIDE;
 
   // nsMailboxUrl
   nsMailboxUrl();
--- a/mailnews/news/src/nsNNTPNewsgroupPost.cpp
+++ b/mailnews/news/src/nsNNTPNewsgroupPost.cpp
@@ -1,90 +1,94 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "msgCore.h"    // precompiled header...
-
-#include "nsINNTPNewsgroupPost.h"
 #include "nsNNTPNewsgroupPost.h"
 
-#include "nsISupportsObsolete.h"
-
-#include "plstr.h"
-#include "prmem.h"
-
 NS_IMPL_ISUPPORTS(nsNNTPNewsgroupPost, nsINNTPNewsgroupPost)
 
 nsNNTPNewsgroupPost::nsNNTPNewsgroupPost()
 {
-  int i;
-  for (i=0; i <= HEADER_LAST; i++)
-    m_header[i]=nullptr;
-
-  m_body=nullptr;
-  m_messageBuffer=nullptr;
-
   m_isControl=false;
 }
 
 nsNNTPNewsgroupPost::~nsNNTPNewsgroupPost()
 {
-    int i;
-    for (i=0; i<=HEADER_LAST; i++)
-        PR_FREEIF(m_header[i]);
-
-    PR_FREEIF(m_body);
-    PR_FREEIF(m_messageBuffer);
 }
 
-static char *
-AppendAndAlloc(char *string, const char *newSubstring, bool withComma)
+#define IMPL_GETSET(attribute, member) \
+  NS_IMETHODIMP nsNNTPNewsgroupPost::Get##attribute(char **result) \
+  { \
+    NS_ENSURE_ARG_POINTER(result); \
+    *result = ToNewCString(member); \
+    return NS_OK; \
+  } \
+  NS_IMETHODIMP nsNNTPNewsgroupPost::Set##attribute(const char *aValue) \
+  { \
+    member.Assign(aValue); \
+    return NS_OK; \
+  }
+
+IMPL_GETSET(RelayVersion, m_header[IDX_HEADER_RELAYVERSION])
+IMPL_GETSET(PostingVersion, m_header[IDX_HEADER_POSTINGVERSION])
+IMPL_GETSET(From, m_header[IDX_HEADER_FROM])
+IMPL_GETSET(Date, m_header[IDX_HEADER_DATE])
+IMPL_GETSET(Subject, m_header[IDX_HEADER_SUBJECT])
+IMPL_GETSET(Path, m_header[IDX_HEADER_PATH])
+IMPL_GETSET(ReplyTo, m_header[IDX_HEADER_REPLYTO])
+IMPL_GETSET(Sender, m_header[IDX_HEADER_SENDER])
+IMPL_GETSET(FollowupTo, m_header[IDX_HEADER_FOLLOWUPTO])
+IMPL_GETSET(DateReceived, m_header[IDX_HEADER_DATERECEIVED])
+IMPL_GETSET(Expires, m_header[IDX_HEADER_EXPIRES])
+IMPL_GETSET(Control, m_header[IDX_HEADER_CONTROL])
+IMPL_GETSET(Distribution, m_header[IDX_HEADER_DISTRIBUTION])
+IMPL_GETSET(Organization, m_header[IDX_HEADER_ORGANIZATION])
+IMPL_GETSET(Body, m_body)
+
+NS_IMETHODIMP nsNNTPNewsgroupPost::GetNewsgroups(char **result)
 {
-    if (!newSubstring) return NULL;
-    
-    if (!string) return PL_strdup(newSubstring);
-    
-    char *separator = (char *) (withComma ? ", " : " ");
-    char *oldString = string;
-    
-    string = (char *)PR_Calloc(PL_strlen(oldString) +
-                               PL_strlen(separator) +
-                               PL_strlen(newSubstring) + 1,
-                               sizeof(char));
-    
-    PL_strcpy(string, oldString);
-    PL_strcat(string, separator);
-    PL_strcat(string, newSubstring);
+  NS_ENSURE_ARG_POINTER(result);
+  *result = ToNewCString(m_header[IDX_HEADER_NEWSGROUPS]);
+  return NS_OK;
+}
 
-    PR_Free(oldString);
-    return string;
+NS_IMETHODIMP nsNNTPNewsgroupPost::GetReferences(char **result)
+{
+  NS_ENSURE_ARG_POINTER(result);
+  *result = ToNewCString(m_header[IDX_HEADER_REFERENCES]);
+  return NS_OK;
+}
+
+NS_IMETHODIMP nsNNTPNewsgroupPost::GetIsControl(bool *result)
+{
+  NS_ENSURE_ARG_POINTER(result);
+  *result = m_isControl;
+  return NS_OK;
 }
 
 nsresult
 nsNNTPNewsgroupPost::AddNewsgroup(const char *newsgroup)
 {
-    m_header[IDX_HEADER_NEWSGROUPS]=AppendAndAlloc(m_header[IDX_HEADER_NEWSGROUPS], newsgroup, true);
+    m_header[IDX_HEADER_NEWSGROUPS].AppendLiteral(", ");
+    m_header[IDX_HEADER_NEWSGROUPS].Append(newsgroup);
     return NS_OK;
 }
 
 
 // the message can be stored in a file....allow accessors for getting and setting
 // the file name to post...
 nsresult
 nsNNTPNewsgroupPost::SetPostMessageFile(nsIFile * aPostMessageFile)
 {
-  NS_LOCK_INSTANCE();
   m_postMessageFile = aPostMessageFile;
-  NS_UNLOCK_INSTANCE();
   return NS_OK;
 }
 
 nsresult 
 nsNNTPNewsgroupPost::GetPostMessageFile(nsIFile ** aPostMessageFile)
 {
-  NS_LOCK_INSTANCE();
   if (aPostMessageFile)
     NS_IF_ADDREF(*aPostMessageFile = m_postMessageFile);
-  NS_UNLOCK_INSTANCE();
   return NS_OK;
 }
--- a/mailnews/news/src/nsNNTPNewsgroupPost.h
+++ b/mailnews/news/src/nsNNTPNewsgroupPost.h
@@ -4,18 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __nsNNTPNewsgroupPost_h
 #define __nsNNTPNewsgroupPost_h
 
 #include "msgCore.h"
 #include "nsINNTPNewsgroupPost.h"
 #include "nsCOMPtr.h"
-#include "prmem.h"
-#include "nsISupportsObsolete.h"
+#include "nsStringGlue.h"
 #include "nsIFile.h"
 
 #define IDX_HEADER_FROM             0
 #define IDX_HEADER_NEWSGROUPS       1
 #define IDX_HEADER_SUBJECT          2
 
 // set this to the last required header
 #define IDX_HEADER_LAST_REQUIRED    IDX_HEADER_SUBJECT
@@ -43,51 +42,20 @@
 #define HEADER_LAST                 IDX_HEADER_MESSAGEID
 
 class nsNNTPNewsgroupPost : public nsINNTPNewsgroupPost {
     
 public:
     nsNNTPNewsgroupPost();
     
     NS_DECL_ISUPPORTS
-    
-    // Required headers
-    NS_IMPL_CLASS_GETSET_STR(RelayVersion, m_header[IDX_HEADER_RELAYVERSION])
-    NS_IMPL_CLASS_GETSET_STR(PostingVersion, m_header[IDX_HEADER_POSTINGVERSION])
-    NS_IMPL_CLASS_GETSET_STR(From, m_header[IDX_HEADER_FROM])
-    NS_IMPL_CLASS_GETSET_STR(Date, m_header[IDX_HEADER_DATE])
-    NS_IMPL_CLASS_GETSET_STR(Subject, m_header[IDX_HEADER_SUBJECT])
-
-    NS_IMPL_CLASS_GETTER_STR(GetNewsgroups, m_header[IDX_HEADER_NEWSGROUPS])
-    NS_IMPL_CLASS_GETSET_STR(Path, m_header[IDX_HEADER_PATH])
-
-    // Optional Headers
-    NS_IMPL_CLASS_GETSET_STR(ReplyTo, m_header[IDX_HEADER_REPLYTO])
-    NS_IMPL_CLASS_GETSET_STR(Sender, m_header[IDX_HEADER_SENDER])
-    NS_IMPL_CLASS_GETSET_STR(FollowupTo, m_header[IDX_HEADER_FOLLOWUPTO])
-    NS_IMPL_CLASS_GETSET_STR(DateReceived, m_header[IDX_HEADER_DATERECEIVED])
-    NS_IMPL_CLASS_GETSET_STR(Expires, m_header[IDX_HEADER_EXPIRES])
-    NS_IMPL_CLASS_GETSET_STR(Control, m_header[IDX_HEADER_CONTROL])
-    NS_IMPL_CLASS_GETSET_STR(Distribution, m_header[IDX_HEADER_DISTRIBUTION])
-    NS_IMPL_CLASS_GETSET_STR(Organization, m_header[IDX_HEADER_ORGANIZATION])
-    NS_IMPL_CLASS_GETSET_STR(Body, m_body)
-    NS_IMPL_CLASS_GETTER_STR(GetReferences, m_header[IDX_HEADER_REFERENCES])
-
-    NS_IMPL_CLASS_GETTER(GetIsControl, bool, m_isControl)
-
-    // the message can be stored in a file....allow accessors for getting and setting
-    // the file name to post...
-    NS_IMETHOD SetPostMessageFile(nsIFile * aFile);
-    NS_IMETHOD GetPostMessageFile(nsIFile ** aFile);
-
-    NS_IMETHOD AddNewsgroup(const char *newsgroupName);
+    NS_DECL_NSINNTPNEWSGROUPPOST
     
 private:
     virtual ~nsNNTPNewsgroupPost();
 
-    nsCOMPtr <nsIFile> m_postMessageFile;
-    char *m_header[HEADER_LAST+1];
-    char *m_body;
-    char *m_messageBuffer;
+    nsCOMPtr<nsIFile> m_postMessageFile;
+    nsCString m_header[HEADER_LAST+1];
+    nsCString m_body;
     bool m_isControl;
 };
 
 #endif /* __nsNNTPNewsgroupPost_h */
--- a/mailnews/news/src/nsNntpIncomingServer.cpp
+++ b/mailnews/news/src/nsNntpIncomingServer.cpp
@@ -21,17 +21,16 @@
 #include "nsIStringBundle.h"
 #include "nntpCore.h"
 #include "nsIWindowWatcher.h"
 #include "nsITreeColumns.h"
 #include "nsIDOMElement.h"
 #include "nsMsgFolderFlags.h"
 #include "nsMsgI18N.h"
 #include "nsUnicharUtils.h"
-#include "nsISupportsObsolete.h"
 #include "nsILineInputStream.h"
 #include "nsNetUtil.h"
 #include "nsISimpleEnumerator.h"
 #include "nsMsgUtils.h"
 #include "mozilla/Services.h"
 #include "nsITreeBoxObject.h"
 
 #define INVALID_VERSION         0
--- a/mailnews/news/src/nsNntpService.cpp
+++ b/mailnews/news/src/nsNntpService.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "msgCore.h"    // precompiled header...
 #include "nntpCore.h"
-#include "nsISupportsObsolete.h"
 #include "nsMsgNewsCID.h"
 #include "nsINntpUrl.h"
 #include "nsIMsgNewsFolder.h"
 #include "nsNNTPNewsgroupPost.h"
 #include "nsIMsgIdentity.h"
 #include "nsStringGlue.h"
 #include "nsNewsUtils.h"
 #include "nsNewsDatabase.h"
@@ -826,18 +825,16 @@ nsNntpService::GetNntpServerByAccount(co
 NS_IMETHODIMP
 nsNntpService::PostMessage(nsIFile *aFileToPost, const char *newsgroupsNames, const char *aAccountKey, nsIUrlListener * aUrlListener, nsIMsgWindow *aMsgWindow, nsIURI **_retval)
 {
   // aMsgWindow might be null
   NS_ENSURE_ARG_POINTER(newsgroupsNames);
 
   NS_ENSURE_ARG(*newsgroupsNames);
 
-  NS_LOCK_INSTANCE();
-
   nsresult rv;
 
   nsCOMPtr <nsINntpUrl> nntpUrl = do_CreateInstance(NS_NNTPURL_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = nntpUrl->SetNewsAction(nsINntpUrl::ActionPostArticle);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -865,18 +862,16 @@ nsNntpService::PostMessage(nsIFile *aFil
 
   nsCOMPtr<nsIURI> url = do_QueryInterface(nntpUrl);
   rv = RunNewsUrl(url, aMsgWindow, nullptr /* consumer */);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (_retval)
     rv = CallQueryInterface(nntpUrl, _retval);
 
-  NS_UNLOCK_INSTANCE();
-
   return rv;
 }
 
 nsresult
 nsNntpService::ConstructNntpUrl(const char *urlString, nsIUrlListener *aUrlListener, nsIMsgWindow *aMsgWindow, const char *originalMessageUri, int32_t action, nsIURI ** aUrl)
 {
   nsresult rv = NS_OK;
 
@@ -1081,17 +1076,16 @@ nsNntpService::RunNewsUrl(nsIURI * aUri,
 
   return server->LoadNewsUrl(aUri, aMsgWindow, aConsumer);
 }
 
 NS_IMETHODIMP nsNntpService::GetNewNews(nsINntpIncomingServer *nntpServer, const char *uri, bool aGetOld, nsIUrlListener * aUrlListener, nsIMsgWindow *aMsgWindow, nsIURI **_retval)
 {
   NS_ENSURE_ARG_POINTER(uri);
 
-  NS_LOCK_INSTANCE();
   nsresult rv = NS_OK;
 
   nsCOMPtr<nsIMsgIncomingServer> server;
   server = do_QueryInterface(nntpServer);
 
   /* double check that it is a "news:/" url */
   if (strncmp(uri, kNewsRootURI, kNewsRootURILen) == 0)
   {
@@ -1116,18 +1110,16 @@ NS_IMETHODIMP nsNntpService::GetNewNews(
       NS_IF_ADDREF(*_retval = aUrl);
   }
   else
   {
     NS_ERROR("not a news:/ url");
     rv = NS_ERROR_FAILURE;
   }
 
-
-  NS_UNLOCK_INSTANCE();
   return rv;
 }
 
 NS_IMETHODIMP
 nsNntpService::CancelMessage(const char *cancelURL, const char *messageURI, nsISupports * aConsumer, nsIUrlListener * aUrlListener, nsIMsgWindow *aMsgWindow, nsIURI ** aURL)
 {
   nsresult rv;
   NS_ENSURE_ARG_POINTER(cancelURL);
--- a/mailnews/news/src/nsNntpUrl.cpp
+++ b/mailnews/news/src/nsNntpUrl.cpp
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "msgCore.h"    // precompiled header...
-#include "nsISupportsObsolete.h"
 
 #include "nsIURL.h"
 #include "nsNntpUrl.h"
 
 #include "nsStringGlue.h"
 #include "nsNewsUtils.h"
 #include "nsMsgUtils.h"