Closed
Bug 73441
Opened 24 years ago
Closed 23 years ago
New cache needs "Clear" functionality
Categories
(Core :: Networking: Cache, defect)
Core
Networking: Cache
Tracking
()
VERIFIED
FIXED
mozilla0.9
People
(Reporter: ccarlen, Assigned: gordon)
References
Details
(Whiteboard: [cache])
Attachments
(2 files)
928 bytes,
patch
|
Details | Diff | Splinter Review | |
1.16 KB,
patch
|
Details | Diff | Splinter Review |
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.
Updated•24 years ago
|
Blocks: 64833
Keywords: mozilla0.9
Comment 2•24 years ago
|
||
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
Comment 4•24 years ago
|
||
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.
Comment 5•24 years ago
|
||
Updated•24 years ago
|
Whiteboard: [cache]
*** Bug 73062 has been marked as a duplicate of this bug. ***
Comment 7•24 years ago
|
||
Chris, Darin: can I get a review and superreview on Patrick's patch to the pref- cache.js file?
Comment 9•23 years ago
|
||
r/sr=darin
Assignee | ||
Comment 10•23 years ago
|
||
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: 23 years ago
Resolution: --- → FIXED
Comment 11•23 years ago
|
||
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.
Comment 12•23 years ago
|
||
+ 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); ?
Comment 13•23 years ago
|
||
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.
Assignee | ||
Comment 14•23 years ago
|
||
Well, gee. Why don't we just use PL_strlen() then? Why use nsCRT::strlen()? Why do we need two?
You need to log in
before you can comment on or make changes to this bug.
Description
•