Closed
Bug 1167603
Opened 10 years ago
Closed 10 years ago
Mark JSEventHandler::mTarget as MOZ_UNSAFE_REF
Categories
(Core :: DOM: Events, defect)
Core
DOM: Events
Tracking
()
RESOLVED
FIXED
mozilla41
| Tracking | Status | |
|---|---|---|
| firefox41 | --- | fixed |
People
(Reporter: nika, Assigned: nika)
Details
Attachments
(1 file)
|
793 bytes,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Assignee | ||
Comment 1•10 years ago
|
||
Updated•10 years ago
|
Component: DOM → DOM: Events
| Assignee | ||
Updated•10 years ago
|
Attachment #8609376 -
Flags: review?(bugs)
Comment 2•10 years ago
|
||
Comment on attachment 8609376 [details] [diff] [review]
Mark JSEventHandler::mTarget as MOZ_UNSAFE_REF
It is no always clear whether to use MOZ_NON_OWNING_REF or MOZ_UNSAFE_REF, but
since MOZ_UNSAFE_REF sounds scarier, it is always fine :)
Attachment #8609376 -
Flags: review?(bugs) → review+
Comment 3•10 years ago
|
||
Did you check we actually always call Disconnect() in case someone has set mTarget to non-null value?
| Assignee | ||
Comment 4•10 years ago
|
||
I remember doing some dxr-diving with this bug to try and make sure that the Disconnect handler was actually called, but it may be worth the time to go through the code again (I remember that this one was particularly hairy).
| Assignee | ||
Comment 5•10 years ago
|
||
In https://dxr.mozilla.org/mozilla-central/source/dom/xbl/nsXBLPrototypeHandler.cpp#325, Disconnect is called before the handler, scriptTarget, leaves scope at the end of the method.
The other place where JSEventHandlers are created is https://dxr.mozilla.org/mozilla-central/source/dom/events/EventListenerManager.cpp#621-622. This event handler is associated with a `Listener` object, which ->Disconnect()s the JSEventHandler when it is destroyed. The Listener objects are all destroyed when the mTarget value belonging to the parent EventListenerManager object is invalidated (through EventListenerManager::Disconnect() - which is outside the scope of this patch).
Keywords: checkin-needed
Comment 6•10 years ago
|
||
can we get a try run for this change ? Thanks!
Flags: needinfo?(michael)
Keywords: checkin-needed
| Assignee | ||
Comment 7•10 years ago
|
||
try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=d42a1d6babfa
Sorry - this change is basically comments (as MOZ_UNSAFE_REF expands to /* nothing */) - so I didn't think I should bother with a try run.
Flags: needinfo?(michael)
| Assignee | ||
Updated•10 years ago
|
Assignee: nobody → michael
Comment 9•10 years ago
|
||
Comment 11•10 years ago
|
||
(In reply to Pulsebot from comment #10)
> https://hg.mozilla.org/integration/b2g-inbound/rev/2ce3db0db984
Ignore this, incorrect bug number.
Comment 12•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox41:
--- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in
before you can comment on or make changes to this bug.
Description
•