Bug 538813. Make about:cache and about:cache-entry pretty. r=bzbarsky

This commit is contained in:
Steffen Wilberg 2010-07-02 16:56:09 -04:00
Родитель aaf59d3e92
Коммит 21ba20caa3
9 изменённых файлов: 331 добавлений и 95 удалений

9
netwerk/cache/nsDiskCacheDevice.cpp поставляемый
Просмотреть файл

@ -190,7 +190,9 @@ NS_IMETHODIMP nsDiskCacheDeviceInfo::GetUsageReport(char ** usageReport)
NS_ENSURE_ARG_POINTER(usageReport); NS_ENSURE_ARG_POINTER(usageReport);
nsCString buffer; nsCString buffer;
buffer.AssignLiteral("\n<tr>\n<td><b>Cache Directory:</b></td>\n<td><tt> "); buffer.AssignLiteral(" <tr>\n"
" <th>Cache Directory:</th>\n"
" <td>");
nsCOMPtr<nsILocalFile> cacheDir; nsCOMPtr<nsILocalFile> cacheDir;
nsAutoString path; nsAutoString path;
mDevice->getCacheDirectory(getter_AddRefs(cacheDir)); mDevice->getCacheDirectory(getter_AddRefs(cacheDir));
@ -200,8 +202,9 @@ NS_IMETHODIMP nsDiskCacheDeviceInfo::GetUsageReport(char ** usageReport)
} else { } else {
buffer.AppendLiteral("directory unavailable"); buffer.AppendLiteral("directory unavailable");
} }
buffer.AppendLiteral("</tt></td>\n</tr>\n"); buffer.AppendLiteral("</td>\n"
// buffer.Append("<tr><td><b>Files:</b></td><td><tt> XXX</tt></td></tr>"); " </tr>\n");
*usageReport = ToNewCString(buffer); *usageReport = ToNewCString(buffer);
if (!*usageReport) return NS_ERROR_OUT_OF_MEMORY; if (!*usageReport) return NS_ERROR_OUT_OF_MEMORY;

9
netwerk/cache/nsDiskCacheDeviceSQL.cpp поставляемый
Просмотреть файл

@ -278,8 +278,9 @@ NS_IMETHODIMP
nsOfflineCacheDeviceInfo::GetUsageReport(char ** usageReport) nsOfflineCacheDeviceInfo::GetUsageReport(char ** usageReport)
{ {
nsCAutoString buffer; nsCAutoString buffer;
buffer.AppendLiteral("\n<tr>\n<td><b>Cache Directory:</b></td>\n<td><tt> "); buffer.AssignLiteral(" <tr>\n"
" <th>Cache Directory:</th>\n"
" <td>");
nsILocalFile *cacheDir = mDevice->CacheDirectory(); nsILocalFile *cacheDir = mDevice->CacheDirectory();
if (!cacheDir) if (!cacheDir)
return NS_OK; return NS_OK;
@ -290,7 +291,9 @@ nsOfflineCacheDeviceInfo::GetUsageReport(char ** usageReport)
AppendUTF16toUTF8(path, buffer); AppendUTF16toUTF8(path, buffer);
else else
buffer.AppendLiteral("directory unavailable"); buffer.AppendLiteral("directory unavailable");
buffer.AppendLiteral("</tt></td>\n</tr>\n");
buffer.AppendLiteral("</td>\n"
" </tr>\n");
*usageReport = ToNewCString(buffer); *usageReport = ToNewCString(buffer);
if (!*usageReport) if (!*usageReport)

9
netwerk/cache/nsMemoryCacheDevice.cpp поставляемый
Просмотреть файл

@ -537,10 +537,13 @@ nsMemoryCacheDeviceInfo::GetUsageReport(char ** result)
NS_ENSURE_ARG_POINTER(result); NS_ENSURE_ARG_POINTER(result);
nsCString buffer; nsCString buffer;
buffer.AssignLiteral("\n<tr>\n<td><b>Inactive storage:</b></td>\n<td><tt> "); buffer.AssignLiteral(" <tr>\n"
" <th>Inactive storage:</th>\n"
" <td>");
buffer.AppendInt(mDevice->mInactiveSize / 1024); buffer.AppendInt(mDevice->mInactiveSize / 1024);
buffer.AppendLiteral(" KiB</tt></td>\n</tr>\n"); buffer.AppendLiteral(" KiB</td>\n"
" </tr>\n");
*result = ToNewCString(buffer); *result = ToNewCString(buffer);
if (!*result) return NS_ERROR_OUT_OF_MEMORY; if (!*result) return NS_ERROR_OUT_OF_MEMORY;
return NS_OK; return NS_OK;

Просмотреть файл

@ -20,9 +20,10 @@
* the Initial Developer. All Rights Reserved. * the Initial Developer. All Rights Reserved.
* *
* Contributor(s): * Contributor(s):
* Alexey Chernyak <alexeyc@bigfoot.com> (XHTML 1.1 conversion)
* Henrik Gemal <mozilla@gemal.dk> * Henrik Gemal <mozilla@gemal.dk>
* Darin Fisher <darin@netscape.com> * Darin Fisher <darin@netscape.com>
* Alexey Chernyak <alexeyc@bigfoot.com> (XHTML 1.1 conversion)
* Steffen Wilberg <steffen.wilberg@web.de> (new layout)
* *
* Alternatively, the contents of this file may be used under the terms of * Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or * either the GNU General Public License Version 2 or later (the "GPL"), or
@ -96,12 +97,17 @@ nsAboutCache::NewChannel(nsIURI *aURI, nsIChannel **result)
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
mBuffer.AssignLiteral( mBuffer.AssignLiteral(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" "<!DOCTYPE html>\n"
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n" "<html>\n"
" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n" "<head>\n"
"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" " <title>Information about the Cache Service</title>\n"
"<head>\n<title>Information about the Cache Service</title>\n</head>\n" " <link rel=\"stylesheet\" "
"<body>\n<div>\n"); "href=\"chrome://global/skin/about.css\" type=\"text/css\"/>\n"
" <link rel=\"stylesheet\" "
"href=\"chrome://global/skin/aboutCache.css\" type=\"text/css\"/>\n"
"</head>\n"
"<body class=\"aboutPageWideContainer\">\n"
"<h1>Information about the Cache Service</h1>\n");
outputStream->Write(mBuffer.get(), mBuffer.Length(), &bytesWritten); outputStream->Write(mBuffer.get(), mBuffer.Length(), &bytesWritten);
@ -109,6 +115,12 @@ nsAboutCache::NewChannel(nsIURI *aURI, nsIChannel **result)
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
mStream = outputStream; mStream = outputStream;
// nsCacheService::VisitEntries calls nsMemoryCacheDevice::Visit,
// nsDiskCacheDevice::Visit and nsOfflineCacheDevice::Visit,
// each of which call
// 1. VisitDevice (for about:cache),
// 2. VisitEntry in a loop (for about:cache?device=disk etc.)
rv = cacheService->VisitEntries(this); rv = cacheService->VisitEntries(this);
mBuffer.Truncate(); mBuffer.Truncate();
if (rv == NS_ERROR_NOT_AVAILABLE) { if (rv == NS_ERROR_NOT_AVAILABLE) {
@ -119,11 +131,12 @@ nsAboutCache::NewChannel(nsIURI *aURI, nsIChannel **result)
} }
if (!mDeviceID.IsEmpty()) { if (!mDeviceID.IsEmpty()) {
mBuffer.AppendLiteral("</pre>\n"); mBuffer.AppendLiteral("</table>\n");
} }
mBuffer.AppendLiteral("</div>\n</body>\n</html>\n"); mBuffer.AppendLiteral("</body>\n"
"</html>\n");
outputStream->Write(mBuffer.get(), mBuffer.Length(), &bytesWritten); outputStream->Write(mBuffer.get(), mBuffer.Length(), &bytesWritten);
nsCOMPtr<nsIInputStream> inStr; nsCOMPtr<nsIInputStream> inStr;
rv = storageStream->NewInputStream(0, getter_AddRefs(inStr)); rv = storageStream->NewInputStream(0, getter_AddRefs(inStr));
@ -151,7 +164,7 @@ nsAboutCache::VisitDevice(const char *deviceID,
nsICacheDeviceInfo *deviceInfo, nsICacheDeviceInfo *deviceInfo,
PRBool *visitEntries) PRBool *visitEntries)
{ {
PRUint32 bytesWritten, value; PRUint32 bytesWritten, value, entryCount;
nsXPIDLCString str; nsXPIDLCString str;
*visitEntries = PR_FALSE; *visitEntries = PR_FALSE;
@ -167,44 +180,79 @@ nsAboutCache::VisitDevice(const char *deviceID,
mBuffer.AssignLiteral("<h2>"); mBuffer.AssignLiteral("<h2>");
mBuffer.Append(str); mBuffer.Append(str);
mBuffer.AppendLiteral("</h2>\n<br />\n" mBuffer.AppendLiteral("</h2>\n"
"<table>\n"); "<table id=\"");
mBuffer.Append(deviceID);
mBuffer.AppendLiteral("\">\n");
// Write out cache info // Write out cache info
// Number of entries
mBuffer.AppendLiteral(" <tr>\n"
" <th>Number of entries:</th>\n"
" <td>");
entryCount = 0;
deviceInfo->GetEntryCount(&entryCount);
mBuffer.AppendInt(entryCount);
mBuffer.AppendLiteral("</td>\n"
" </tr>\n");
mBuffer.AppendLiteral("\n<tr>\n<td><b>Number of entries:</b></td>\n"); // Maximum storage size
value = 0; mBuffer.AppendLiteral(" <tr>\n"
deviceInfo->GetEntryCount(&value); " <th>Maximum storage size:</th>\n"
mBuffer.AppendLiteral("<td><tt>"); " <td>");
mBuffer.AppendInt(value);
mBuffer.AppendLiteral("</tt></td>\n</tr>\n"
"\n<tr>\n<td><b>Maximum storage size:</b></td>\n");
value = 0; value = 0;
deviceInfo->GetMaximumSize(&value); deviceInfo->GetMaximumSize(&value);
mBuffer.AppendLiteral("<td><tt>");
mBuffer.AppendInt(value/1024); mBuffer.AppendInt(value/1024);
mBuffer.AppendLiteral(" KiB</tt></td>\n</tr>\n" mBuffer.AppendLiteral(" KiB</td>\n"
"\n<tr>\n<td><b>Storage in use:</b></td>\n" " </tr>\n");
"<td><tt>");
// Storage in use
mBuffer.AppendLiteral(" <tr>\n"
" <th>Storage in use:</th>\n"
" <td>");
value = 0; value = 0;
deviceInfo->GetTotalSize(&value); deviceInfo->GetTotalSize(&value);
mBuffer.AppendInt(value/1024); mBuffer.AppendInt(value/1024);
mBuffer.AppendLiteral(" KiB</tt></td>\n</tr>\n"); mBuffer.AppendLiteral(" KiB</td>\n"
" </tr>\n");
deviceInfo->GetUsageReport(getter_Copies(str)); deviceInfo->GetUsageReport(getter_Copies(str));
mBuffer.Append(str); mBuffer.Append(str);
mBuffer.AppendLiteral("</table>\n\n<br />");
if (mDeviceID.IsEmpty()) { if (mDeviceID.IsEmpty()) { // The about:cache case
mBuffer.AppendLiteral("\n<a href=\"about:cache?device="); if (entryCount != 0) { // Add the "List Cache Entries" link
mBuffer.Append(deviceID); mBuffer.AppendLiteral(" <tr>\n"
mBuffer.AppendLiteral("\">List Cache Entries</a>\n" " <th><a href=\"about:cache?device=");
"<hr />\n"); mBuffer.Append(deviceID);
} else { mBuffer.AppendLiteral("\">List Cache Entries</a></th>\n"
*visitEntries = PR_TRUE; " </tr>\n");
mBuffer.AppendLiteral("<hr />\n<pre>\n"); }
mBuffer.AppendLiteral("</table>\n");
} else { // The about:cache?device=disk etc. case
mBuffer.AppendLiteral("</table>\n");
if (entryCount != 0) {
*visitEntries = PR_TRUE;
mBuffer.AppendLiteral("<hr/>\n"
"<table id=\"entries\">\n"
" <colgroup>\n"
" <col id=\"col-key\">\n"
" <col id=\"col-dataSize\">\n"
" <col id=\"col-fetchCount\">\n"
" <col id=\"col-lastModified\">\n"
" <col id=\"col-expires\">\n"
" </colgroup>\n"
" <thead>\n"
" <tr>\n"
" <th>Key</th>\n"
" <th>Data size</th>\n"
" <th>Fetch count</th>\n"
" <th>Last modified</th>\n"
" <th>Expires</th>\n"
" </tr>\n"
" </thead>\n");
}
} }
mStream->Write(mBuffer.get(), mBuffer.Length(), &bytesWritten); mStream->Write(mBuffer.get(), mBuffer.Length(), &bytesWritten);
} }
@ -246,45 +294,46 @@ nsAboutCache::VisitEntry(const char *deviceID,
url += escapedKey; // key url += escapedKey; // key
// Entry start... // Entry start...
mBuffer.AssignLiteral(" <tr>\n");
// URI // URI
mBuffer.AssignLiteral("<b> Key:</b> <a href=\""); mBuffer.AppendLiteral(" <td><a href=\"");
mBuffer.Append(url); mBuffer.Append(url);
mBuffer.AppendLiteral("\">"); mBuffer.AppendLiteral("\">");
mBuffer.Append(escapedKey); mBuffer.Append(escapedKey);
nsMemory::Free(escapedKey); nsMemory::Free(escapedKey);
mBuffer.AppendLiteral("</a>"); mBuffer.AppendLiteral("</a></td>\n");
// Content length // Content length
PRUint32 length = 0; PRUint32 length = 0;
entryInfo->GetDataSize(&length); entryInfo->GetDataSize(&length);
mBuffer.AppendLiteral(" <td>");
mBuffer.AppendLiteral("\n<b> Data size:</b> ");
mBuffer.AppendInt(length); mBuffer.AppendInt(length);
mBuffer.AppendLiteral(" bytes"); mBuffer.AppendLiteral(" bytes</td>\n");
// Number of accesses // Number of accesses
PRInt32 fetchCount = 0; PRInt32 fetchCount = 0;
entryInfo->GetFetchCount(&fetchCount); entryInfo->GetFetchCount(&fetchCount);
mBuffer.AppendLiteral(" <td>");
mBuffer.AppendLiteral("\n<b> Fetch count:</b> ");
mBuffer.AppendInt(fetchCount); mBuffer.AppendInt(fetchCount);
mBuffer.AppendLiteral("</td>\n");
// vars for reporting time // vars for reporting time
char buf[255]; char buf[255];
PRUint32 t; PRUint32 t;
// Last modified time // Last modified time
mBuffer.AppendLiteral("\n<b> Last modified:</b> "); mBuffer.AppendLiteral(" <td>");
entryInfo->GetLastModified(&t); entryInfo->GetLastModified(&t);
if (t) { if (t) {
PrintTimeString(buf, sizeof(buf), t); PrintTimeString(buf, sizeof(buf), t);
mBuffer.Append(buf); mBuffer.Append(buf);
} else } else
mBuffer.AppendLiteral("No last modified time"); mBuffer.AppendLiteral("No last modified time");
mBuffer.AppendLiteral("</td>\n");
// Expires time // Expires time
mBuffer.AppendLiteral("\n<b> Expires:</b> "); mBuffer.AppendLiteral(" <td>");
entryInfo->GetExpirationTime(&t); entryInfo->GetExpirationTime(&t);
if (t < 0xFFFFFFFF) { if (t < 0xFFFFFFFF) {
PrintTimeString(buf, sizeof(buf), t); PrintTimeString(buf, sizeof(buf), t);
@ -292,9 +341,10 @@ nsAboutCache::VisitEntry(const char *deviceID,
} else { } else {
mBuffer.AppendLiteral("No expiration time"); mBuffer.AppendLiteral("No expiration time");
} }
mBuffer.AppendLiteral("</td>\n");
// Entry is done... // Entry is done...
mBuffer.AppendLiteral("\n\n"); mBuffer.AppendLiteral(" </tr>\n");
mStream->Write(mBuffer.get(), mBuffer.Length(), &bytesWritten); mStream->Write(mBuffer.get(), mBuffer.Length(), &bytesWritten);

Просмотреть файл

@ -22,6 +22,7 @@
* Contributor(s): * Contributor(s):
* Darin Fisher <darin@netscape.com> (original author) * Darin Fisher <darin@netscape.com> (original author)
* Alexey Chernyak <alexeyc@bigfoot.com> (XHTML 1.1 conversion) * Alexey Chernyak <alexeyc@bigfoot.com> (XHTML 1.1 conversion)
* Steffen Wilberg <steffen.wilberg@web.de> (new layout)
* *
* Alternatively, the contents of this file may be used under the terms of * Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or * either the GNU General Public License Version 2 or later (the "GPL"), or
@ -125,7 +126,7 @@ nsAboutCacheEntry::NewChannel(nsIURI *uri, nsIChannel **result)
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
return NS_NewInputStreamChannel(result, uri, stream, return NS_NewInputStreamChannel(result, uri, stream,
NS_LITERAL_CSTRING("application/xhtml+xml"), NS_LITERAL_CSTRING("text/html"),
NS_LITERAL_CSTRING("utf-8")); NS_LITERAL_CSTRING("utf-8"));
} }
@ -159,14 +160,17 @@ nsAboutCacheEntry::GetContentStream(nsIURI *uri, nsIInputStream **result)
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
buffer.AssignLiteral( buffer.AssignLiteral(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" "<!DOCTYPE html>\n"
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n" "<html>\n"
" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n" "<head>\n"
"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" " <title>Cache entry information</title>\n"
"<head>\n<title>Cache entry information</title>\n" " <link rel=\"stylesheet\" "
"<style type=\"text/css\">\npre {\n margin: 0;\n}\n" "href=\"chrome://global/skin/about.css\" type=\"text/css\"/>\n"
"td:first-child {\n text-align: right;\n vertical-align: top;\n" " <link rel=\"stylesheet\" "
" line-height: 0.8em;\n}\n</style>\n</head>\n<body>\n"); "href=\"chrome://global/skin/aboutCacheEntry.css\" type=\"text/css\"/>\n"
"</head>\n"
"<body>\n"
"<h1>Cache entry information</h1>\n");
outputStream->Write(buffer.get(), buffer.Length(), &n); outputStream->Write(buffer.get(), buffer.Length(), &n);
if (descriptor) if (descriptor)
@ -177,7 +181,7 @@ nsAboutCacheEntry::GetContentStream(nsIURI *uri, nsIInputStream **result)
buffer.AssignLiteral("</body>\n</html>\n"); buffer.AssignLiteral("</body>\n</html>\n");
outputStream->Write(buffer.get(), buffer.Length(), &n); outputStream->Write(buffer.get(), buffer.Length(), &n);
nsCOMPtr<nsIInputStream> inStr; nsCOMPtr<nsIInputStream> inStr;
PRUint32 size; PRUint32 size;
@ -238,11 +242,14 @@ static void PrintTimeString(char *buf, PRUint32 bufsize, PRUint32 t_sec)
#define APPEND_ROW(label, value) \ #define APPEND_ROW(label, value) \
PR_BEGIN_MACRO \ PR_BEGIN_MACRO \
buffer.AppendLiteral("<tr><td><tt><b>"); \ buffer.AppendLiteral(" <tr>\n" \
" <th>"); \
buffer.AppendLiteral(label); \ buffer.AppendLiteral(label); \
buffer.AppendLiteral(":</b></tt></td>\n<td><pre>"); \ buffer.AppendLiteral(":</th>\n" \
" <td>"); \
buffer.Append(value); \ buffer.Append(value); \
buffer.AppendLiteral("</pre></td></tr>\n"); \ buffer.AppendLiteral("</td>\n" \
" </tr>\n"); \
PR_END_MACRO PR_END_MACRO
nsresult nsresult
@ -259,8 +266,10 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream *outputStream,
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
buffer.SetCapacity(4096); buffer.SetCapacity(4096);
buffer.AssignLiteral("<table>" buffer.AssignLiteral("<table>\n"
"<tr><td><tt><b>key:</b></tt></td><td>"); " <tr>\n"
" <th>key:</th>\n"
" <td id=\"td-key\">");
// Test if the key is actually a URI // Test if the key is actually a URI
nsCOMPtr<nsIURI> uri; nsCOMPtr<nsIURI> uri;
@ -286,8 +295,8 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream *outputStream,
else else
buffer.Append(escapedStr); buffer.Append(escapedStr);
nsMemory::Free(escapedStr); nsMemory::Free(escapedStr);
buffer.AppendLiteral("</td></tr>\n"); buffer.AppendLiteral("</td>\n"
" </tr>\n");
// temp vars for reporting // temp vars for reporting
char timeBuf[255]; char timeBuf[255];
@ -362,7 +371,8 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream *outputStream,
} }
buffer.AppendLiteral("</table>\n" buffer.AppendLiteral("</table>\n"
"<hr />\n<table>"); "<hr/>\n"
"<table>\n");
// Meta Data // Meta Data
// let's just look for some well known (HTTP) meta data tags, for now. // let's just look for some well known (HTTP) meta data tags, for now.
@ -372,35 +382,41 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream *outputStream,
if (!str2.IsEmpty()) APPEND_ROW("Client", str2); if (!str2.IsEmpty()) APPEND_ROW("Client", str2);
mBuffer = &buffer; // make it available for VisitMetaDataElement() mBuffer = &buffer; // make it available for VisitMetaDataElement().
// nsCacheEntryDescriptor::VisitMetaData calls
// nsCacheEntry.h VisitMetaDataElements, which returns
// nsCacheMetaData::VisitElements, which calls
// nsAboutCacheEntry::VisitMetaDataElement (below) in a loop.
descriptor->VisitMetaData(this); descriptor->VisitMetaData(this);
mBuffer = nsnull; mBuffer = nsnull;
buffer.AppendLiteral("</table>\n" buffer.AppendLiteral("</table>\n");
"<hr />\n<pre>");
outputStream->Write(buffer.get(), buffer.Length(), &n); outputStream->Write(buffer.get(), buffer.Length(), &n);
buffer.Truncate(); buffer.Truncate();
// Provide a hexdump of the data // Provide a hexdump of the data
nsCOMPtr<nsIInputStream> stream; if (dataSize) { // don't draw an <hr> if the Data Size is 0.
descriptor->OpenInputStream(0, getter_AddRefs(stream)); nsCOMPtr<nsIInputStream> stream;
if (stream) { descriptor->OpenInputStream(0, getter_AddRefs(stream));
PRUint32 hexDumpState = 0; if (stream) {
char chunk[4096]; buffer.AssignLiteral("<hr/>\n"
while (dataSize) { "<pre>");
PRUint32 count = PR_MIN(dataSize, sizeof(chunk)); PRUint32 hexDumpState = 0;
if (NS_FAILED(stream->Read(chunk, count, &n)) || n == 0) char chunk[4096];
break; while (dataSize) {
dataSize -= n; PRUint32 count = PR_MIN(dataSize, sizeof(chunk));
HexDump(&hexDumpState, chunk, n, buffer); if (NS_FAILED(stream->Read(chunk, count, &n)) || n == 0)
break;
dataSize -= n;
HexDump(&hexDumpState, chunk, n, buffer);
outputStream->Write(buffer.get(), buffer.Length(), &n);
buffer.Truncate();
}
buffer.AssignLiteral("</pre>\n");
outputStream->Write(buffer.get(), buffer.Length(), &n); outputStream->Write(buffer.get(), buffer.Length(), &n);
buffer.Truncate(); }
}
} }
buffer.AssignLiteral("</pre>");
outputStream->Write(buffer.get(), buffer.Length(), &n);
return NS_OK; return NS_OK;
} }
@ -468,15 +484,17 @@ nsAboutCacheEntry::VisitMetaDataElement(const char * key,
const char * value, const char * value,
PRBool * keepGoing) PRBool * keepGoing)
{ {
mBuffer->AppendLiteral("<tr><td><tt><b>"); mBuffer->AppendLiteral(" <tr>\n"
" <th>");
mBuffer->Append(key); mBuffer->Append(key);
mBuffer->AppendLiteral(":</b></tt></td>\n<td><pre>"); mBuffer->AppendLiteral(":</th>\n"
" <td>");
char* escapedValue = nsEscapeHTML(value); char* escapedValue = nsEscapeHTML(value);
mBuffer->Append(escapedValue); mBuffer->Append(escapedValue);
nsMemory::Free(escapedValue); nsMemory::Free(escapedValue);
mBuffer->AppendLiteral("</pre></td></tr>\n"); mBuffer->AppendLiteral("</td>\n"
" </tr>\n");
*keepGoing = PR_TRUE; *keepGoing = PR_TRUE;
return NS_OK; return NS_OK;
} }

