Bug 631993 - Remove obsolete static variable that seems to do one-off leaks in unit tests, and some other obsolete member vars in nsImapMailFolder; r=bienvenu
authorMark Banner <bugzilla@standard8.plus.com>
Wed, 09 Feb 2011 22:35:26 +0000
changeset 7118 33c7875eb77cda6eb7ce76778f3ab7d977b0c5f0
parent 7117 e592a1db76523a566e97fcaf02153bac6eaec2b1
child 7119 2aa02a11be391f444e699133575a82d57c124848
push idunknown
push userunknown
push dateunknown
reviewersbienvenu
bugs631993
Bug 631993 - Remove obsolete static variable that seems to do one-off leaks in unit tests, and some other obsolete member vars in nsImapMailFolder; r=bienvenu
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/imap/src/nsImapMailFolder.h
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -134,18 +134,16 @@
 #include "nsAlgorithm.h"
 #include "nsPrintfCString.h"
 #include "nsMsgLineBuffer.h"
 
 static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
 static NS_DEFINE_CID(kParseMailMsgStateCID, NS_PARSEMAILMSGSTATE_CID);
 static NS_DEFINE_CID(kCImapHostSessionList, NS_IIMAPHOSTSESSIONLIST_CID);
 
-nsIAtom* nsImapMailFolder::mImapHdrDownloadedAtom = nsnull;
-
 extern PRLogModuleInfo *gAutoSyncLog;
 extern PRLogModuleInfo* IMAP;
 
 #define FOUR_K 4096
 #define MAILNEWS_CUSTOM_HEADERS "mailnews.customHeaders"
 
 /*
     Copies the contents of srcDir into destDir.
@@ -211,17 +209,16 @@ nsresult RecursiveCopy(nsIFile* srcDir, 
     if (NS_FAILED(rv)) return rv;
   }
 
   return rv;
 }
 
 nsImapMailFolder::nsImapMailFolder() :
     m_initialized(PR_FALSE),m_haveDiscoveredAllFolders(PR_FALSE),
-    m_haveReadNameFromDB(PR_FALSE),
     m_curMsgUid(0), m_nextMessageByteLength(0),
     m_urlRunning(PR_FALSE),
     m_verifiedAsOnlineFolder(PR_FALSE),
     m_explicitlyVerify(PR_FALSE),
     m_folderIsNamespace(PR_FALSE),
     m_folderNeedsSubscribing(PR_FALSE),
     m_folderNeedsAdded(PR_FALSE),
     m_folderNeedsACLListed(PR_TRUE),
@@ -234,47 +231,36 @@ nsImapMailFolder::nsImapMailFolder() :
     m_folderQuotaMaxKB(0),
     m_compactingOfflineStore(PR_FALSE),
     m_expunging(PR_FALSE),
     m_applyIncomingFilters(PR_FALSE),
     m_filterListRequiresBody(PR_FALSE)
 {
   MOZ_COUNT_CTOR(nsImapMailFolder); // double count these for now.
 
-  if (mImapHdrDownloadedAtom == nsnull)
-    mImapHdrDownloadedAtom = MsgNewAtom("ImapHdrDownloaded");
-  m_appendMsgMonitor = nsnull;  // since we're not using this (yet?) make it null.
-  // if we do start using it, it should be created lazily
-
   m_thread = do_GetCurrentThread();
   m_moveCoalescer = nsnull;
   m_boxFlags = 0;
   m_uidValidity = kUidUnknown;
-  m_highestModSeq = 0;
   m_numServerRecentMessages = 0;
   m_numServerUnseenMessages = 0;
   m_numServerTotalMessages = 0;
   m_nextUID = nsMsgKey_None;
   m_hierarchyDelimiter = kOnlineHierarchySeparatorUnknown;
   m_folderACL = nsnull;
   m_aclFlags = 0;
   m_supportedUserFlags = 0;
   m_namespace = nsnull;
   m_pendingPlaybackReq = nsnull;
 }
 
 nsImapMailFolder::~nsImapMailFolder()
 {
   MOZ_COUNT_DTOR(nsImapMailFolder);
-  if (m_appendMsgMonitor)
-      PR_DestroyMonitor(m_appendMsgMonitor);
-
-  // I think our destructor gets called before the base class...
-  if (mInstanceCount == 1)
-    NS_IF_RELEASE(mImapHdrDownloadedAtom);
+
   NS_IF_RELEASE(m_moveCoalescer);
   delete m_folderACL;
     
   // cleanup any pending request
   delete m_pendingPlaybackReq;
 }
 
 NS_IMPL_ADDREF_INHERITED(nsImapMailFolder, nsMsgDBFolder)
--- a/mailnews/imap/src/nsImapMailFolder.h
+++ b/mailnews/imap/src/nsImapMailFolder.h
@@ -451,32 +451,29 @@ protected:
   
   nsresult CreatePlaybackTimer();
   
   // Allocate and initialize associated auto-sync state object 
   void InitAutoSyncState();
 
   PRBool m_initialized;
   PRBool m_haveDiscoveredAllFolders;
-  PRBool m_haveReadNameFromDB;
   nsCOMPtr<nsIMsgParseMailMsgState> m_msgParser;
   nsCOMPtr<nsIMsgFilterList> m_filterList;
   nsCOMPtr<nsIMsgFilterPlugin> m_filterPlugin;  // XXX should be a list
   // used with filter plugins to know when we've finished classifying and can playback moves
   PRBool m_msgMovedByFilter;
   nsImapMoveCoalescer *m_moveCoalescer; // strictly owned by the nsImapMailFolder
   nsCOMPtr<nsIMutableArray> m_junkMessagesToMarkAsRead;
   /// list of keys to be moved to the junk folder
   nsTArray<nsMsgKey> mSpamKeysToMove;
   /// the junk destination folder
   nsCOMPtr<nsIMsgFolder> mSpamFolder;
   nsMsgKey m_curMsgUid;
   PRUint32 m_uidValidity;
-  // used for condstore support;
-  PRUint64 m_highestModSeq;
 
   // These three vars are used to store counts from STATUS or SELECT command
   // They include deleted messages, so they can differ from the generic
   // folder total and unread counts.
   PRInt32 m_numServerRecentMessages; 
   PRInt32 m_numServerUnseenMessages;
   PRInt32 m_numServerTotalMessages;
   // if server supports UIDNEXT, we store it here.
@@ -485,17 +482,16 @@ protected:
   PRInt32  m_nextMessageByteLength;
   nsCOMPtr<nsIThread> m_thread;
   nsCOMPtr<nsIUrlListener> m_urlListener;
   PRBool m_urlRunning;
 
   // *** jt - undo move/copy trasaction support
   nsRefPtr<nsMsgTxn> m_pendingUndoTxn;
   nsCOMPtr<nsImapMailCopyState> m_copyState;
-  PRMonitor *m_appendMsgMonitor;
   char m_hierarchyDelimiter;
   PRInt32 m_boxFlags;
   nsCString m_onlineFolderName;
   nsCString m_ownerUserName;  // username of the "other user," as in
   // "Other Users' Mailboxes"
 
   nsCString m_adminUrl;   // url to run to set admin privileges for this folder
   nsIMAPNamespace  *m_namespace;
@@ -513,18 +509,16 @@ protected:
   // when to send a done notification.
   PRPackedBool m_compactingOfflineStore;
   PRPackedBool m_expunging;
   PRPackedBool m_applyIncomingFilters; // apply filters to this folder, even if not the inbox
   nsMsgIMAPFolderACL *m_folderACL;
   PRUint32     m_aclFlags;
   PRUint32     m_supportedUserFlags;
 
-  static nsIAtom* mImapHdrDownloadedAtom;
-
   // offline imap support
   PRBool m_downloadingFolderForOfflineUse;
   PRBool m_filterListRequiresBody;
 
   // auto-sync (preemptive download) support
   nsRefPtr<nsAutoSyncState> m_autoSyncStateObj;
 
   // Quota support