Closed Bug 1664122 Opened 5 years ago Closed 5 years ago

Improve MarkerOptions accessors

Categories

(Core :: Gecko Profiler, task, P3)

task

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: mozbugz, Assigned: mozbugz)

References

Details

Attachments

(1 file)

MarkerOptions::Set() works on any non-const object, and always returns an rvalue reference, it doesn't feel right! Instead we should have the same reference type as input and output.

MarkerOptions::NAME() returns a reference to member on both const and non-const objects, I think it'd be better to reserve NAME() to get a const reference, and have an explicit NAMERef() when non-const access is needed.

MarkerOptions::Set() returns the same reference type as the object it's invoked on, i.e.: & -> &, and && -> &&.

MarkerOptions::NAME() always returns a reference to a const member, so it's clear it cannot be modified (even if the object at hand is not const).
MarkerOptions::NAMERef() can now be used when non-const access is needed.

Depends on D89588

Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e381cc96a788 Clearer MarkerOptions accessors - r=gregtatum
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: