Bug 887048 - Use mozilla::MallocSizeOf instead of nsMallocSizeOfFun. r=Standard8, a=bustage fix for CLOSED TREE
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Wed, 26 Jun 2013 09:07:36 +0100
changeset 16013 63f411eb52f3cce0c7dd72a00df19aab480b37a3
parent 16012 6f04beca8b73a684e0ff660abd5d9b91e2393c74
child 16014 849aa4cab973baba26e5802b5debf520b5a4dd1c
push id1000
push userbugzilla@standard8.plus.com
push dateMon, 16 Sep 2013 20:21:48 +0000
treeherdercomm-beta@77f0178eb807 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8, bustage
bugs887048
Bug 887048 - Use mozilla::MallocSizeOf instead of nsMallocSizeOfFun. r=Standard8, a=bustage fix for CLOSED TREE
mailnews/db/msgdb/public/nsDBFolderInfo.h
mailnews/db/msgdb/public/nsMsgDatabase.h
mailnews/db/msgdb/public/nsMsgHdr.h
mailnews/db/msgdb/src/nsMsgDatabase.cpp
--- a/mailnews/db/msgdb/public/nsDBFolderInfo.h
+++ b/mailnews/db/msgdb/public/nsDBFolderInfo.h
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* This class encapsulates the global information about a folder stored in the
 	summary file.
 */
 #ifndef _nsDBFolderInfo_H
 #define _nsDBFolderInfo_H
 
+#include "mozilla/MemoryReporting.h"
 #include "nsStringGlue.h"
 #include "MailNewsTypes.h"
 #include "mdb.h"
 #include "nsTArray.h"
 #include "nsIDBFolderInfo.h"
 #include <time.h>
 
 class nsMsgDatabase;
@@ -55,21 +56,21 @@ public:
   nsresult GetUint32PropertyWithToken(mdb_token aProperty, uint32_t &propertyValue, uint32_t defaultValue = 0);
   nsresult GetInt32PropertyWithToken(mdb_token aProperty, int32_t &propertyValue, int32_t defaultValue = 0);
   nsresult SetUint64Property(const char *aProperty, uint64_t propertyValue);
   nsresult GetUint64PropertyWithToken(mdb_token columnToken,
                                       uint64_t *propertyValue);
 
   nsTArray<nsMsgKey> m_lateredKeys; // list of latered messages
 
-  virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
+  virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
   {
     return m_lateredKeys.SizeOfExcludingThis(aMallocSizeOf);
   }
-  virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
+  virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
   {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 protected:
 
   // initialize from appropriate table and row in existing db.
   nsresult InitMDBInfo();
   nsresult LoadMemberVariables();
--- a/mailnews/db/msgdb/public/nsMsgDatabase.h
+++ b/mailnews/db/msgdb/public/nsMsgDatabase.h
@@ -1,16 +1,17 @@
 /* -*- 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/. */
 
 #ifndef _nsMsgDatabase_H_
 #define _nsMsgDatabase_H_
 
+#include "mozilla/MemoryReporting.h"
 #include "nsIMsgDatabase.h"
 #include "nsMsgHdr.h"
 #include "nsStringGlue.h"
 #include "nsAutoPtr.h"
 #include "nsIDBChangeListener.h"
 #include "nsIDBChangeAnnouncer.h"
 #include "nsMsgMessageFlags.h"
 #include "nsIMsgFolder.h"
@@ -412,20 +413,20 @@ protected:
 
   // not-reference holding array of enumerators we've handed out.
   // If a db goes away, it will clean up the outstanding enumerators.
   nsTArray<nsMsgDBEnumerator *> m_enumerators;
 
   // Memory reporter details
 public:
   static size_t HeaderHashSizeOf(PLDHashEntryHdr *hdr,
-                                 nsMallocSizeOfFun aMallocSizeOf,
+                                 mozilla::MallocSizeOf aMallocSizeOf,
                                  void *arg);
-  virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
-  virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
+  virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
+  virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
   {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 private:
   uint32_t m_cacheSize;
   nsRefPtr<mozilla::mailnews::MsgDBReporter> mMemReporter;
 };
 
--- a/mailnews/db/msgdb/public/nsMsgHdr.h
+++ b/mailnews/db/msgdb/public/nsMsgHdr.h
@@ -1,16 +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/. */
 
 #ifndef _nsMsgHdr_H
 #define _nsMsgHdr_H
 
+#include "mozilla/MemoryReporting.h"
 #include "nsIMsgHdr.h"
 #include "nsStringGlue.h"
 #include "MailNewsTypes.h"
 #include "mdb.h"
 #include "nsTArray.h"
 
 class nsMsgDatabase;
 class nsCString;
@@ -36,21 +37,21 @@ public:
     NS_DECL_ISUPPORTS
 
     nsIMdbRow   *GetMDBRow() {return m_mdbRow;}
     bool        IsParentOf(nsIMsgDBHdr *possibleChild);
     bool        IsAncestorOf(nsIMsgDBHdr *possibleChild);
     bool        IsAncestorKilled(uint32_t ancestorsToCheck);
     void        ReparentInThread(nsIMsgThread *thread);
 
-    size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOfFun) const
+    size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOfFun) const
     {
       return m_references.SizeOfExcludingThis(aMallocSizeOfFun);
     }
-    size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOfFun) const
+    size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOfFun) const
     {
       return aMallocSizeOfFun(this) + SizeOfExcludingThis(aMallocSizeOfFun);
     }
 
 protected:
     nsresult SetStringColumn(const char *str, mdb_token token);
     nsresult SetUInt32Column(uint32_t value, mdb_token token);
     nsresult GetUInt32Column(mdb_token token, uint32_t *pvalue, uint32_t defaultValue = 0);
--- a/mailnews/db/msgdb/src/nsMsgDatabase.cpp
+++ b/mailnews/db/msgdb/src/nsMsgDatabase.cpp
@@ -998,27 +998,27 @@ void nsMsgDatabase::DumpCache()
       (const char*)db->m_dbName.get(),
       db->m_headersInUse ? db->m_headersInUse->entryCount : 0));
   }
 }
 
 // Memory Reporting implementations
 
 size_t nsMsgDatabase::HeaderHashSizeOf(PLDHashEntryHdr *hdr,
-                                       nsMallocSizeOfFun aMallocSizeOf,
+                                       mozilla::MallocSizeOf aMallocSizeOf,
                                        void *arg)
 {
   MsgHdrHashElement *entry = reinterpret_cast<MsgHdrHashElement*>(hdr);
   // Sigh, this is dangerous, but so long as this is a closed system, this is
   // safe.
   return static_cast<nsMsgHdr*>(entry->mHdr)->
     SizeOfIncludingThis(aMallocSizeOf);
 }
 
-size_t nsMsgDatabase::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
+size_t nsMsgDatabase::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
   size_t totalSize = 0;
   if (m_dbFolderInfo)
     totalSize += m_dbFolderInfo->SizeOfExcludingThis(aMallocSizeOf);
   if (m_mdbEnv)
   {
     nsIMdbHeap *morkHeap = nullptr;
     m_mdbEnv->GetHeap(&morkHeap);