Bug 254586 don't assume cacheToken can be qi'd to nsICacheEntryDescriptor

r=bzbarsky sr=darin
This commit is contained in:
cbiesinger%web.de 2004-08-10 23:57:25 +00:00
Родитель 90e271dce1
Коммит 23a47001f9
2 изменённых файлов: 3 добавлений и 3 удалений

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

@ -121,7 +121,7 @@
#include "nsPIDOMWindow.h" #include "nsPIDOMWindow.h"
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsICachingChannel.h" #include "nsICachingChannel.h"
#include "nsICacheEntryDescriptor.h" #include "nsICacheVisitor.h"
#include "nsIMultiPartChannel.h" #include "nsIMultiPartChannel.h"
#include "nsIWyciwygChannel.h" #include "nsIWyciwygChannel.h"
@ -6372,7 +6372,7 @@ nsDocShell::AddToSessionHistory(nsIURI * aURI,
} }
if (cacheToken) { if (cacheToken) {
// Check if the page has expired from cache // Check if the page has expired from cache
nsCOMPtr<nsICacheEntryDescriptor> cacheEntryInfo(do_QueryInterface(cacheToken)); nsCOMPtr<nsICacheEntryInfo> cacheEntryInfo(do_QueryInterface(cacheToken));
if (cacheEntryInfo) { if (cacheEntryInfo) {
PRUint32 expTime; PRUint32 expTime;
cacheEntryInfo->GetExpirationTime(&expTime); cacheEntryInfo->GetExpirationTime(&expTime);

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

@ -628,7 +628,7 @@ NS_IMETHODIMP imgRequest::OnStartRequest(nsIRequest *aRequest, nsISupports *ctxt
nsCOMPtr<nsISupports> cacheToken; nsCOMPtr<nsISupports> cacheToken;
cacheChannel->GetCacheToken(getter_AddRefs(cacheToken)); cacheChannel->GetCacheToken(getter_AddRefs(cacheToken));
if (cacheToken) { if (cacheToken) {
nsCOMPtr<nsICacheEntryDescriptor> entryDesc(do_QueryInterface(cacheToken)); nsCOMPtr<nsICacheEntryInfo> entryDesc(do_QueryInterface(cacheToken));
if (entryDesc) { if (entryDesc) {
PRUint32 expiration; PRUint32 expiration;
/* get the expiration time from the caching channel's token */ /* get the expiration time from the caching channel's token */