Last Comment Bug 774987 - Memory leak and unnecessary copies in PresShell touch-event handling code
: Memory leak and unnecessary copies in PresShell touch-event handling code
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Layout (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla17
Assigned To: Wesley Johnston (:wesj)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-17 22:19 PDT by Chris Jones [:cjones] inactive; ni?/f?/r? if you need me
Modified: 2012-07-20 06:43 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (2.55 KB, patch)
2012-07-18 10:01 PDT, Wesley Johnston (:wesj)
no flags Details | Diff | Splinter Review
Patch v2 (2.71 KB, patch)
2012-07-18 10:12 PDT, Wesley Johnston (:wesj)
bugs: review+
Details | Diff | Splinter Review

Description Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-07-17 22:19:55 PDT
Memory leak

 http://mxr.mozilla.org/mozilla-central/source/layout/base/nsPresShell.cpp#5559

Unnecessary copies

 http://mxr.mozilla.org/mozilla-central/source/layout/base/nsPresShell.cpp#6503
 http://mxr.mozilla.org/mozilla-central/source/layout/base/nsPresShell.cpp#6553

(Since nsIDOMTouch is cycle collected, I think these unref's can be relatively expensive.)

Wes, want to grab these?
Comment 1 Wesley Johnston (:wesj) 2012-07-18 10:01:08 PDT
Created attachment 643424 [details] [diff] [review]
Patch

I think this is right?
Comment 2 Olli Pettay [:smaug] (way behind * queues, especially ni? queue) 2012-07-18 10:03:02 PDT
Comment on attachment 643424 [details] [diff] [review]
Patch

Why not 

nsPoint pt(aTouch->mRefPoint.x, aTouch->mRefPoint.y);
widget = frame->GetView()->GetNearestWidget(&pt);
Comment 3 Wesley Johnston (:wesj) 2012-07-18 10:12:21 PDT
Created attachment 643427 [details] [diff] [review]
Patch v2

I'm fine with that. Tested on Google maps. Everythings still good.
Comment 5 Ed Morley [:emorley] 2012-07-20 06:43:07 PDT
https://hg.mozilla.org/mozilla-central/rev/1341ea4e3c80

Note You need to log in before you can comment on or make changes to this bug.