Potential false negative when concurrently accessing ServiceWorkerParentInterceptEnabled
Categories
(Core :: DOM: Service Workers, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: bugzilla, Assigned: bugzilla)
References
Details
Attachments
(1 file)
The current implementation of ServiceWorkerParentInterceptEnabled
uses two atomics to load the dom.serviceWorkers.parent_intercept
pref.
As-is, there is a slight chance that this function could return a false-negative, given that sInitialized
is set to true
before sEnabled
is set.
In general, though, IMHO this kind of pattern is typically a smell that this code could just be replaced by a C++11 "magic static" that safely initializes the value.
Assignee | ||
Comment 1•4 years ago
|
||
The current implementation
of ServiceWorkerParentInterceptEnabled
uses two atomics to load the
dom.serviceWorkers.parent_intercept
pref.
As-is, there is a slight chance that this function could return a false-negative,
given that sInitialized
is set to true
before sEnabled
is set.
We replace the implementation with a "magic static" that ensures both that the
value will be loaded atomically and will not require locking for subsequent
accesses.
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 3•4 years ago
|
||
bugherder |
Description
•