Cache clearOriginAttributes and ClearOrigin APIs are ambiguous
Categories
(Core :: Networking: Cache, task, P2)
Tracking
()
People
(Reporter: edgul, Unassigned)
References
Details
(Keywords: good-first-bug, Whiteboard: [necko-triaged][necko-priority-next])
-
clearOriginAttributes.
DoomStorageEntries calls with empty origin and Empty origin will be removed. So it looks like the intention of this function is to clear entries of all origins with matching OA. Maybe the name should be something like clearAllOriginsByOriginAttribute? -
ClearOrigin.
We pull the origin from the principal and clearOriginInternal passes that origin to EvictByContext, and we also appear to respect the principal's originAttributes when clearing entries (via nsLoadContextInfo). So clearOrigin name and it's comment could be a little better. Perhaps a comment that says:Evict any cache entry having the same origin and OriginAttributes of aPrincipal
and rename the function name to beclearByPrincipal
?
As kind of an edge case though, I'm not yet clear on what happens if this function is triggered from a url that doesn't have a hostname, the inner functions appear to return null string for origin. Maybe this can make it's way into EvictByContext, where passing an empty origin would clear all origins with matching OA (similar to above)? But maybe the explicit null string prevents that?
Comment 1•2 days ago
|
||
Originially raised in review of Bug 1944310: https://phabricator.services.mozilla.com/D238074#8248569
Description
•