2008-03-06 04:28:25 +03:00
|
|
|
|
|
|
|
#include "nsIMemoryReporter.h"
|
|
|
|
#include "nsCOMArray.h"
|
2010-12-15 20:47:16 +03:00
|
|
|
#include "mozilla/Mutex.h"
|
2011-10-28 11:35:45 +04:00
|
|
|
#include "nsString.h"
|
2010-12-15 20:47:16 +03:00
|
|
|
|
|
|
|
using mozilla::Mutex;
|
2008-03-06 04:28:25 +03:00
|
|
|
|
2011-02-16 21:43:23 +03:00
|
|
|
class nsMemoryReporter : public nsIMemoryReporter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIMEMORYREPORTER
|
|
|
|
|
2011-07-08 06:45:16 +04:00
|
|
|
nsMemoryReporter(nsACString& process,
|
|
|
|
nsACString& path,
|
2011-05-23 06:49:56 +04:00
|
|
|
PRInt32 kind,
|
2011-06-16 22:34:09 +04:00
|
|
|
PRInt32 units,
|
|
|
|
PRInt64 amount,
|
2011-07-08 06:45:16 +04:00
|
|
|
nsACString& desc);
|
2011-02-16 21:43:23 +03:00
|
|
|
|
|
|
|
~nsMemoryReporter();
|
|
|
|
|
|
|
|
protected:
|
2011-06-06 05:22:45 +04:00
|
|
|
nsCString mProcess;
|
2011-05-24 14:35:10 +04:00
|
|
|
nsCString mPath;
|
|
|
|
PRInt32 mKind;
|
2011-06-16 22:34:09 +04:00
|
|
|
PRInt32 mUnits;
|
|
|
|
PRInt64 mAmount;
|
2011-05-24 14:35:10 +04:00
|
|
|
nsCString mDesc;
|
2011-02-16 21:43:23 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-06 04:28:25 +03:00
|
|
|
class nsMemoryReporterManager : public nsIMemoryReporterManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIMEMORYREPORTERMANAGER
|
|
|
|
|
2010-12-15 20:47:16 +03:00
|
|
|
nsMemoryReporterManager();
|
|
|
|
virtual ~nsMemoryReporterManager();
|
|
|
|
|
2008-03-06 04:28:25 +03:00
|
|
|
private:
|
2011-06-30 03:39:32 +04:00
|
|
|
nsCOMArray<nsIMemoryReporter> mReporters;
|
|
|
|
nsCOMArray<nsIMemoryMultiReporter> mMultiReporters;
|
|
|
|
Mutex mMutex;
|
2008-03-06 04:28:25 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#define NS_MEMORY_REPORTER_MANAGER_CID \
|
|
|
|
{ 0xfb97e4f5, 0x32dd, 0x497a, \
|
|
|
|
{ 0xba, 0xa2, 0x7d, 0x1e, 0x55, 0x7, 0x99, 0x10 } }
|