Skip to content

Commit

Permalink
Address requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
blaugold committed Feb 17, 2022
1 parent 3a08f0d commit 3f28026
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,11 @@ class PerformanceController extends DisposableController
List<TraceEventWrapper> traceEvents, {
bool isInitialUpdate = false,
}) {
final isFlutterApp = offlineController.offlineMode.value
? offlinePerformanceData != null &&
offlinePerformanceData.frames.isNotEmpty
: serviceManager.connectedApp.isFlutterAppNow;

final threadNameEvents = traceEvents
.map((TraceEventWrapper wrapper) => wrapper.event)
.where((TraceEvent event) {
Expand All @@ -589,7 +594,7 @@ class PerformanceController extends DisposableController
for (TraceEvent event in threadNameEvents) {
final name = event.args['name'];

if (isInitialUpdate) {
if (isFlutterApp && isInitialUpdate) {
// Android: "1.ui (12652)"
// iOS: "io.flutter.1.ui (12652)"
// MacOS, Linux, Windows, Dream (g3): "io.flutter.ui (225695)"
Expand Down Expand Up @@ -621,7 +626,7 @@ class PerformanceController extends DisposableController
threadNamesById[event.threadId] = name;
}

if (isInitialUpdate) {
if (isFlutterApp && isInitialUpdate) {
if (uiThreadId == null || rasterThreadId == null) {
log('Could not find UI thread and / or Raster thread from names: '
'${threadNamesById.values}');
Expand Down Expand Up @@ -862,6 +867,7 @@ class PerformanceController extends DisposableController
allTraceEvents.clear();
offlinePerformanceData = null;
cpuProfilerController.reset();
threadNamesById.clear();
data?.clear();
processor?.reset();
_flutterFrames.clear();
Expand Down

0 comments on commit 3f28026

Please sign in to comment.