Bug 1329859 - Port bug 1329857 to mailnews: Remove NS_METHOD uses. r=jorgk
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 10 Jan 2017 14:09:50 +1100
changeset 20995 29fb1e7ca57265c7a8fcdedaac46811adcc28056
parent 20994 a711acf48336796734ad2189fbc8729f378a62fb
child 20996 7e17cf07b4e8448ffe395a81812e2f9d3b8014da
push id12736
push usermozilla@jorgk.com
push dateWed, 11 Jan 2017 15:43:54 +0000
treeherdercomm-central@29fb1e7ca572 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk
bugs1329859, 1329857
Bug 1329859 - Port bug 1329857 to mailnews: Remove NS_METHOD uses. r=jorgk Bug 1329857 is going to remove NS_METHOD. The handful of uses in mailnews/ can be replaced easily.
mailnews/import/src/nsImportABDescriptor.cpp
mailnews/import/src/nsImportABDescriptor.h
mailnews/import/src/nsImportFieldMap.cpp
mailnews/import/src/nsImportFieldMap.h
mailnews/import/src/nsImportMailboxDescriptor.cpp
mailnews/import/src/nsImportMailboxDescriptor.h
mailnews/import/src/nsImportMimeEncode.cpp
mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.h
mailnews/news/src/nsNNTPNewsgroupList.h
--- a/mailnews/import/src/nsImportABDescriptor.cpp
+++ b/mailnews/import/src/nsImportABDescriptor.cpp
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "nscore.h"
 #include "nsImportABDescriptor.h"
 
 ////////////////////////////////////////////////////////////////////////
 
-NS_METHOD nsImportABDescriptor::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
+nsresult nsImportABDescriptor::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
 {
   if (aOuter)
     return NS_ERROR_NO_AGGREGATION;
 
   nsImportABDescriptor *it = new nsImportABDescriptor();
   if (it == nullptr)
     return NS_ERROR_OUT_OF_MEMORY;
 
--- a/mailnews/import/src/nsImportABDescriptor.h
+++ b/mailnews/import/src/nsImportABDescriptor.h
@@ -82,17 +82,17 @@ public:
   }
   NS_IMETHOD SetImport(bool doImport) override {
     mImport = doImport;
     return NS_OK;
   }
 
   nsImportABDescriptor();
 
-  static NS_METHOD Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
+  static nsresult Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
 
 private:
   virtual ~nsImportABDescriptor() {}
   uint32_t mId; // used by creator of the structure
   uint32_t mRef; // depth in the hierarchy
   nsString mDisplayName; // name of this mailbox
   nsCOMPtr<nsIFile> mFile; // source file (if applicable)
   uint32_t mSize; // size
--- a/mailnews/import/src/nsImportFieldMap.cpp
+++ b/mailnews/import/src/nsImportFieldMap.cpp
@@ -9,17 +9,17 @@
 #include "nsImportFieldMap.h"
 #include "nsImportStringBundle.h"
 #include "nsCRTGlue.h"
 #include "ImportDebug.h"
 #include "nsCOMPtr.h"
 
 ////////////////////////////////////////////////////////////////////////
 
-NS_METHOD nsImportFieldMap::Create(nsIStringBundle *aBundle, nsISupports *aOuter, REFNSIID aIID, void **aResult)
+nsresult nsImportFieldMap::Create(nsIStringBundle *aBundle, nsISupports *aOuter, REFNSIID aIID, void **aResult)
 {
   if (aOuter)
     return NS_ERROR_NO_AGGREGATION;
 
   nsImportFieldMap *it = new nsImportFieldMap(aBundle);
   if (it == nullptr)
     return NS_ERROR_OUT_OF_MEMORY;
 
--- a/mailnews/import/src/nsImportFieldMap.h
+++ b/mailnews/import/src/nsImportFieldMap.h
@@ -21,17 +21,17 @@ class nsImportFieldMap : public nsIImpor
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
   NS_DECL_NSIIMPORTFIELDMAP
 
   nsImportFieldMap(nsIStringBundle *aBundle);
 
-   static NS_METHOD Create(nsIStringBundle *aBundle, nsISupports *aOuter, REFNSIID aIID, void **aResult);
+  static nsresult Create(nsIStringBundle *aBundle, nsISupports *aOuter, REFNSIID aIID, void **aResult);
 
 private:
   virtual ~nsImportFieldMap();
   nsresult  Allocate(int32_t newSize);
 
 private:
   int32_t    m_numFields;
   int32_t  *  m_pFields;
--- a/mailnews/import/src/nsImportMailboxDescriptor.cpp
+++ b/mailnews/import/src/nsImportMailboxDescriptor.cpp
@@ -7,17 +7,17 @@
 #include "nscore.h"
 #include "nsImportMailboxDescriptor.h"
 #include "nsComponentManagerUtils.h"
 
 ////////////////////////////////////////////////////////////////////////
 
 
 
-NS_METHOD nsImportMailboxDescriptor::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
+nsresult nsImportMailboxDescriptor::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
 {
   if (aOuter)
     return NS_ERROR_NO_AGGREGATION;
 
   nsImportMailboxDescriptor *it = new nsImportMailboxDescriptor();
   if (it == nullptr)
     return NS_ERROR_OUT_OF_MEMORY;
 
--- a/mailnews/import/src/nsImportMailboxDescriptor.h
+++ b/mailnews/import/src/nsImportMailboxDescriptor.h
@@ -42,17 +42,17 @@ public:
 
   /* readonly attribute nsIFile file; */
   NS_IMETHOD GetFile(nsIFile * *aFile) override { if (m_pFile) { NS_ADDREF(*aFile = m_pFile); return NS_OK;} else return NS_ERROR_FAILURE; }
 
 
 
   nsImportMailboxDescriptor();
 
-   static NS_METHOD Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
+  static nsresult Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
 
 private:
   virtual ~nsImportMailboxDescriptor() {}
   uint32_t    m_id;      // used by creator of the structure
   uint32_t    m_depth;    // depth in the hierarchy
   nsString    m_displayName;// name of this mailbox
   nsCOMPtr <nsIFile> m_pFile;  // source file (if applicable)
   uint32_t    m_size;
--- a/mailnews/import/src/nsImportMimeEncode.cpp
+++ b/mailnews/import/src/nsImportMimeEncode.cpp
@@ -358,49 +358,49 @@ nsIImportMimeEncodeImpl::~nsIImportMimeE
   if (m_pOut)
     delete m_pOut;
   if (m_pEncode)
     delete m_pEncode;
 }
 
 NS_IMPL_ISUPPORTS(nsIImportMimeEncodeImpl, nsIImportMimeEncode)
 
-NS_METHOD nsIImportMimeEncodeImpl::EncodeFile(nsIFile *inFile, nsIFile *outFile, const char *fileName, const char *mimeType)
+NS_IMETHODIMP nsIImportMimeEncodeImpl::EncodeFile(nsIFile *inFile, nsIFile *outFile, const char *fileName, const char *mimeType)
 {
   return Initialize(inFile, outFile, fileName, mimeType);
 }
 
-NS_METHOD nsIImportMimeEncodeImpl::DoWork(bool *done, bool *_retval)
+NS_IMETHODIMP nsIImportMimeEncodeImpl::DoWork(bool *done, bool *_retval)
 {
   if (done && _retval && m_pEncode) {
     *_retval = m_pEncode->DoWork(done);
     return NS_OK;
   }
   return NS_ERROR_FAILURE;
 }
 
-NS_METHOD nsIImportMimeEncodeImpl::NumBytesProcessed(int32_t *_retval)
+NS_IMETHODIMP nsIImportMimeEncodeImpl::NumBytesProcessed(int32_t *_retval)
 {
   if (m_pEncode && _retval)
     *_retval = m_pEncode->NumBytesProcessed();
   return NS_OK;
 }
 
-NS_METHOD nsIImportMimeEncodeImpl::DoEncoding(bool *_retval)
+NS_IMETHODIMP nsIImportMimeEncodeImpl::DoEncoding(bool *_retval)
 {
   if (_retval && m_pEncode) {
     bool    done = false;
     while (m_pEncode->DoWork(&done) && !done);
     *_retval = done;
     return NS_OK;
   }
   return NS_ERROR_FAILURE;
 }
 
-NS_METHOD nsIImportMimeEncodeImpl::Initialize(nsIFile *inFile, nsIFile *outFile, const char *fileName, const char *mimeType)
+NS_IMETHODIMP nsIImportMimeEncodeImpl::Initialize(nsIFile *inFile, nsIFile *outFile, const char *fileName, const char *mimeType)
 {
   delete m_pEncode;
   delete m_pOut;
 
   m_pOut = new ImportOutFile();
   m_pOut->InitOutFile(outFile);
 
   m_pEncode = new nsImportMimeEncode();
--- a/mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.h
+++ b/mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.h
@@ -35,17 +35,17 @@ public:
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSIREQUEST
   NS_DECL_NSIINPUTSTREAM
 
   nsPgpMimeProxy();
 
   // Define a Create method to be used with a factory:
-  static NS_METHOD
+  static nsresult
   Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
 
 protected:
   virtual ~nsPgpMimeProxy();
   bool                          mInitialized;
   nsCOMPtr<nsIStreamListener>   mDecryptor;
 
   MimeDecodeCallbackFun         mOutputFun;
--- a/mailnews/news/src/nsNNTPNewsgroupList.h
+++ b/mailnews/news/src/nsNNTPNewsgroupList.h
@@ -56,17 +56,17 @@ public:
   nsNNTPNewsgroupList();
   NS_DECL_ISUPPORTS
   NS_DECL_NSINNTPNEWSGROUPLIST
   NS_DECL_NSIMSGFILTERHITNOTIFY
 
 private:
   virtual  ~nsNNTPNewsgroupList();
 
-  NS_METHOD CleanUp();
+  nsresult CleanUp();
      
   bool    m_finishingXover;
 
 #ifdef HAVE_CHANGELISTENER
   virtual void OnAnnouncerGoingAway (ChangeAnnouncer *instigator);
 #endif
   nsresult ParseLine(char *line, uint32_t *message_number);
   nsresult GetDatabase(const char *uri, nsIMsgDatabase **db);