2015-05-18 18:31:20 +00:00
|
|
|
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
|
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
2017-07-07 18:18:20 +00:00
|
|
|
part of dart.developer;
|
2015-05-18 18:31:20 +00:00
|
|
|
|
2021-05-13 19:19:55 +00:00
|
|
|
/// A UserTag can be used to group samples in the
|
2024-06-20 19:30:02 +00:00
|
|
|
/// [DevTools CPU profiler](https://docs.flutter.dev/tools/devtools/cpu-profiler).
|
2023-03-22 15:34:59 +00:00
|
|
|
abstract final class UserTag {
|
2015-05-18 18:31:20 +00:00
|
|
|
/// The maximum number of UserTag instances that can be created by a program.
|
2022-07-11 19:47:01 +00:00
|
|
|
static const maxUserTags = 64;
|
|
|
|
|
2017-01-05 11:23:51 +00:00
|
|
|
external factory UserTag(String label);
|
2015-05-18 18:31:20 +00:00
|
|
|
|
2024-05-03 15:29:29 +00:00
|
|
|
/// Label of this [UserTag].
|
2015-05-18 18:31:20 +00:00
|
|
|
String get label;
|
|
|
|
|
2024-05-03 15:29:29 +00:00
|
|
|
/// Make this [UserTag] the current tag for the isolate. Returns the current
|
|
|
|
/// tag before setting.
|
2015-05-18 18:31:20 +00:00
|
|
|
UserTag makeCurrent();
|
|
|
|
|
|
|
|
/// The default [UserTag] with label 'Default'.
|
2017-01-05 11:23:51 +00:00
|
|
|
external static UserTag get defaultTag;
|
2015-05-18 18:31:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Returns the current [UserTag] for the isolate.
|
2017-01-05 11:23:51 +00:00
|
|
|
external UserTag getCurrentTag();
|