Mark immutable nsIPrincipal fields as `const`
Categories
(Core :: DOM: Security, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox90 | --- | fixed |
People
(Reporter: nika, Assigned: nika)
References
Details
Attachments
(2 files)
This requires changing the way that principals are created, so that they aren't constructed using an Init function, but rather using constructors, so that important internal fields can be marked as const
. This is a step towards bug 1443925 by making the remaining mutable fields clearly mutable. These fields will need to be stored behind a mutex of some sort before nsIPrincipal can be made properly threadsafe.
Assignee | ||
Comment 1•4 years ago
|
||
This is necessary to remove the Init methods from principals, allowing
immutable fields to be marked as const and clearly separated from mutable
fields to improve threadsafety.
Assignee | ||
Comment 2•4 years ago
|
||
This is a step towards separating the mutable state on principals from const
state which can be made threadsafe. The remaining mutable fields will either
need to be moved off of nsIPrincipal or made threadsafe to destroy (e.g. using
nsMainThreadPtrHandle) and stored behind a mutex.
Serialization is handled for most types using a separate Deserializer class,
like how it was handled with nsIURI
mutators. SystemPrincipal wasn't changed
as the Read
method is a no-op for that class.
Comment 4•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/f8e166c5eb17
https://hg.mozilla.org/mozilla-central/rev/0eaf4b701fa2
Updated•4 years ago
|
Description
•