Closed Bug 1123016 Opened 11 years ago Closed 11 years ago

Mark DOMEventTargetHelper::mParentObject/mOwnerWindow as non-owning; r=smaug

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

Details

Attachments

(1 file, 2 obsolete files)

No description provided.
Assignee: nobody → ehsan
Attachment #8550826 - Flags: review?(bugs) → review-
Attachment #8550826 - Attachment is obsolete: true
Comment on attachment 8550926 [details] [diff] [review] Clarify the ownership of DOMEventTargetHelper::mParentObject/mOwnerWindow Sorry, no, we explicitly got rid of the DETH->nsGlobalWindow edge at some point in order to release memory faster when necko is keeping XHR/EventSource/WebSocket alive. Don't want to add that edge back.
Attachment #8550926 - Flags: review?(bugs) → review-
So what is the right fix?
Flags: needinfo?(bugs)
I don't know yet. Can we require all the nsIGlobalObjects to support nsWeakRefs?
Flags: needinfo?(bugs)
Looks like only TabChildGlobal and WorkerGlobalScope don't support weak refs.
Perhaps we can make them support weak refs or two and MOZ_ASSERT the nsWeakPtr we get out of the nsIGlobalObject to catch future implementations that don't support weak refs?
Yeah, sounds good.
This patch converts DOMEventTargetHelper::mParentObject into an nsWeakPtr, and adds fatal assertions to ensure that all future nsIGlobalObject implementations support weak references. It also marks DOMEventTargetHelper::mOwnerWindow as a non-owning reference.
Attachment #8553512 - Flags: review?(bugs)
Attachment #8550926 - Attachment is obsolete: true
Attachment #8553512 - Flags: review?(bugs) → review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: