Bug 634286. Remove font cache size info from about:support on Windows. r=jmuizelaar

This commit is contained in:
John Daggett 2011-04-19 10:11:09 +09:00
parent e95cda65f3
commit 4e1a8c20b8
3 changed files with 1 additions and 42 deletions

View File

@ -78,9 +78,6 @@
#endif #endif
#endif #endif
#include <shlobj.h>
#include <shlwapi.h>
#ifdef CAIRO_HAS_D2D_SURFACE #ifdef CAIRO_HAS_D2D_SURFACE
#include "gfxD2DSurface.h" #include "gfxD2DSurface.h"
@ -779,36 +776,6 @@ gfxWindowsPlatform::GetDLLVersion(const PRUnichar *aDLLPath, nsAString& aVersion
aVersion.Assign(NS_ConvertUTF8toUTF16(buf)); aVersion.Assign(NS_ConvertUTF8toUTF16(buf));
} }
void
gfxWindowsPlatform::GetFontCacheSize(nsAString& aSize)
{
WIN32_FIND_DATAW findFileData;
HANDLE file;
WCHAR path[MAX_PATH];
aSize.Assign(L"n/a");
if (FAILED(SHGetFolderPathW(NULL, CSIDL_WINDOWS, NULL, 0, path))) {
return;
}
PathAppendW(path,
L"ServiceProfiles\\LocalService\\AppData\\Local\\FontCache-*-*.dat");
file = FindFirstFileW(path, &findFileData);
if (file == INVALID_HANDLE_VALUE) {
return;
}
WCHAR size[256];
double sizeMB = (double(findFileData.nFileSizeLow) +
findFileData.nFileSizeHigh * (double(MAXDWORD) + 1))
/ 1000000.0;
swprintf_s(size, NS_ARRAY_LENGTH(size), L"%.2f MB", sizeMB);
aSize.Assign(size);
FindClose(file);
}
void void
gfxWindowsPlatform::FontsPrefsChanged(nsIPrefBranch *aPrefBranch, const char *aPref) gfxWindowsPlatform::FontsPrefsChanged(nsIPrefBranch *aPrefBranch, const char *aPref)
{ {

View File

@ -236,8 +236,6 @@ public:
static void GetDLLVersion(const PRUnichar *aDLLPath, nsAString& aVersion); static void GetDLLVersion(const PRUnichar *aDLLPath, nsAString& aVersion);
static void GetFontCacheSize(nsAString& aSize);
virtual void FontsPrefsChanged(nsIPrefBranch *aPrefBranch, const char *aPref); virtual void FontsPrefsChanged(nsIPrefBranch *aPrefBranch, const char *aPref);
#ifdef CAIRO_HAS_DWRITE_FONT #ifdef CAIRO_HAS_DWRITE_FONT

View File

@ -102,13 +102,7 @@ GfxInfo::GetDWriteEnabled(PRBool *aEnabled)
NS_IMETHODIMP NS_IMETHODIMP
GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion) GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion)
{ {
nsAutoString str; gfxWindowsPlatform::GetPlatform()->GetDLLVersion(L"dwrite.dll", aDwriteVersion);
gfxWindowsPlatform::GetPlatform()->GetDLLVersion(L"dwrite.dll", str);
aDwriteVersion.Assign(str);
aDwriteVersion.Append(L", font cache ");
gfxWindowsPlatform::GetPlatform()->GetFontCacheSize(str);
aDwriteVersion.Append(str);
return NS_OK; return NS_OK;
} }