Closed
Bug 1659520
Opened 5 years ago
Closed 5 years ago
Use explicit type arguments for `SyncedContext` field setters
Categories
(Core :: DOM: Navigation, task, P3)
Core
DOM: Navigation
Tracking
()
RESOLVED
FIXED
82 Branch
Tracking | Status | |
---|---|---|
firefox82 | --- | fixed |
People
(Reporter: nika, Assigned: nika)
Details
Attachments
(1 file)
It is currently possible to accidentally declare easy-to-misuse overloads of the generated setter methods from the synced context macros.
// The generated declarations look like
template <typename T>
nsresult SetFoo(T&& aValue);
// Making it possible to declare an buggy overload like
nsresult SetFoo(bool aFoo);
This can be bad, especially if the overload has different behaviour, as calls with types which are implicitly convertable to bool
may actually call the generated method, rather than the explicit overload.
This has already happened once in the form of SetAllowContentRetargeting
, which is both generated from the macro here: https://searchfox.org/mozilla-central/rev/fa7f47027917a186fb2052dee104cd06c21dd76f/docshell/base/BrowsingContext.h#119, and overloaded here: https://searchfox.org/mozilla-central/rev/fa7f47027917a186fb2052dee104cd06c21dd76f/docshell/base/BrowsingContext.h#465
Assignee | ||
Updated•5 years ago
|
Type: defect → task
Assignee | ||
Comment 1•5 years ago
|
||
Updated•5 years ago
|
Severity: -- → N/A
Priority: -- → P3
Pushed by nlayzell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a31a710e76e4
Use explicit type arguments for `SyncedContext` field setters, r=farre
Comment 3•5 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 5 years ago
status-firefox82:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•