CacheObserver should use StaticPrefs instead of Add{Type}VarCache
Categories
(Core :: Networking: Cache, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: keeler, Assigned: n.nethercote)
References
Details
(Whiteboard: [necko-triaged])
Attachments
(14 files, 3 obsolete files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
See bug 1559108 and bug 1448219. Basically, CacheObserver doesn't protect against calling Add{Type}VarCache multiple times and should be using StaticPrefs anyways.
![]() |
Assignee | |
Comment 1•6 years ago
|
||
I will do this, but after I've finished bug 1563139, which won't be until next week.
![]() |
Assignee | |
Comment 2•6 years ago
|
||
Actually, I will do this before bug 1563139. In fact, I've already done, just finishing it up now. One thing I found was that most of these prefs need to be atomic because they're accessed off the main thread. The conversion to StaticPrefs
makes this obvious because it will assert if a non-atomic static pref is accessed off the main thread.
![]() |
Assignee | |
Updated•6 years ago
|
![]() |
Assignee | |
Comment 3•6 years ago
|
||
![]() |
Assignee | |
Comment 4•6 years ago
|
||
Depends on D37177
![]() |
Assignee | |
Comment 5•6 years ago
|
||
Depends on D37178
![]() |
Assignee | |
Comment 6•6 years ago
|
||
In SetDiskCacheCapacity(), the old code set sDiskCacheCapacity and then updated
the browser.cache.disk.capacity pref value. But because sDiskCacheCapacity was
a VarCache variable, libpref would immediately overwrite sDiskCacheCapacity
again with the same value. With the new code, this double-setting is avoided.
Depends on D37179
![]() |
Assignee | |
Comment 7•6 years ago
|
||
Depends on D37180
![]() |
Assignee | |
Comment 8•6 years ago
|
||
Depends on D37181
![]() |
Assignee | |
Comment 9•6 years ago
|
||
Note that the checking done by StaticPrefs
identified that this variable is
accessed off the main thread, and thus should be atomic.
Depends on D37182
![]() |
Assignee | |
Comment 10•6 years ago
|
||
Depends on D37183
![]() |
Assignee | |
Comment 11•6 years ago
|
||
Depends on D37185
![]() |
Assignee | |
Comment 12•6 years ago
|
||
Depends on D37186
![]() |
Assignee | |
Comment 13•6 years ago
|
||
Depends on D37187
![]() |
Assignee | |
Comment 14•6 years ago
|
||
Depends on D37189
![]() |
Assignee | |
Comment 15•6 years ago
|
||
It's unused.
Depends on D37190
![]() |
Assignee | |
Comment 16•6 years ago
|
||
Depends on D37191
![]() |
Assignee | |
Comment 17•6 years ago
|
||
Depends on D37192
![]() |
Assignee | |
Comment 18•6 years ago
|
||
Depends on D37193
![]() |
Assignee | |
Comment 19•6 years ago
|
||
Depends on D37194
Updated•6 years ago
|
![]() |
Assignee | |
Comment 20•6 years ago
|
||
For the three prefs that involve setting (browser.cache.disk.capacity
, browser.cache.disk.telemetry_report_ID
, and browser.cache.disk.amount_written
) I am going to remove the patches converting them. The way they work -- setting of the cached value off the main thread -- fundamentally doesn't work with StaticPrefs
, and I'm not comfortable with the solution we came up with. It's conceivable that the wrong value could be read at some point, particularly if the surrounding code changes in the future. I will deal with those in a different way in a follow-up.
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 21•6 years ago
|
||
Comment 22•6 years ago
|
||
Comment 23•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8d2643e05ffc
https://hg.mozilla.org/mozilla-central/rev/c8c20e815ff7
https://hg.mozilla.org/mozilla-central/rev/78143d8f7a06
https://hg.mozilla.org/mozilla-central/rev/944e841cc149
https://hg.mozilla.org/mozilla-central/rev/35cfe718aabe
https://hg.mozilla.org/mozilla-central/rev/2823970d440d
https://hg.mozilla.org/mozilla-central/rev/39c2b2e8a991
https://hg.mozilla.org/mozilla-central/rev/efe4557cf735
https://hg.mozilla.org/mozilla-central/rev/f4b486b1c11a
https://hg.mozilla.org/mozilla-central/rev/f398da2e54cf
https://hg.mozilla.org/mozilla-central/rev/4bea26835a12
https://hg.mozilla.org/mozilla-central/rev/f3554de19dd5
https://hg.mozilla.org/mozilla-central/rev/99c8e1e34517
https://hg.mozilla.org/mozilla-central/rev/097603980f72
Description
•