Просмотреть файл

@ -3,6 +3,8 @@ toolkit.jar:
skin/classic/global/10pct_transparent_grey.png skin/classic/global/10pct_transparent_grey.png
skin/classic/global/50pct_transparent_grey.png skin/classic/global/50pct_transparent_grey.png
skin/classic/global/about.css (../../winstripe/global/about.css) skin/classic/global/about.css (../../winstripe/global/about.css)
skin/classic/global/aboutCache.css (../../winstripe/global/aboutCache.css)
skin/classic/global/aboutCacheEntry.css (../../winstripe/global/aboutCacheEntry.css)
skin/classic/global/aboutMemory.css (../../winstripe/global/aboutMemory.css) skin/classic/global/aboutMemory.css (../../winstripe/global/aboutMemory.css)
skin/classic/global/aboutSupport.css (../../winstripe/global/aboutSupport.css) skin/classic/global/aboutSupport.css (../../winstripe/global/aboutSupport.css)
skin/classic/global/appPicker.css (../../winstripe/global/appPicker.css) skin/classic/global/appPicker.css (../../winstripe/global/appPicker.css)

Просмотреть файл

@ -0,0 +1,92 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Steffen Wilberg <steffen.wilberg@web.de>.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
h2 {
margin-top: 2em;
}
table {
table-layout: fixed;
width: 100%;
margin-bottom: 1em;
padding: 0.5em 0;
-moz-border-radius: 10px;
}
#disk { background-color: lightblue; }
#memory { background-color: lightgreen; }
#offline { background-color: plum; }
th {
width: 14em;
white-space: nowrap;
text-align: right;
}
td {
font-family: -moz-fixed;
word-wrap: break-word;
}
#col-key {
width: 60%;
}
#col-dataSize, #col-fetchCount,
#col-lastModified, #col-expires {
width: 13%;
}
#entries > tbody > tr:nth-child(odd) {
background: #fcfcfc;
}
#entries > tbody > tr:nth-child(even) {
background: #f4f4f4;
}
#entries > tbody > tr > td {
padding: .5em 0;
text-align: center;
}
#entries > thead > tr > th {
text-align: center;
white-space: normal;
}
#entries > thead > tr > th:first-child,
#entries > tbody > tr > td:first-child {
text-align: left;
}

Просмотреть файл

@ -0,0 +1,61 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Steffen Wilberg <steffen.wilberg@web.de>.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
body {
display: table;
}
table {
table-layout: fixed;
width: 100%;
}
th {
width: 12em;
word-wrap: break-word;
vertical-align: top;
text-align: right;
}
td {
display: block;
font-family: -moz-fixed;
white-space: pre-wrap;
}
#td-key {
word-wrap: break-word;
}

Просмотреть файл

@ -4,6 +4,8 @@ toolkit.jar:
# NOTE: If you add a new file here, you'll need to add it to the aero # NOTE: If you add a new file here, you'll need to add it to the aero
# section at the bottom of this file # section at the bottom of this file
skin/classic/global/about.css skin/classic/global/about.css
skin/classic/global/aboutCache.css
skin/classic/global/aboutCacheEntry.css
skin/classic/global/aboutMemory.css skin/classic/global/aboutMemory.css
skin/classic/global/aboutSupport.css skin/classic/global/aboutSupport.css
skin/classic/global/appPicker.css skin/classic/global/appPicker.css
@ -170,6 +172,8 @@ toolkit.jar:
toolkit.jar: toolkit.jar:
% skin global classic/1.0 %skin/classic/aero/global/ os=WINNT osversion>=6 % skin global classic/1.0 %skin/classic/aero/global/ os=WINNT osversion>=6
skin/classic/aero/global/about.css skin/classic/aero/global/about.css
skin/classic/aero/global/aboutCache.css
skin/classic/aero/global/aboutCacheEntry.css
skin/classic/aero/global/aboutMemory.css skin/classic/aero/global/aboutMemory.css
skin/classic/aero/global/aboutSupport.css skin/classic/aero/global/aboutSupport.css
skin/classic/aero/global/appPicker.css skin/classic/aero/global/appPicker.css