mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-08 07:53:54 +00:00
This fixes two small problems that may cause pages being partially loaded. 82720. The first problem addresses new cache entries being created when access to the entry is readonly. The second fix was to a badly placed assertion.
Patch by gordon, r=bbaetz, sr=dougt.
This commit is contained in:
parent
60f62658b5
commit
2b0a7464d0
11
netwerk/cache/src/nsCacheService.cpp
vendored
11
netwerk/cache/src/nsCacheService.cpp
vendored
@ -833,11 +833,6 @@ nsCacheService::ActivateEntry(nsCacheRequest * request,
|
||||
} else {
|
||||
++mCacheMisses;
|
||||
}
|
||||
if (!entry && !(request->AccessRequested() & nsICache::ACCESS_WRITE)) {
|
||||
// this is a READ-ONLY request
|
||||
rv = NS_ERROR_CACHE_KEY_NOT_FOUND;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (entry &&
|
||||
((request->AccessRequested() == nsICache::ACCESS_WRITE) ||
|
||||
@ -854,6 +849,12 @@ nsCacheService::ActivateEntry(nsCacheRequest * request,
|
||||
}
|
||||
|
||||
if (!entry) {
|
||||
if (! (request->AccessRequested() & nsICache::ACCESS_WRITE)) {
|
||||
// this is a READ-ONLY request
|
||||
rv = NS_ERROR_CACHE_KEY_NOT_FOUND;
|
||||
goto error;
|
||||
}
|
||||
|
||||
entry = new nsCacheEntry(request->mKey,
|
||||
request->IsStreamBased(),
|
||||
request->StoragePolicy());
|
||||
|
6
netwerk/cache/src/nsMemoryCacheDevice.cpp
vendored
6
netwerk/cache/src/nsMemoryCacheDevice.cpp
vendored
@ -164,10 +164,10 @@ nsMemoryCacheDevice::DeactivateEntry(nsCacheEntry * entry)
|
||||
nsresult
|
||||
nsMemoryCacheDevice::BindEntry(nsCacheEntry * entry)
|
||||
{
|
||||
NS_ASSERTION(PR_CLIST_IS_EMPTY(entry),"entry is already on a list!");
|
||||
|
||||
if (!entry->IsDoomed()) {
|
||||
// append entry to the eviction list
|
||||
NS_ASSERTION(PR_CLIST_IS_EMPTY(entry),"entry is already on a list!");
|
||||
|
||||
// append entry to the eviction list
|
||||
PR_APPEND_LINK(entry, &mEvictionList[EvictionList(entry, 0)]);
|
||||
|
||||
// add entry to hashtable of mem cache entries
|
||||
|
Loading…
x
Reference in New Issue
Block a user