[web_startup_analyzer] small fixes

startup_cleanup
Kevin Moore 8 months ago
parent 5b6d214d2a
commit ca8118a06c

@ -18,16 +18,16 @@ class FrameAnalyzer {
FrameAnalyzer(this._binding, {this.additionalFrames = 10}) FrameAnalyzer(this._binding, {this.additionalFrames = 10})
: _remainingFrames = additionalFrames; : _remainingFrames = additionalFrames;
Future captureAdditionalFrames() { Future<void> captureAdditionalFrames() {
_binding.addTimingsCallback(_timingsCallback); _binding.addTimingsCallback(_timingsCallback);
return _onDone.future; return _onDone.future;
} }
_reportFrame(FrameTiming frameTiming) { void _reportFrame(FrameTiming frameTiming) {
additionalFrameTimes.add(frameTiming.totalSpan.inMilliseconds); additionalFrameTimes.add(frameTiming.totalSpan.inMilliseconds);
} }
_timingsCallback(timings) { void _timingsCallback(List<FrameTiming> timings) {
int i = 0; int i = 0;
while (_remainingFrames > 0 && i < timings.length) { while (_remainingFrames > 0 && i < timings.length) {
_reportFrame(timings[i]); _reportFrame(timings[i]);

@ -9,6 +9,7 @@ import 'web_startup_analyzer_base.dart';
class WebStartupAnalyzer extends WebStartupAnalyzerBase { class WebStartupAnalyzer extends WebStartupAnalyzerBase {
WebStartupAnalyzer({int additionalFrameCount = 0}); WebStartupAnalyzer({int additionalFrameCount = 0});
@override
List<int>? get additionalFrames => []; List<int>? get additionalFrames => [];
@override @override

Loading…
Cancel
Save