Closed Bug 73194 Opened 24 years ago Closed 24 years ago

switching to new profile breaks disk cache

Categories

(Core :: Networking: Cache, defect)

defect
Not set
critical

Tracking

()

VERIFIED FIXED

People

(Reporter: ccarlen, Assigned: beard)

Details

(Whiteboard: [cache])

Attachments

(1 file)

In nsDiskCacheObserver::Observe, when it responds to a profile change, it does not ensure the the cache dir that it sets up exists. If you switch to a profile from which the new cache has never been run, this causes horrible things to happen. During initialization, it ensures that the cache dir exists, but on a profile change, this check is never performed. It needs to be. The patch calls ensureCacheDirectory() in two more places. Shouldn't ensureCacheDirectory just be called from nsDiskCacheDevice::setCacheDirectory so this could be done all in one place? Another thing about nsDiskCacheObserver - it does not implement nsSupportsWeakReference so, in registering with observer service, observer service will hold a strong ref to it. Not sure if that's bad in this case but have a look.
Attached patch patch to ensure dir exists (deleted) — Splinter Review
Blocks: 64833
Keywords: mozilla0.9
QA Contact: gordon → tever
Whiteboard: [cache]
How do we switch profiles? When does it occur?
We support it for embedding - Seamonkey does not do it yet. The embedding samples mfcEmbed (Win) and PPEmbed (Mac) both do it. They are part of the standard build.
Profile switching occurs whenever a profile switching enabled application indicates (via UI similar to the profile manager) that the user is changing. in mfcEmbed this is done by bringing up the switch profile dialog and selecting a different user/profile and clicking ok. For a description of "how" to test profile switching, see the "Profile Switching" section in here http://www.mozilla.org/quality/smoketests/embed-basic-test.html.
r=valeski
Patch looks fine to me. Will check in on branch, and it should get checked in on tip later today. You all might want to work with DISKCACHE1_BRANCH to get the latest and greatest. Just pull mozilla/netwerk/cache/public and src with this tag. r=beard
Fix checked in to trunk.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
verified on 0402 mfcembed
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: