Closed Bug 1572534 Opened 5 years ago Closed 4 years ago

Convert the browser.cache.* VarCache prefs

Categories

(Core :: Preferences: Backend, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: KrisWright, Unassigned)

References

Details

The varcache pref browser.cache.disk.telemetry_report_ID [1] should be converted to a static pref, but because its mirror variable is manipulated directly in the code [2] it wouldn't keep in sync with a static pref. This pref may need to be reworked to use RegisterCallback instead.

[1] https://searchfox.org/mozilla-central/rev/9ae20497229225cb3fa729a787791f424ff8087b/netwerk/cache2/CacheObserver.cpp#107
[2] https://searchfox.org/mozilla-central/rev/9ae20497229225cb3fa729a787791f424ff8087b/netwerk/cache2/CacheObserver.cpp#221

browser.cache.disk.capacity and browser.cache.disk.amount_written are similar, and should probably be dealt with at the same time.

Summary: Convert or remove the Varcache pref browser.cache.disk.telemetry_report_ID → Convert the browser.cache.* VarCache prefs

Properly making this about

  • browser.cache.disk.telemetry_report_ID
  • browser.cache.disk.capacity
  • browser.cache.disk.amount_written

See additional discussion: https://bugzilla.mozilla.org/show_bug.cgi?id=1637727#c9

Since making this bug, browser.cache.disk.telemetry_report_ID was removed which leaves us with browser.cache.disk.capacity and browser.cache.disk.amount_written. The callback mechanism doesn't look like a good candidate for getting rid of these since it's only accessible on the main thread, but as these are some of the last remaining VarCache uses they need to be addressed so we can unblock bug 1448219 and get rid of the VarCache mechanism. I'm not familiar with this code so I'm not sure what the best way forward is with these. Usually, I would convert prefs like these to static prefs, but these are manipulated directly in the c++ so it isn't possible to use a static pref.

Per discussion in Bug 1637727 these values aren't even good candidates for prefs, because they aren't meant to be manipulated by the user. This means they may need another mechanism entirely, but most importantly the VarCache uses need to go if we want to get rid of the old VarCache machinery. Since we've finally managed to wind its (hundreds of) uses down to the six or so prefs remaining, I'm hoping to get rid of these so they don't block the removal of VarCache itself.

Michal, would you be willing to help us get rid of these prefs?

Flags: needinfo?(michal.novotny)
Depends on: 1645051
Depends on: 1645052

(In reply to Kris Wright :KrisWright from comment #3)

Michal, would you be willing to help us get rid of these prefs?

I filed bug 1645051 and bug 1645052 for this work.

Flags: needinfo?(michal.novotny)

Looks like these are all removed now.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.