Enabling new cache build in Linux. r=beard; sr=mscott,rpotts; a=chofmann

This commit is contained in:
darin%netscape.com 2001-03-22 00:18:13 +00:00
Родитель 1e7ee6f0f9
Коммит b5ef4f8688
2 изменённых файлов: 27 добавлений и 9 удалений

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

@ -3815,13 +3815,16 @@ AC_ARG_ENABLE(verbose-config-defs,
VERBOSE_CONFIG_DEFS=
fi])
dnl New cache is not yet enabled by default. This is a temporary
dnl option for testing
MOZ_ARG_ENABLE_BOOL(new-cache,
[ --enable-new-cache Enable new cache],
MOZ_NEW_CACHE=1
AC_DEFINE(MOZ_NEW_CACHE))
dnl New cache is now enabled by default.
MOZ_NEW_CACHE=1
dnl The new cache may be optionally disabled in favor of the old cache
dnl for performance testing.
MOZ_ARG_DISABLE_BOOL(new-cache,
[ --disable-new-cache Disable new cache],
MOZ_NEW_CACHE=0)
if test "$MOZ_NEW_CACHE" = "1"; then
AC_DEFINE(MOZ_NEW_CACHE)
fi
AC_SUBST(MOZ_NEW_CACHE)
dnl New image library is not yet enabled by default. This is a temporary

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

@ -1387,8 +1387,17 @@ nsHTTPChannel::CacheReceivedResponse(nsIStreamListener *aListener,
// Store secure data in memory only
nsCOMPtr<nsISupports> securityInfo;
rv = GetSecurityInfo(getter_AddRefs(securityInfo));
if (NS_SUCCEEDED(rv) && securityInfo)
mCacheEntry->SetSecurityInfo(securityInfo);
if (NS_SUCCEEDED(rv) && securityInfo) {
rv = mCacheEntry->SetSecurityInfo(securityInfo);
if (NS_FAILED(rv)) return rv;
}
// For HTTPS connections, the storage policy will already be IN_MEMORY.
// We are concerned instead about load attributes which may have changed.
if (mLoadAttributes & nsIChannel::INHIBIT_PERSISTENT_CACHING) {
rv = mCacheEntry->SetStoragePolicy(nsICache::STORE_IN_MEMORY);
if (NS_FAILED(rv)) return rv;
}
// Set the expiration time for this cache entry
rv = UpdateExpirationTime();
@ -2414,6 +2423,10 @@ nsresult nsHTTPChannel::ResponseCompleted(nsIStreamListener *aListener,
"OnStopRequest to consumer failed! Status:%x\n", this, rv));
}
#ifdef MOZ_NEW_CACHE
mResponseDataListener = 0;
#endif
// Release the cache entry as soon as we are done. This helps as it can
// flush any cache records and do maintenance. But do this only after
// stopRequest has been fired as the stopListeners could want to use
@ -2438,7 +2451,9 @@ nsresult nsHTTPChannel::ResponseCompleted(nsIStreamListener *aListener,
// it needs to be valid for the life of the channel
// mResponseContext = 0;
#ifndef MOZ_NEW_CACHE
mResponseDataListener = 0;
#endif
NS_IF_RELEASE(mCachedResponse);
return rv;