mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 06:15:43 +00:00
Moved nsMonitorable::MonitorLocker constructor and destructor into their
own cpp file. IRIX NuCache was not accepting inlined ones.
This commit is contained in:
parent
9773eecb93
commit
811ddc3c00
12
network/cache/nu/public/nsMonitorable.h
vendored
12
network/cache/nu/public/nsMonitorable.h
vendored
@ -29,6 +29,7 @@
|
||||
//#include "nsISupports.h"
|
||||
|
||||
#include "prmon.h"
|
||||
#include "prlog.h"
|
||||
|
||||
class nsMonitorable//: public nsISupports
|
||||
{
|
||||
@ -51,15 +52,8 @@ protected:
|
||||
class MonitorLocker
|
||||
{
|
||||
public:
|
||||
MonitorLocker(nsMonitorable* i_pThis):
|
||||
m_pMonitorable(i_pThis)
|
||||
{
|
||||
if (m_pMonitorable) m_pMonitorable->Lock();
|
||||
}
|
||||
~MonitorLocker()
|
||||
{
|
||||
if (m_pMonitorable) m_pMonitorable->Unlock();
|
||||
}
|
||||
MonitorLocker(nsMonitorable* i_pThis);
|
||||
~MonitorLocker();
|
||||
private:
|
||||
nsMonitorable* m_pMonitorable;
|
||||
};
|
||||
|
1
network/cache/nu/src/Makefile
vendored
1
network/cache/nu/src/Makefile
vendored
@ -44,6 +44,7 @@ CPPSRCS = nsCacheObject.cpp \
|
||||
CacheStubs.cpp \
|
||||
nsFileStream.cpp \
|
||||
nsMemStream.cpp \
|
||||
nsMonitorable.cpp \
|
||||
$(NULL)
|
||||
|
||||
REQUIRES = dbm nspr pref xpcom js
|
||||
|
1
network/cache/nu/src/makefile.win
vendored
1
network/cache/nu/src/makefile.win
vendored
@ -54,6 +54,7 @@ OBJS = \
|
||||
.\$(OBJDIR)\CacheStubs.obj \
|
||||
.\$(OBJDIR)\nsFileStream.obj \
|
||||
.\$(OBJDIR)\nsMemStream.obj \
|
||||
.\$(OBJDIR)\nsMonitorable.obj \
|
||||
$(NULL)
|
||||
|
||||
LINCS = \
|
||||
|
27
network/cache/nu/src/nsCacheManager.cpp
vendored
27
network/cache/nu/src/nsCacheManager.cpp
vendored
@ -24,6 +24,7 @@
|
||||
#include "prtypes.h"
|
||||
#include "prinrval.h"
|
||||
#include "plstr.h"
|
||||
#include "prprf.h" //PR_smprintf and PR_smprintf_free
|
||||
|
||||
#include "nsCacheManager.h"
|
||||
#include "nsCacheTrace.h"
|
||||
@ -196,17 +197,20 @@ nsCacheManager::GetModule(PRInt16 i_index) const
|
||||
void
|
||||
nsCacheManager::InfoAsHTML(char* o_Buffer) const
|
||||
{
|
||||
MonitorLocker ml((nsMonitorable*)this);
|
||||
char tmpbuffer[256];
|
||||
MonitorLocker ml((nsMonitorable*)this);
|
||||
|
||||
/* TODO - make this cool */
|
||||
sprintf(tmpbuffer, "<HTML><h2>Your cache has %d modules</h2> \
|
||||
It has a total of %d cache objects. Hang in there for the details. </HTML>\0",
|
||||
Entries(),
|
||||
NumberOfObjects());
|
||||
|
||||
PL_strncpyz(o_Buffer, tmpbuffer, PL_strlen(tmpbuffer)+1);
|
||||
}
|
||||
char* tmpBuffer =/* TODO - make this cool */
|
||||
PR_smprintf("<HTML><h2>Your cache has %d modules</h2> \
|
||||
It has a total of %d cache objects. Hang in there for the details. </HTML>\0",
|
||||
Entries(),
|
||||
NumberOfObjects());
|
||||
|
||||
if (tmpBuffer)
|
||||
{
|
||||
PL_strncpyz(o_Buffer, tmpBuffer, PL_strlen(tmpBuffer)+1);
|
||||
PR_smprintf_free(tmpBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsCacheManager::Init()
|
||||
@ -289,4 +293,5 @@ NumberOfObjects(void)
|
||||
objs += TheManager.GetModule(--i)->Entries();
|
||||
}
|
||||
return objs;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user