Closed Bug 1477640 Opened 6 years ago Closed 6 years ago

AsyncEventDispatcher(dom::EventTarget* aTarget, dom::Event* aEvent) does not care dom::Event::mEvent

Categories

(Core :: DOM: Events, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

Details

Attachments

(1 file)

AsyncEventDispatcher(dom::EventTarget* aTarget, dom::Event* aEvent) just grabs instance of aEvent as is. However, if it were created with Widget*Event allocated in stack, it'll keep referring outdated address.  Fortunately, there is no such bug in current code. However, I think that we should make the constructor:

* call dom::Event::DuplicatePrivateData()

or

* insert MOZ_ASSERT to check dom::Event::mEventIsInternal

How do you think, smaug?
Flags: needinfo?(bugs)
I think I'd prefer the assert. AsyncEventDispatcher isn't supposed to be used with stack allocated stuff.
Flags: needinfo?(bugs)
Comment on attachment 8994423 [details]
Bug 1477640 - Make AsyncEventDispatcher(dom::EventTarget* aTarget, dom::Event* aEvent) crash in debug build if aEvent is not safe to be dispatched asynchronously

https://reviewboard.mozilla.org/r/258978/#review266020
Attachment #8994423 - Flags: review?(bugs) → review+
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/f2a5ae30413b
Make AsyncEventDispatcher(dom::EventTarget* aTarget, dom::Event* aEvent) crash in debug build if aEvent is not safe to be dispatched asynchronously r=smaug
https://hg.mozilla.org/mozilla-central/rev/f2a5ae30413b
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Assignee: nobody → masayuki
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: