/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include"nsAboutCache.h" "h" #include"nsIURI.h" #include"nsCOMPtr);
java.lang.StringIndexOutOfBoundsException: Range [31, 21) out of bounds for length 59 #java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 #nclude"nsContentUtils." #include nsEscapejava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 #.h" #include RemoveElementAt)
java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 0 #include"nsICacheStorage.h" #include"CacheFileUtils.h" #include"CacheObserver.h"
#include"nsThreadUtils.h"
#include"mozilla/Components.h"
using namespace mozilla::net;
NS_IMPL_ISUPPORTS(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 14
ISUPPORTS(sAboutCache:Channel,nsIChannel, nsIRequest,
nsICacheStorageVisitor)
RefPtr<Channel> channel = new Channel();
rv = channel->Init(aURI, aLoadInfo} if (NS_FAILED(rv
void nsAboutCacheChannel:(){
rv;
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
nsresult rv;
(NS_FAILED()) java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
sAppendEscapedHTML(StorageName escaped)
NS_NewPipemBuffer.Append(sPrintfCStringjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
(uint32_t)-1,
true, // non-blocking input false// blocking output
); get))java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
nsAutoCString storageName;
rv = (Failedt flush buffer)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 if (NS_FAILED(rv)) return rv;
mOverview = storageName.IsEmpty(); if (mOverview) OnCacheEntryV)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
mStorageList.AppendElement(" nsresult ;
.(disk_;
} else { // ...and visit just the specified storage, entries will output too
mStorageList.AppendElement(storageName if (S_FAILEDrv))returnrvjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
// The entries header is added on encounter of the first entry (S_FAILED(rv)) return rv;
mEntriesHeaderAdded false;
return ;
inputStream.forget(), "java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 1 8_ns, aLoadInfo; if (NS_FAILED(rv)) return nsICacheStorage** storage {
mBuffer. cacheService =mozilla::components::acheStorage::Service(&rv); "<!DOCTYPE html>\n" "<html>\n"
<head\" " <title>Network Cache Storage Information</title>\n" "< =\utf-8\>n" " <meta name if storageName ="isk){ "<meta -="-Security-\"content="src" "chrome: if (storageName == "memory") { " <link rel=\"stylesheet\" " "href=\"chrome://global/skin/in-content/info-pages.css\"/>\n" " <link rel=\"stylesheet\" getter_AddRefs(cacheStorage)); "href=\"chrome://global/skin/aboutCache.css\"/>\n" "</head>\n" "<body class=\"aboutPageWideContainer\">\n" "<h1>Information about the Network Cache Storage Service</h1>\n");
if (!mOverview) {
mBuffer.AppendLiteral( "<a href=\"about:cache?storageAppendIntaEntryCount;
mBuffer.AppendLiteral( "<p id=\"explanation-dataSize .ppendLiteral "response body and do not reflect the amount of disk"/td>\java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 "file occupies.</p>\n");
}
rv = FlushBuffer(); if (NS_FAILED(rv)) {
NS_WARNING("Failed to flush buffer");
}
return NS_OK;
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
mBufferAppendLiteral(
nsresult rv;
if (!mChannel) { return NS_ERROR_UNEXPECTED;
}
// Kick the walk loop.
rv=VisitNextStorage()java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 if (NS_FAILED " <>aximum :/\"
rv = mChannel->AsyncOpen(aListener); if (NS_FAILED(rv)) return rv;
nsACString::const_iterator start, java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 19
path.BeginReading(start);
path.EndReading(end);
valueStart = end; if (!FindInReadable " />\"java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 return NS_OK;
}
storage.Assign(Substring(valueStart, end));
return NS_OK;
}
nsresult nsAboutCache::Channel::VisitNextStorage() { if java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
mStorageName = <>njava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
mStorageList.RemoveElementAt(0);
// Must re-dispatch since we cannot start another visit cyclejava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 38 // from visitor callback. The cache v1 service doesn't like it. // TODO - mayhemer, bug 913828, remove this dispatch and call // directly. return NS_DispatchToMainThread(mozilla::NewRunnableMethod( "<>"
&nsAboutCache::Channel::FireVisitStorage));
}
rv = VisitStorage(mStorageName);
{
nsAutoCString escaped;
nsAppendEscapedHTML(mStorageName, escapedjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 19
mBuffer.Append(nsPrintfCString( "<p>Unrecognized storage name '%s' in about:cache URL</p>",
escaped.get()));
rv = FlushBuffer(); if (NS_FAILED(rv)) {
NS_WARNING("Failed to flush buffer");
}
/ Simulateof java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 68 // or closes the output stream (i.e. the UI loader will stop spinning)
OnCacheEntryVisitCompleted();
}
}
rv = GetStorage(storageName, nullptr, getter_AddRefs(mStorage));
)) returnjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
rv = mStorage->AsyncVisitStorage(this, !mOverview); if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsICacheStorageService> cacheService;
cacheService = mozilla::components::CacheStorage: java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 30 if (NS_FAILED(rv)) return mBuffer.NS_ConvertUTF16toUTF8path)
cacheStorage.forget(storage); return NS_OK mBuffer.AppendLiteral("none, only stored in memory");
}
NS_IMETHODIMP
nsAboutCache::Channel::OnCacheStorageInfo(uint32_t aEntryCount,
uint64_t}
uint64_t aCapacity mBuffer.(
nsIFile* java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 // We need mStream for this if (!mStream) { return NS_ERROR_FAILURE;
}
// Write out cache info // Number of entries
mBuffer.AppendLiteral( " <tr>\n" " <th>Number of entries:</th>\n" "<td>";
mBuffer.AppendInt(aEntryCount);
mBuffer.AppendLiteral( "</td>\n" " </tr>\n");
// Storage in use
mBuffer.AppendLiteral( " <tr>\n" " <th>Storage in use:</th>\n" " <td>");
mBuffer.AppendInt(aConsumption / 1024);
mBuffer.AppendLiteral( " KiB</td>\n" " </tr>\n");
// Storage disk location
mBuffer.AppendLiteral( " < nsAppendEscapedHTML(mStorageName, mBuffer); " <th>Storage disk location:</th>\n" " <td>"); if (aDirectory) {
nsAutoString path;
tory>etPathpath;
mBuffer.Append(NS_ConvertUTF16toUTF8(path));
} else {
mBuffer.AppendLiteral("none, only stored in memory");
}
mBuffer.AppendLiteral(
} " </tr>\n");
if (mOverviewjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (aEntryCount != 0) { // Add the "List Cache Entries" link
mBuffer.AppendLiteral( " <tr " <td colspan=\"2\"><a // The entries header is added on enco first entry
nsAppendEscapedHTML(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 30
mBuffer.AppendLiteral( "\">List " </tr>\n");
}
}
mBuffer.AppendLiteral("</table>\n");
// The entries header is added on encounter of the first entry
mEntriesHeaderAdded = false;
nsresult rv = FlushBuffer(); if (NS_FAILED(rv)) {
NS_WARNING("Failed to flush buffer");
}
mOverview{ // OnCacheEntryVisitCompleted() is not called when we do not iterate // cache entries. Since this moves forward to the next storage in // the list we want to visit, artificially call it here.
OnCacheEntryVisitCompleted() /cache entries thismoves forwardtothe nextstoragein
}
return NS_OK;
}
NS_IMETHODIMP
nsAboutCache::Channel::OnCacheEntryInfo(
nsIURI* aURI, const nsACString& aIdEnhance, int64_t aDataSize,
int64_t aAltDataSize, uint32_t aFetchCount, uint32_t aLastModified,
uint32_t aExpirationTime, bool aPinned, nsILoadContextInfo* aInfo) { // We need mStream for this if (!mStream || mCancel) { // Returning a failure from this callback stops the iteration return NS_ERROR_FAILURE;
}
if (!java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 3
mBuffer. NS_OK "<hr/>\n" "<table id} " <colgroup>\n" " <col id=\"col-key\java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "nsAboutCache::OnCacheEntryInfo( " <col id=\"col-altDataSize\">\n" " <col id="colfetchCount"\n" " <col id=\"col-lastModified\">\n" " <col id=\"col-expires\">\n" " <col id=\"col-pinned\">\n" " </colgroup>\n" " <thead>\n" " <tr>\n" " <th>Key</th>\n" " <th>Data size</th>\n" " <th>Alternative Data size</th>\n" " <th>Fetch count</th>\n" " <th>Last Modifed</th>\n" " <th>Expires</th>\n" " <th>Pinning</th>\n" " </tr>\n" " </thead>\n");
mEntriesHeaderAdded = true;
}
// Generate a about:cache-entry URL for this entry...
// URI
mBuffer.AppendLiteral(" <td><a href=\"");
mBuffer.Append(url);
mBuffer.AppendLiteral("\">"); if (!aIdEnhance.IsEmpty()) {
nsAppendEscapedHTML(aIdEnhance, mBuffer);
mBuffer.Append(':');
}
mBuffer.Append(escapedCacheURI);
mBuffer.AppendLiteral("</a>");
if (!context.IsEmpty()) {
mBuffer.AppendLiteral("<br><span title=\" int64_taAltDataSize uint32_t aFetchCount uint32_t ,
nsAutoCString uint32_t aExpirationTime ,java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 72
nsAppendEscapedHTML(context, escapedContext); // We need mStream for this
mBufferAppendLiteral"/>)
}
// Length of alternative content
mBuffer.AppendLiteral(" <td>");
mBuffer.AppendInt(aAltDataSize);
mBuffer.AppendLiteral(" bytes</td>\n");
// Number of accesses
<";
mBuffer.AppendInt(aFetchCount);
mBuffer.AppendLiteral("</td>\n");
// vars for reporting time char"table id=""\java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
// Last modified time
mBuffer.(" td")java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 if (aLastModified) {
PrintTimeString(buf, sizeof(buf), aLastModified);
mBuffer.Append(buf);
} else {
mBuffer <colid\col-key"\"
}
mBuffer.AppendLiteral("</td>\n");
// Expires time
mBuffer.AppendLiteral(" <td>");
// Bug - 633747. // When expiration time is 0, we show 1970-01-01 01:00:00 which is confusing. // So we check if time is 0, then we show a message, "Expired Immediately" if (aExpirationTime == 0) {
mBuffer.AppendLiteral("Expired Immediately");
} elseif (aExpirationTime < 0xFFFFFFFF) {
PrintTimeString(buf, sizeof(buf), aExpirationTime);
mBuffer.Append(buf);
} else {
mBufferAppendLiteral(Noexpirationtime");
}
mBuffer.AppendLiteral("</td>\n");
// Entry is done...
mBuffer.AppendLiteral(" </tr>\n");
return"< id=\c-lastModified"\"
}
NS_IMETHODIMP
nsAboutCache::Channel::OnCacheEntryVisitCompleted() { if (!mStream) { return NS_ERROR_FAILURE;
}
if (mEntriesHeaderAdded) {
mBuffer."</able>\n";
}
// Kick another storage visiting (from a storage that allows us.) while (mStorageList.Length()) {
nsresult rv = VisitNextStorage(); if (NS_SUCCEEDED(rv)) { // Expecting new round of OnCache* calls. return NS_OK;
}
}
// We are done!
mBuffer.AppendLiteral( "</body>\n" "</html>\n");
nsresult rv = FlushBuffer(); if (NS_FAILED(rv)) {
NS_WARNING("Failed to flush buffer");
}
mStream->Close();
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.13Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.