Closed Bug 2055474 Opened 3 months ago Closed 3 months ago

Use a content-safe deepEqual in urlbar content modules instead of ObjectUtils

Categories

(Firefox :: Address Bar, task)

task

Tracking

()

RESOLVED FIXED
154 Branch
Tracking Status
firefox154 --- fixed

People

(Reporter: dao, Assigned: dao)

References

Details

(Whiteboard: [sng][mcab-hnt])

Attachments

(1 external file)

The urlbar content modules (UrlbarInput, SmartbarInput, UrlbarView, UrlbarResult) call ObjectUtils.deepEqual from resource://gre/modules/ObjectUtils.sys.mjs, a system module a content-web realm can't import -- which blocks these modules from running in a content process.

Add a small content-safe UrlbarShared.deepEqual (for plain JSON-like data) and route all the call sites through it, dropping the ObjectUtils imports. The compared data is all plain objects/arrays/primitives (search modes, engine-title lists, view buttons/templates, row labels, highlight tokens), so ObjectUtils's general-purpose handling (Map/Set/Date/etc.) isn't needed. deepEqual is a pure function, so it needs no routing through the UrlbarChild actor. Behavior-neutral.

UrlbarInput, SmartbarInput, UrlbarView, and UrlbarResult compared plain data with
ObjectUtils.deepEqual, a system module a content-web realm can't import. Add a
content-safe UrlbarShared.deepEqual (plain JSON-like data only -- arrays, objects,
primitives) and route the eight call sites through it, dropping the ObjectUtils
imports.

The compared data is all plain (search modes, engine-title lists, view
buttons/templates, row labels, highlight tokens), so ObjectUtils's Map/Set/Date
handling isn't needed. deepEqual is pure, so unlike whereToOpenLink/getFixupInfo it
needs no UrlbarChild round-trip -- and routing it through the controller would break
the search-mode and engine-list comparisons, which run before the controller
exists. Behavior-neutral.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e9ed7fae6f3c https://hg.mozilla.org/integration/autoland/rev/b846a173ac07 Use a content-safe deepEqual in urlbar content modules instead of ObjectUtils. r=mbeier
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 154 Branch
QA Whiteboard: [search] [qa-triage-done-c154/b153]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: