Inlined pref accessor/modifiers.

This commit is contained in:
gagan%netscape.com 1998-09-29 21:18:53 +00:00
parent 007c8243a7
commit b9a3a75996
4 changed files with 57 additions and 43 deletions

View File

@ -29,6 +29,7 @@
//#include "nsISupports.h"
#include "prtypes.h"
#include "prlog.h"
class nsCachePref //: public nsISupports
{
@ -91,5 +92,56 @@ private:
PRUint32 m_BkgSleepTime;
};
inline
PRUint32 nsCachePref::DiskCacheSize()
{
return m_DiskCacheSize;
}
inline
void nsCachePref::DiskCacheSize(const PRUint32 i_Size)
{
m_DiskCacheSize = i_Size;
}
inline
PRBool nsCachePref::DiskCacheSSL(void)
{
return m_bDiskCacheSSL;
}
inline
void nsCachePref::DiskCacheSSL(PRBool bSet)
{
m_bDiskCacheSSL = bSet;
}
inline
const char*
nsCachePref::DiskCacheFolder(void)
{
PR_ASSERT(m_DiskCacheFolder);
return m_DiskCacheFolder;
}
inline
PRUint32 nsCachePref::MemCacheSize()
{
return m_MemCacheSize;
}
inline
void nsCachePref::MemCacheSize(const PRUint32 i_Size)
{
m_MemCacheSize = i_Size;
}
inline
PRBool nsCachePref::RevalidateInBkg(void)
{
return m_bRevalidateInBkg;
}
#endif // nsCachePref_h__

View File

@ -33,7 +33,7 @@ LLIBS = \
$(DIST)\lib\libplc21.lib \
$(DIST)\lib\dbm32.lib \
$(DIST)\lib\xpcom32.lib \
$(DIST)\lib\libpref.lib \
$(DIST)\lib\libpref.lib \
$(NULL)
MISCDEP = $(LLIBS)

View File

@ -137,57 +137,17 @@ nsCachePref::BkgSleepTime(void)
return BKG_THREAD_SLEEP;
}
PRUint32 nsCachePref::DiskCacheSize()
{
return m_DiskCacheSize;
}
void nsCachePref::DiskCacheSize(const PRUint32 i_Size)
{
m_DiskCacheSize = i_Size;
}
PRBool nsCachePref::DiskCacheSSL(void)
{
return m_bDiskCacheSSL;
}
void nsCachePref::DiskCacheSSL(PRBool bSet)
{
m_bDiskCacheSSL = bSet;
}
const char* nsCachePref::DiskCacheDBFilename(void)
{
return "fat.db";
}
const char* nsCachePref::DiskCacheFolder(void)
{
return "";
}
nsCachePref* nsCachePref::GetInstance()
{
PR_ASSERT(nsCacheManager::GetInstance()->GetPrefs());
return nsCacheManager::GetInstance()->GetPrefs();
}
PRUint32 nsCachePref::MemCacheSize()
{
return m_MemCacheSize;
}
void nsCachePref::MemCacheSize(const PRUint32 i_Size)
{
m_MemCacheSize = i_Size;
}
PRBool nsCachePref::RevalidateInBkg(void)
{
return m_bRevalidateInBkg;
}
/*
nsrefcnt nsCachePref::AddRef(void)
{

View File

@ -27,8 +27,9 @@
#include "prmem.h"
#include "plstr.h"
#include "prlog.h"
#include "prclist.h"
#include "prio.h"
#include "prclist.h"
#include "prio.h"
#include "prsystem.h" // Directory Separator
#include "nsDiskModule.h"
#include "nsCacheObject.h"
@ -444,6 +445,7 @@ char* FullFilename(const char* i_Filename)
return 0;
}
PL_strcpy(g_FullFilename, nsCachePref::GetInstance()->DiskCacheFolder());
PL_strcat(g_FullFilename, (const char*)PR_GetDirectorySepartor()); //spelling check later as nspr fixes it.
PL_strcat(g_FullFilename, i_Filename);
return g_FullFilename;
}