Unverified Commit aba7bc3f authored by Martin Kustermann's avatar Martin Kustermann Committed by GitHub

Use wasm-compatible conditional import in timeline.dart, avoid emitting...

Use wasm-compatible conditional import in timeline.dart, avoid emitting timeline events in SchedulerBinding (#144682)
parent 7a88767a
......@@ -8,7 +8,7 @@ import 'dart:typed_data';
import 'package:meta/meta.dart';
import '_timeline_io.dart'
if (dart.library.js_util) '_timeline_web.dart' as impl;
if (dart.library.js_interop) '_timeline_web.dart' as impl;
import 'constants.dart';
/// Measures how long blocks of code take to run.
......
......@@ -1318,13 +1318,17 @@ mixin SchedulerBinding on BindingBase {
final List<FrameCallback> localPostFrameCallbacks =
List<FrameCallback>.of(_postFrameCallbacks);
_postFrameCallbacks.clear();
Timeline.startSync('POST_FRAME');
if (!kReleaseMode) {
FlutterTimeline.startSync('POST_FRAME');
}
try {
for (final FrameCallback callback in localPostFrameCallbacks) {
_invokeFrameCallback(callback, _currentFrameTimeStamp!);
}
} finally {
Timeline.finishSync();
if (!kReleaseMode) {
FlutterTimeline.finishSync();
}
}
} finally {
_schedulerPhase = SchedulerPhase.idle;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment