Bug 1102172 - Fix possible appache update hang. r=jduell

This commit is contained in:
Honza Bambas 2014-12-31 18:22:46 -08:00
parent 60728bc65c
commit 2b58942723

View File

@ -3266,7 +3266,9 @@ nsHttpChannel::OnCacheEntryAvailable(nsICacheEntry *entry,
nsresult rv;
LOG(("nsHttpChannel::OnCacheEntryAvailable [this=%p entry=%p "
"new=%d appcache=%p status=%x]\n", this, entry, aNew, aAppCache, status));
"new=%d appcache=%p status=%x mAppCache=%p mAppCacheForWrite=%p]\n",
this, entry, aNew, aAppCache, status,
mApplicationCache.get(), mApplicationCacheForWrite.get()));
// if the channel's already fired onStopRequest, then we should ignore
// this event.
@ -3376,10 +3378,11 @@ nsHttpChannel::OnOfflineCacheEntryAvailable(nsICacheEntry *aEntry,
nsresult rv;
if (!mApplicationCache)
mApplicationCache = aAppCache;
if (NS_SUCCEEDED(aEntryStatus)) {
if (!mApplicationCache) {
mApplicationCache = aAppCache;
}
// We successfully opened an offline cache session and the entry,
// so indicate we will load from the offline cache.
mLoadedFromApplicationCache = true;
@ -3396,6 +3399,10 @@ nsHttpChannel::OnOfflineCacheEntryAvailable(nsICacheEntry *aEntry,
}
if (!mApplicationCacheForWrite && !mFallbackChannel) {
if (!mApplicationCache) {
mApplicationCache = aAppCache;
}
// Check for namespace match.
nsCOMPtr<nsIApplicationCacheNamespace> namespaceEntry;
rv = mApplicationCache->GetMatchingNamespace(mSpec,