RequestedFrameRefreshObserver uses threadsafe refcounting macro despite only being used on main thread
Categories
(Core :: Graphics: CanvasWebGL, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox122 | --- | fixed |
People
(Reporter: dholbert, Assigned: dholbert)
References
Details
Attachments
(1 file)
When reviewing refresh-observer logic, hiro noticed that RequestedFrameRefreshObserver uses the threadsafe version of the refcounting-method-declaration-macro which seems unnecessary since this seems to be a main-thread-only object.
I chatted with :pehrsons about it and it seems there's no reason we need threadsafe refcounting here.
Let's switch from NS_INLINE_DECL_THREADSAFE_REFCOUNTING to the NS_INLINE_DECL_REFCOUNTING macro here, for performance and to avoid giving the mistaken impression that this object is used off-main-thread.
| Assignee | ||
Comment 1•2 years ago
|
||
For reference, we have several other nsARefreshObserver subclasses that use the simpler NS_INLINE_DECL_REFCOUNTING macro:
https://searchfox.org/mozilla-central/rev/12ea2c521cdd071a6d25b0894f31f8f23b18b76a/widget/SwipeTracker.h#48-50
https://searchfox.org/mozilla-central/rev/12ea2c521cdd071a6d25b0894f31f8f23b18b76a/dom/ipc/CoalescedInputData.h#53,59
Just mentioning for added-confidence that this is a reasonable thing to do (for main-thread-only objects).
| Assignee | ||
Comment 2•2 years ago
|
||
Updated•2 years ago
|
Comment 4•2 years ago
|
||
| bugherder | ||
Description
•