forked from mozilla-b2g/gaia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreflow.js
More file actions
39 lines (31 loc) · 817 Bytes
/
Copy pathreflow.js
File metadata and controls
39 lines (31 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'use strict';
const Cu = Components.utils;
(function(exports) {
if ('MozReflowAtom' in exports) {
return;
}
exports.MozReflowAtom = {
count: null,
_trackingManifest: null,
init: function rw_init() {
exports.addEventListener('developer-hud-update', this);
},
handleEvent: function rw_handleEvent(evt) {
var metric = evt.detail.metric.name || evt.detail.metric;
if (metric !== 'reflows' ||
evt.detail.manifest !== this._trackingManifest) {
return;
}
this.count++;
},
startTracking: function(manifestURL) {
this._trackingManifest = manifestURL;
this.count = 0;
},
stopTracking: function() {
this.count = 0;
this._trackingManifest = null;
},
};
exports.MozReflowAtom.init();
})(window);