Closed
Bug 982196
Opened 11 years ago
Closed 11 years ago
Make the ReflowHelper listen on 'developer-hud-update' events
Categories
(Firefox OS Graveyard :: Gaia::TestAgent, defect)
Tracking
(b2g-v1.4 fixed, b2g-v2.0 fixed)
RESOLVED
FIXED
People
(Reporter: janx, Assigned: etienne)
References
Details
Attachments
(1 file)
When the Developer HUD has a nicer API, use it in the ReflowHelper.
To update the reflow count of an app, simply listen for the 'developer-hud-update' event on the System App:
- Check that `event.detail.metric === 'reflows'`
- The app's manifest url is `event.detail.manifest`
- The frame that caused the reflow is `event.target`
- The total number of reflows for that app is `event.detail.value`
You will need the following prefs:
- devtools.debugger.forbid-certified-apps: false
- devtools.overlay: true
- hud.reflows: true
Assignee | ||
Comment 1•11 years ago
|
||
Awesome, I'm basically removing all the code :)
Attachment #8393023 -
Flags: review?(gaye)
Reporter | ||
Comment 2•11 years ago
|
||
Comment on attachment 8393023 [details]
Gaia PR
Indeed! Looks much better now.
You could also make the code smaller still by removing the `reflowWatcher` object entirely, using only `count` and `trackingManifest` as state variables, and performing the state changes directly in the atom functions plus an event listener function.
Attachment #8393023 -
Flags: feedback+
Updated•11 years ago
|
Attachment #8393023 -
Flags: review?(gaye) → review+
Reporter | ||
Comment 3•11 years ago
|
||
Thanks for addressing my nit!
I still prefer scoped variables to object members, and calling `addEventListener` directly in the main closure rather than defining a `MozReflowAtom.init()` method, but that's just me :) r+
Assignee | ||
Comment 4•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Comment 5•11 years ago
|
||
We uplifted this into 1.4 in the hope that this will fix an intermittent error that we are seeing in bug 982196.
https://github.com/mozilla-b2g/gaia/commit/b7216ec7bcbe14e49a3869e369a85b674d3079c1
status-b2g-v1.4:
--- → fixed
status-b2g-v2.0:
--- → fixed
Updated•9 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•