Closed Bug 419036 Opened 16 years ago Closed 16 years ago

Simplify nsCacheEntryHashTable::VisitEntries and break 'friendship'

Categories

(Core :: Networking: Cache, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9beta5

People

(Reporter: alfredkayser, Assigned: alfredkayser)

References

Details

Attachments

(1 file, 2 obsolete files)

Attached patch V1: Clean up VisitEntries (obsolete) — Splinter Review
Make the VisitEntries method accept a normal 'PLDHashEnumerator' as callback function, so that:
1. this callback can also return PL_DHASH_REMOVE (this is needed for my patch for nsMemoryCacheDevice).
2. no class structure is needed to use this method
3. the friendship between nsCacheEntryHashTable and nsCacheService can be removed
Attachment #304980 - Flags: review?(dcamp)
Attached patch V2: The right version (obsolete) — Splinter Review
Attachment #304980 - Attachment is obsolete: true
Attachment #304982 - Flags: review?(dcamp)
Attachment #304980 - Flags: review?(dcamp)
Assignee: nobody → alfredkayser
Don't you also need to update nsMemoryCacheDevice::CheckEntryCount() ?
Attachment #304982 - Attachment is obsolete: true
Attachment #305187 - Flags: review?(dcamp)
Attachment #304982 - Flags: review?(dcamp)
Attachment #305187 - Flags: superreview?(cbiesinger)
Attachment #305187 - Flags: review?(dcamp)
Attachment #305187 - Flags: review+
Version: unspecified → Trunk
Can we have this in 1.9?
Simple code cleanup, that makes things easier for more optimizations in the cache.
Status: NEW → ASSIGNED
Flags: wanted1.9.0.x?
Comment on attachment 305187 [details] [diff] [review]
V3: Also do the debug code in nsMemoryCacheDevice

+    PRInt32 *entryCount = (PRInt32 *)arg;
..
+    PRInt32 entryCount = 0;

shouldn't that be a PRUint32?
Attachment #305187 - Flags: superreview?(cbiesinger) → superreview+
Re comment #5: mEntryCount is also a PRInt32 (which is also not precisely right), but I preferred to keep it the same.
Attachment #305187 - Flags: approval1.9?
Comment on attachment 305187 [details] [diff] [review]
V3: Also do the debug code in nsMemoryCacheDevice

a1.9+=damons
Attachment #305187 - Flags: approval1.9? → approval1.9+
Keywords: checkin-needed
Checking in netwerk/cache/src/nsCacheEntry.cpp;
/cvsroot/mozilla/netwerk/cache/src/nsCacheEntry.cpp,v  <--  nsCacheEntry.cpp
new revision: 1.65; previous revision: 1.64
done
Checking in netwerk/cache/src/nsCacheEntry.h;
/cvsroot/mozilla/netwerk/cache/src/nsCacheEntry.h,v  <--  nsCacheEntry.h
new revision: 1.47; previous revision: 1.46
done
Checking in netwerk/cache/src/nsCacheService.cpp;
/cvsroot/mozilla/netwerk/cache/src/nsCacheService.cpp,v  <--  nsCacheService.cpp
new revision: 1.119; previous revision: 1.118
done
Checking in netwerk/cache/src/nsMemoryCacheDevice.cpp;
/cvsroot/mozilla/netwerk/cache/src/nsMemoryCacheDevice.cpp,v  <--  nsMemoryCacheDevice.cpp
new revision: 1.58; previous revision: 1.57
done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta5
Verified: 37 bytes saved and my patch for the memCache is now somewhat simpler.
Status: RESOLVED → VERIFIED
Flags: wanted1.9.0.x?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: