Closed
Bug 826025
Opened 12 years ago
Closed 12 years ago
Clean up BrowserEventHandler.handleUserEvent()
Categories
(Firefox for Android Graveyard :: General, defect)
Firefox for Android Graveyard
General
Tracking
(firefox19 wontfix, firefox20 fixed)
RESOLVED
FIXED
Firefox 20
People
(Reporter: tetsuharu, Assigned: tetsuharu)
Details
Attachments
(2 files, 1 obsolete file)
7.90 KB,
patch
|
cpeterson
:
review+
|
Details | Diff | Splinter Review |
3.86 KB,
patch
|
cpeterson
:
review+
|
Details | Diff | Splinter Review |
I seem that we can clean up this part like following:
* Use "switch" instead of "else if" series in BrowserApp.observe().
* Add some variables to cache properties which are accessed many times & never changed in this method.
Assignee | ||
Comment 1•12 years ago
|
||
(In reply to Tetsuharu OHZEKI [:saneyuki_s] from comment #0)
> * Use "switch" instead of "else if" series in BrowserApp.observe().
Oops. This is `Use "switch" instead of "else if" series`.
Assignee | ||
Comment 2•12 years ago
|
||
> * Use "switch" instead of "else if" series.
> * Add some variables to cache properties which are accessed many times &
> never changed in this method.
Chris, how do you think about these plan?
Assignee | ||
Comment 3•12 years ago
|
||
Comment 4•12 years ago
|
||
Cc'ing kats, because it looks like he's worked in here a lot.
Comment 5•12 years ago
|
||
This patch looks fine. What properties were you looking to cache?
Assignee | ||
Comment 6•12 years ago
|
||
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #5)
> This patch looks fine. What properties were you looking to cache?
Part 1 is only changing to "switch" statement.
I made the part 2, this add some variables to cache |data.x|, |data.y|, and |this._scrollableElement|.
But caching |this._scrollableElement| may be risky.
Assignee | ||
Updated•12 years ago
|
Attachment #697216 -
Flags: feedback?(bugmail.mozilla)
Comment 7•12 years ago
|
||
Adding local variables for data.x and data.y looks good to me. The new names are shorter and the function is no longer modifying its input parameters (data), which is bad form. :)
But I agree with Kats that caching this._scrollableElement (or any "this.*" variables) sounds too risky. This function might (now or in the future) call other functions that depend on this._scrollableElement, so we would not want it to be out of date.
Assignee: nobody → saneyuki.s.snyk
Status: NEW → ASSIGNED
Assignee | ||
Comment 8•12 years ago
|
||
I changed that adding only data.(x|y).
Chris, May I ask you a review?
Attachment #697216 -
Attachment is obsolete: true
Attachment #697216 -
Flags: feedback?(bugmail.mozilla)
Attachment #697301 -
Flags: review?(cpeterson)
Assignee | ||
Updated•12 years ago
|
Attachment #697175 -
Flags: review?(cpeterson)
Comment 9•12 years ago
|
||
(In reply to Chris Peterson (:cpeterson) from comment #7)
> But I agree with Kats that caching this._scrollableElement (or any "this.*"
It wasn't me that said that, but I agree with that anyway :)
Comment 10•12 years ago
|
||
Comment on attachment 697175 [details] [diff] [review]
part1-v1: Use "switch" instead of "else if"
Review of attachment 697175 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM!
Attachment #697175 -
Flags: review?(cpeterson) → review+
Comment 11•12 years ago
|
||
Comment on attachment 697301 [details] [diff] [review]
part 2-v2: add some variable to cache
Review of attachment 697301 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM!
Attachment #697301 -
Flags: review?(cpeterson) → review+
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 12•12 years ago
|
||
I can land the patches, but I'm waiting for test results from the Try server first:
https://tbpl.mozilla.org/?tree=Try&rev=b9e2b15cb82f
Comment 13•12 years ago
|
||
Looks like someone already landed these patches on mozilla-inbound:
https://hg.mozilla.org/integration/mozilla-inbound/rev/190318a9118a
https://hg.mozilla.org/integration/mozilla-inbound/rev/29080e5ecaed
status-firefox19:
--- → wontfix
status-firefox20:
--- → fixed
Keywords: checkin-needed
Target Milestone: --- → Firefox 20
Comment 14•12 years ago
|
||
Comment 15•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/190318a9118a
https://hg.mozilla.org/mozilla-central/rev/29080e5ecaed
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•