@@ -464,7 +464,6 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
464464 content : adornerContent ,
465465 } ;
466466 this . #traceEngineModel = traceModel || this . #instantiateNewModel( ) ;
467- this . #listenForProcessingProgress( ) ;
468467
469468 this . element . addEventListener ( 'contextmenu' , this . contextMenu . bind ( this ) , false ) ;
470469 this . dropTarget = new UI . DropTarget . DropTarget (
@@ -744,7 +743,25 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
744743 config . includeRuntimeCallStats = Root . Runtime . experiments . isEnabled ( 'timeline-v8-runtime-call-stats' ) ;
745744 config . debugMode = Root . Runtime . experiments . isEnabled ( Root . Runtime . ExperimentName . TIMELINE_DEBUG_MODE ) ;
746745
747- return Trace . TraceModel . Model . createWithAllHandlers ( config ) ;
746+ const traceEngineModel = Trace . TraceModel . Model . createWithAllHandlers ( config ) ;
747+
748+ traceEngineModel . addEventListener ( Trace . TraceModel . ModelUpdateEvent . eventName , e => {
749+ const updateEvent = e as Trace . TraceModel . ModelUpdateEvent ;
750+ const str = i18nString ( UIStrings . processed ) ;
751+
752+ // Trace Engine will report progress from [0...1] but we still have more work to do. So, scale them down a bit.
753+ const traceParseMaxProgress = 0.7 ;
754+
755+ if ( updateEvent . data . type === Trace . TraceModel . ModelUpdateType . COMPLETE ) {
756+ this . statusDialog ?. updateProgressBar ( str , 100 * traceParseMaxProgress ) ;
757+ } else if ( updateEvent . data . type === Trace . TraceModel . ModelUpdateType . PROGRESS_UPDATE ) {
758+ const data = updateEvent . data . data ;
759+ this . statusDialog ?. updateProgressBar ( str , data . percent * 100 * traceParseMaxProgress ) ;
760+ }
761+ } ) ;
762+
763+ this . #traceEngineModel = traceEngineModel ;
764+ return this . #traceEngineModel;
748765 }
749766
750767 static extensionDataVisibilitySetting ( ) : Common . Settings . Setting < boolean > {
@@ -2102,7 +2119,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
21022119
21032120 private onClearButton ( ) : void {
21042121 this . #historyManager. clear ( ) ;
2105- this . #traceEngineModel = this . # instantiateNewModel( ) ;
2122+ this . #instantiateNewModel( ) ;
21062123 ModificationsManager . reset ( ) ;
21072124 this . #uninstallSourceMapsResolver( ) ;
21082125 this . flameChart . getMainDataProvider ( ) . reset ( ) ;
@@ -2514,23 +2531,6 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
25142531 this . statusDialog ?. updateStatus ( i18nString ( UIStrings . processingTrace ) ) ;
25152532 }
25162533
2517- #listenForProcessingProgress( ) : void {
2518- this . #traceEngineModel. addEventListener ( Trace . TraceModel . ModelUpdateEvent . eventName , e => {
2519- const updateEvent = e as Trace . TraceModel . ModelUpdateEvent ;
2520- const str = i18nString ( UIStrings . processed ) ;
2521-
2522- // Trace Engine will report progress from [0...1] but we still have more work to do. So, scale them down a bit.
2523- const traceParseMaxProgress = 0.7 ;
2524-
2525- if ( updateEvent . data . type === Trace . TraceModel . ModelUpdateType . COMPLETE ) {
2526- this . statusDialog ?. updateProgressBar ( str , 100 * traceParseMaxProgress ) ;
2527- } else if ( updateEvent . data . type === Trace . TraceModel . ModelUpdateType . PROGRESS_UPDATE ) {
2528- const data = updateEvent . data . data ;
2529- this . statusDialog ?. updateProgressBar ( str , data . percent * 100 * traceParseMaxProgress ) ;
2530- }
2531- } ) ;
2532- }
2533-
25342534 #onSourceMapsNodeNamesResolved( ) : void {
25352535 // Source maps can change the way calls hierarchies should look in
25362536 // the flame chart (f.e. if some calls are ignore listed after
0 commit comments