2008-03-05 17:28:25 -08:00
|
|
|
|
|
|
|
#include "nsIMemoryReporter.h"
|
|
|
|
#include "nsCOMArray.h"
|
2010-12-15 09:47:16 -08:00
|
|
|
#include "mozilla/Mutex.h"
|
|
|
|
|
|
|
|
using mozilla::Mutex;
|
2008-03-05 17:28:25 -08:00
|
|
|
|
2011-02-16 10:43:23 -08:00
|
|
|
class nsMemoryReporter : public nsIMemoryReporter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIMEMORYREPORTER
|
|
|
|
|
|
|
|
nsMemoryReporter(nsCString& prefix,
|
|
|
|
nsCString& path,
|
2011-05-22 19:49:56 -07:00
|
|
|
PRInt32 kind,
|
2011-02-16 10:43:23 -08:00
|
|
|
nsCString& desc,
|
|
|
|
PRInt64 memoryUsed);
|
|
|
|
|
|
|
|
~nsMemoryReporter();
|
|
|
|
|
|
|
|
protected:
|
2011-05-24 03:35:10 -07:00
|
|
|
nsCString mPath;
|
|
|
|
PRInt32 mKind;
|
|
|
|
nsCString mDesc;
|
|
|
|
PRInt64 mMemoryUsed;
|
2011-02-16 10:43:23 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-05 17:28:25 -08:00
|
|
|
class nsMemoryReporterManager : public nsIMemoryReporterManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIMEMORYREPORTERMANAGER
|
|
|
|
|
2010-12-15 09:47:16 -08:00
|
|
|
nsMemoryReporterManager();
|
|
|
|
virtual ~nsMemoryReporterManager();
|
|
|
|
|
2008-03-05 17:28:25 -08:00
|
|
|
private:
|
|
|
|
nsCOMArray<nsIMemoryReporter> mReporters;
|
2010-12-15 09:47:16 -08:00
|
|
|
Mutex mMutex;
|
2008-03-05 17:28:25 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
#define NS_MEMORY_REPORTER_MANAGER_CID \
|
|
|
|
{ 0xfb97e4f5, 0x32dd, 0x497a, \
|
|
|
|
{ 0xba, 0xa2, 0x7d, 0x1e, 0x55, 0x7, 0x99, 0x10 } }
|