Bug 381657. Install offline cache listener even for loads from the disk/memory caches. patch by Dave Camp, r+sr=biesi

This commit is contained in:
roc+@cs.cmu.edu 2007-05-29 19:34:23 -07:00
Родитель 3341033724
Коммит 83d1634cc5
1 изменённых файлов: 21 добавлений и 0 удалений

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

@ -1803,6 +1803,27 @@ nsHttpChannel::ReadFromCache()
}
}
// set up the offline cache entry for writing
if (mCacheForOfflineUse) {
PRBool shouldUpdateOffline;
rv = ShouldUpdateOfflineCacheEntry(&shouldUpdateOffline);
if (NS_FAILED(rv)) return rv;
if (shouldUpdateOffline) {
LOG(("writing to the offline cache"));
rv = InitOfflineCacheEntry();
if (NS_FAILED(rv)) return rv;
if (mOfflineCacheEntry) {
rv = InstallOfflineCacheListener();
if (NS_FAILED(rv)) return rv;
}
} else {
LOG(("offline cache is up to date, not updating"));
CloseOfflineCacheEntry();
}
}
// open input stream for reading...
nsCOMPtr<nsIInputStream> stream;
rv = mCacheEntry->OpenInputStream(0, getter_AddRefs(stream));