Unverified Commit 722b4277 authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Provide a non-null default value for the compute debug label in release mode (#49638)

parent e7984bd4
...@@ -12,9 +12,7 @@ import 'isolates.dart' as isolates; ...@@ -12,9 +12,7 @@ import 'isolates.dart' as isolates;
/// The dart:io implementation of [isolate.compute]. /// The dart:io implementation of [isolate.compute].
Future<R> compute<Q, R>(isolates.ComputeCallback<Q, R> callback, Q message, { String debugLabel }) async { Future<R> compute<Q, R>(isolates.ComputeCallback<Q, R> callback, Q message, { String debugLabel }) async {
if (!kReleaseMode) { debugLabel ??= kReleaseMode ? 'compute' : callback.toString();
debugLabel ??= callback.toString();
}
final Flow flow = Flow.begin(); final Flow flow = Flow.begin();
Timeline.startSync('$debugLabel: start', flow: flow); Timeline.startSync('$debugLabel: start', flow: flow);
final ReceivePort resultPort = ReceivePort(); final ReceivePort resultPort = ReceivePort();
...@@ -80,7 +78,7 @@ class _IsolateConfiguration<Q, R> { ...@@ -80,7 +78,7 @@ class _IsolateConfiguration<Q, R> {
Future<void> _spawn<Q, R>(_IsolateConfiguration<Q, FutureOr<R>> configuration) async { Future<void> _spawn<Q, R>(_IsolateConfiguration<Q, FutureOr<R>> configuration) async {
R result; R result;
await Timeline.timeSync( await Timeline.timeSync(
'${configuration.debugLabel}', configuration.debugLabel,
() async { () async {
final FutureOr<R> applicationResult = await configuration.apply(); final FutureOr<R> applicationResult = await configuration.apply();
result = await applicationResult; result = await applicationResult;
......
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