Reduce Addref/Release when calling event handlers

RESOLVED FIXED

Status

()

Core
DOM: Events
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: smaug, Assigned: smaug)

Tracking

Trunk
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Created attachment 374070 [details] [diff] [review]
patch

Depending on the case this speeds up event handling up to 6-7%.
Usually a lot less.

I need to run tests...
Btw, I found this while debugging nsCxPusher::Push/JSContextStack::Push
Assignee: nobody → Olli.Pettay
Attachment #374070 - Flags: superreview?(jst)
Attachment #374070 - Flags: review?(jst)
Comment on attachment 374070 [details] [diff] [review]
patch

Passed the tests.

So I'm swapping out-param and return value.
Even though changes to nsContentUtils::GetContextForEventHandlers are simple, it needs to be reviewed carefully.

NS_ENSURE_SUCCESS in nsXHREventTarget::AddEventListener isn't actually a must-have, but since I added the comment that caller must check the rv value...
Comment on attachment 374070 [details] [diff] [review]
patch

Looks good to me, and I did look through nsContentUtils::GetContextForEventHandlers() in detail as well.
Attachment #374070 - Flags: superreview?(jst)
Attachment #374070 - Flags: superreview+
Attachment #374070 - Flags: review?(jst)
Attachment #374070 - Flags: review+
http://hg.mozilla.org/mozilla-central/rev/24bb97995e9b
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.