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)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(b2g-v1.4 fixed, b2g-v2.0 fixed)

RESOLVED FIXED
Tracking Status
b2g-v1.4 --- fixed
b2g-v2.0 --- fixed

People

(Reporter: janx, Assigned: etienne)

References

Details

Attachments

(1 file)

(deleted), text/x-github-pull-request
gaye
: review+
janx
: feedback+
Details
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
Blocks: butter-QA
Attached file Gaia PR (deleted) —
Awesome, I'm basically removing all the code :)
Attachment #8393023 - Flags: review?(gaye)
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+
Attachment #8393023 - Flags: review?(gaye) → review+
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+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
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
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: