Closed Bug 489581 Opened 11 years ago Closed 11 years ago

Reduce Addref/Release when calling event handlers

Categories

(Core :: DOM: Events, defect)

x86
All
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: smaug, Assigned: smaug)

Details

Attachments

(1 file)

Attached patch patchSplinter Review
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
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.