Closed Bug 2077257 Opened 28 days ago Closed 21 days ago

Improve ThreadSafeWeakPtrHashKey behaviour during an object's destructor

Categories

(Core :: XPCOM, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
159 Branch
Tracking Status
firefox-esr153 160+ fixed
firefox159 --- fixed

People

(Reporter: nika, Assigned: nika)

References

Details

Attachments

(2 external files)

Currently ThreadSafeWeakPtrHashKey is defined fully in terms of the concrete referenced type, meaning that it cannot work late during an object's lifecycle, after the object's refcount has reached 0 and during the destructor. I expect that removing entries from a table during the destructor is a clear use-case for this type, meaning that it would be better if we supported this.

This patch does this by simplifying the handling of ThreadSafeWeakPtr such that it's used directly, and slightly improving the ergonomics of the underlying type so that it can be used directly in this way.

Currently ThreadSafeWeakPtrHashKey is defined fully in terms of the
concrete referenced type, meaning that it cannot work late during an
object's lifecycle, after the object's refcount has reached 0 and during
the destructor. I expect that removing entries from a table during the
destructor is a clear use-case for this type, meaning that it would be
better if we supported this.

This patch does this by simplifying the handling of ThreadSafeWeakPtr
such that it's used directly, and slightly improving the ergonomics of
the underlying type so that it can be used directly in this way.

Pushed by nlayzell@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b7b9f961af7b https://hg.mozilla.org/integration/autoland/rev/e8a242ab68d5 Improve ThreadSafeWeakPtrHashKey behaviour during an object's destructor, r=xpcom-reviewers,dom-storage-reviewers,emilio,janv
Pushed by smolnar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d136f271c6d4 https://hg.mozilla.org/integration/autoland/rev/3f1f2902caa3 Revert "Bug 2077257 - Improve ThreadSafeWeakPtrHashKey behaviour during an object's destructor, r=xpcom-reviewers,dom-storage-reviewers,emilio,janv" for causing android build bustages
Flags: needinfo?(nika)
Pushed by nlayzell@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/41c39394fafb https://hg.mozilla.org/integration/autoland/rev/da9927b0fec6 Improve ThreadSafeWeakPtrHashKey behaviour during an object's destructor, r=xpcom-reviewers,dom-storage-reviewers,emilio,janv
Flags: needinfo?(nika)
Status: NEW → RESOLVED
Closed: 21 days ago
Resolution: --- → FIXED
Target Milestone: --- → 159 Branch

Currently ThreadSafeWeakPtrHashKey is defined fully in terms of the
concrete referenced type, meaning that it cannot work late during an
object's lifecycle, after the object's refcount has reached 0 and during
the destructor. I expect that removing entries from a table during the
destructor is a clear use-case for this type, meaning that it would be
better if we supported this.

This patch does this by simplifying the handling of ThreadSafeWeakPtr
such that it's used directly, and slightly improving the ergonomics of
the underlying type so that it can be used directly in this way.

Original Revision: https://phabricator.services.mozilla.com/D331272

Attachment #9664763 - Flags: approval-mozilla-esr153?
Attachment #9664763 - Flags: approval-mozilla-esr153? → approval-mozilla-esr153+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: