Open Bug 1453587 Opened 7 years ago Updated 2 years ago

Add a QuotaManagerService::clearDefault method

Categories

(Core :: Storage: Quota Manager, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: johannh, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [storage-v2])

For clearing quota managed storage for all websites we currently have to do this weird dance in JS land that looks like this: https://searchfox.org/mozilla-central/rev/4114ad2cfcbc511705c7865a4a34741812f9a2a9/browser/modules/Sanitizer.jsm#398 That's because browser components are storing things in indexedDB and we have to make sure we don't accidentally delete those as well. After bug 1354500 is done, we will have a situation where all internal storages will have a persistence type of "persistent" while all content storages will have a type of "default". We _could_ use that to implement a method that only clears default storage types, which is guaranteed to leave internal users alone. The drawback would be that we would further ensure that "persistent" storage types are something we want to keep around in the long run. I'm not sure if that's true... I'm also entirely unclear on how this would interact with bug 1286798, I mostly wanted to make sure I record the idea.
Component: DOM: IndexedDB → DOM: Quota Manager
Note that after bug 1451794 WebExtensions will also be forced to use the "default" storage type. Should this function really clear extension data? IIUC, this is the option labeled "offline website data", so probably not.
(In reply to Johann Hofmann [:johannh] from comment #0) > After bug 1354500 is done, we will have a situation where all internal > storages will have a persistence type of "persistent" while all content > storages will have a type of "default". We _could_ use that to implement a > method that only clears default storage types, which is guaranteed to leave > internal users alone. I thought that we now also implemented the standards (as opposed to proprietary) way for websites to request persistent storage? In which case, is this really true? Regardless, it'd still be a good idea for quota manager to expose an explicit API to clear web data only (leaving add-on and browser data alone).
Flags: needinfo?(jhofmann)
(In reply to :Gijs (he/him) from comment #2) > (In reply to Johann Hofmann [:johannh] from comment #0) > > After bug 1354500 is done, we will have a situation where all internal > > storages will have a persistence type of "persistent" while all content > > storages will have a type of "default". We _could_ use that to implement a > > method that only clears default storage types, which is guaranteed to leave > > internal users alone. > > I thought that we now also implemented the standards (as opposed to > proprietary) way for websites to request persistent storage? In which case, > is this really true? Yes, they will still be labeled "default", even if they're persistent via quota management.
Flags: needinfo?(jhofmann)
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.