Closed Bug 73441 Opened 24 years ago Closed 24 years ago

New cache needs "Clear" functionality

Categories

(Core :: Networking: Cache, defect)

defect
Not set
major

Tracking

()

VERIFIED FIXED
mozilla0.9

People

(Reporter: ccarlen, Assigned: gordon)

References

Details

(Whiteboard: [cache])

Attachments

(2 files)

The old cache had the nsINetDataCacheManager::Clear() method. This is needed for programs which want to have a "Clear Disk Cache" feature. There isn't an equivalent method on the new cache.
perhaps this blocks bug 73062?
Blocks: 64833
Keywords: mozilla0.9
what interface would this hang off of?
We need a couple of different "clear" interfaces. A cache client (like http or imgLib) might want to clear all their entries, or a user might want to clear an entire cache device (usually to fix some other bug - whatever, okay). The "clear device" probably needs to be on nsICacheService, passing the deviceID to clear. The "clear entries for client" could be on the nsICacheSession. It may be able to use the visitor interface to selectively remove cache entries (imgLib removing chrome entries after a theme switch).
QA Contact: gordon → tever
Initial implementation of disk cache clearing checked in on DISKCACHE1_BRANCH. Enclosing a patch to pref-cache.js that uses new cache service to do this.
Whiteboard: [cache]
*** Bug 73062 has been marked as a duplicate of this bug. ***
Target Milestone: --- → mozilla0.9
Chris, Darin: can I get a review and superreview on Patrick's patch to the pref- cache.js file?
r/sr=darin
I also had to add: prefixLen = (clientID ? nsCRT::strlen(clientID) : 0); to nsMemoryCacheDevice.cpp, because it would abort on linux otherwise. I think this is a bug in nsCRT::strlen(). Closing this bug as FIXED. I'd be happy to open another bug on nsCRT::strlen() if you folks agree.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Since you removed the code that needed the |const nsINetDataCacheManager| you could've removed that const. And it's bad form to use 4 space indent in a file which is 2 space indent... While in Rome etc.
+ var classID = Components.classes["@mozilla.org/network/cache-service;1"]; + var cacheService = classID.getService(Components.interfaces.nsICacheService); So, the thing isn't really a classID... It's a class, so something like: + var cacheClass = Components.classes["@mozilla.org/network/cache-service;1"]; would've been more appropriate. But why not go with the style that already was in there and use: + var cacheService = Components.classes["@mozilla.org/network/cache-service;1"] + .getService(Components.interfaces.nsICacheService); ?
gordon: the added check around nsCRT::strlen is necessary on linux because the function is just a wrapper around the native strlen. if it were a wrapper around PL_strlen, then this check would not be necessary.
Well, gee. Why don't we just use PL_strlen() then? Why use nsCRT::strlen()? Why do we need two?
Blocks: 75664
verified
Status: RESOLVED → VERIFIED
No longer blocks: 64833
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: