Closed Bug 1682987 Opened 4 years ago Closed 4 years ago

Potential false negative when concurrently accessing ServiceWorkerParentInterceptEnabled

Categories

(Core :: DOM: Service Workers, defect, P2)

defect

Tracking

()

RESOLVED FIXED
86 Branch
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.

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.

Summary: Use a magic static to obtain pref in ServiceWorkerParentInterceptEnabled → Potential false negative when concurrently accessing ServiceWorkerParentInterceptEnabled
Attachment #9193634 - Attachment description: Bug 1682987: Implement ServiceWorkerParentInterceptEnabled using a magic static; r=#dom-workers-and-storage-reviewers → Bug 1682987: Unconditionally return true from ServiceWorkerParentInterceptEnabled; r=#dom-workers-and-storage-reviewers
Severity: -- → S4
Priority: -- → P2
Pushed by aklotz@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0a9bd8c4b59b Unconditionally return true from ServiceWorkerParentInterceptEnabled; r=dom-workers-and-storage-reviewers,asuth
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
Blocks: 1701328
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: