Closed
Bug 266051
Opened 20 years ago
Closed 20 years ago
Remove init and shutdown from interface nsICacheService
Categories
(Core :: Networking, defect)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla1.8alpha5
People
(Reporter: timeless, Assigned: Biesinger)
References
()
Details
Attachments
(1 file)
7.84 KB,
patch
|
darin.moz
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
these three questions are among the four questions that i can think of while reading those four lines of the nsICacheService idl file. http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/netwerk/cache/public/nsICacheService.idl&rev=1.6&mark=55,57,60,62#50 Exception ``[Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsICacheService.evictEntries]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: foo.js :: bar :: line 2032" data: no]'' thrown from function bar() in <foo.js> line 2032. Stopped for thrown exception. #0: function bar() in <foo.js> line 2032 2030: try { 2031: var cacheService = Components.classes['@mozilla.org/network/cache-service;1'].getService(nsICacheService); 2032: cacheService.evictEntries(nsICache.STORE_ON_DISK); 2033: cacheService.evictEntries(nsICache.STORE_IN_MEMORY); One final question comes to mind: http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/netwerk/cache/public/nsICacheService.idl&rev=1.6&mark=94,96#92 What happens if i pass STORE_ON_DISK|STORE_IN_MEMORY ?
Assignee | ||
Comment 1•20 years ago
|
||
Assignee | ||
Comment 2•20 years ago
|
||
Comment on attachment 163374 [details] [diff] [review] does this answer the question? so this patch removes Init and Shutdown from the interface. this does a bit of cleanup too (removes one unused function, fixes indentation in nsCacheEntryDescriptor ctor)
Attachment #163374 -
Flags: review?(darin)
Assignee | ||
Comment 3•20 years ago
|
||
> What happens if i pass STORE_ON_DISK|STORE_IN_MEMORY ?
then you are passing STORE_ON_DISK_AS_FILE... this does not do anything
currently (maybe it should?)
you probably want to pass STORE_ANYWHERE to evict both disk and memory cache
entries.
Assignee | ||
Comment 4•20 years ago
|
||
dns service and sts are harder to fix, since Shutdown is called from the IO Service on the two; and since they must be gotten through the service manager the io service can't just hold a pointer to the concrete class and use operator new. taking bug. I'm assuming this bug is not about the fact that you're getting the exception, but that it's just the init/shutdown issue.
Assignee: darin → cbiesinger
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Updated•20 years ago
|
Status: NEW → ASSIGNED
OS: Windows XP → All
Hardware: PC → All
Target Milestone: --- → mozilla1.8alpha5
Comment 5•20 years ago
|
||
Comment on attachment 163374 [details] [diff] [review] does this answer the question? if we are going to rev nsICacheService, i'd like us to do a complete overhaul, and think seriously about exposing a frozen API for accessing mozilla's cache. WinINET has a cache API, and it's something that people would like to have in mozilla. my fear is that our current cache APIs are being used already. please be sure to announce this API change on n.p.m.netlib and .embedding, thanks!
Attachment #163374 -
Flags: review?(darin) → review+
Assignee | ||
Comment 6•20 years ago
|
||
>if we are going to rev nsICacheService, i'd like us to do a complete overhaul, >and think seriously about exposing a frozen API for accessing mozilla's cache. that might be a good goal eventually. (can we make cache use PRTime? :-) ) I'm not sure that explicit access to cache is much needed... for the most part, it's transparent to necko users, isn't it? Do people want to list cache contents and get information about entries? > my fear is that our current cache APIs are being used already. maybe... but I really don't think that exposing init and shutdown on this interface is a good think. someone eventually will call init and shutdown, and that will be bad... Fortunately, this shouldn't require any code changes, just a recompile. > please be sure to announce this API change on n.p.m.netlib and .embedding, will do when I check this in.
Assignee | ||
Updated•20 years ago
|
Attachment #163374 -
Flags: superreview?(bzbarsky)
Comment 7•20 years ago
|
||
Comment on attachment 163374 [details] [diff] [review] does this answer the question? sr=bzbarsky
Attachment #163374 -
Flags: superreview?(bzbarsky) → superreview+
Well, i'd love to know why I got the exception, but i'm settling for knowing that it's not my fault that i didn't call init :).
Summary: Who is supposed to initialize the cache service and when are they supposed to initialize it? who is responsible for calling shutdown? → Remove init and shutdown from interface nsICacheService
Assignee | ||
Comment 10•20 years ago
|
||
checked in; newsgroup post made. timeless: if you feel that it is a bug that you get the exception, please file a new bug about it.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•