@@ -30,26 +30,15 @@ const eventToInitiatorMap = new Map<Types.Events.Event, Types.Events.Event>();
3030// multiple events, hence why the value for this map is an array.
3131const initiatorToEventsMap = new Map < Types . Events . Event , Types . Events . Event [ ] > ( ) ;
3232
33- // Note: we are keeping the parsing of the following async JS schedulers
34- // for backwards compatibility only. They are targeted to be removed
35- // completely by M134. See more details at crbug.com/383974422
36- // TODO(andoli): remove manual parsing of async JS schedulers.
37- const requestAnimationFrameEventsById : Map < number , Types . Events . RequestAnimationFrame > = new Map ( ) ;
38- const timerInstallEventsById : Map < number , Types . Events . TimerInstall > = new Map ( ) ;
39- const requestIdleCallbackEventsById : Map < number , Types . Events . RequestIdleCallback > = new Map ( ) ;
40-
4133const webSocketCreateEventsById : Map < number , Types . Events . WebSocketCreate > = new Map ( ) ;
4234const schedulePostTaskCallbackEventsById : Map < number , Types . Events . SchedulePostTaskCallback > = new Map ( ) ;
4335
4436export function reset ( ) : void {
4537 lastScheduleStyleRecalcByFrame . clear ( ) ;
4638 lastInvalidationEventForFrame . clear ( ) ;
4739 lastUpdateLayoutTreeByFrame . clear ( ) ;
48- timerInstallEventsById . clear ( ) ;
4940 eventToInitiatorMap . clear ( ) ;
5041 initiatorToEventsMap . clear ( ) ;
51- requestAnimationFrameEventsById . clear ( ) ;
52- requestIdleCallbackEventsById . clear ( ) ;
5342 webSocketCreateEventsById . clear ( ) ;
5443 schedulePostTaskCallbackEventsById . clear ( ) ;
5544}
@@ -128,36 +117,6 @@ export function handleEvent(event: Types.Events.Event): void {
128117 }
129118 // Now clear the last invalidation for the frame: the last invalidation has been linked to a Layout event, so it cannot be the initiator for any future layouts.
130119 lastInvalidationEventForFrame . delete ( event . args . beginData . frame ) ;
131- } else if ( Types . Events . isRequestAnimationFrame ( event ) ) {
132- requestAnimationFrameEventsById . set ( event . args . data . id , event ) ;
133- } else if ( Types . Events . isFireAnimationFrame ( event ) ) {
134- // If we get a fire event, that means we should have had the
135- // RequestAnimationFrame event by now. If so, we can set that as the
136- // initiator for the fire event.
137- const matchingRequestEvent = requestAnimationFrameEventsById . get ( event . args . data . id ) ;
138- if ( matchingRequestEvent ) {
139- storeInitiator ( {
140- event,
141- initiator : matchingRequestEvent ,
142- } ) ;
143- }
144- } else if ( Types . Events . isTimerInstall ( event ) ) {
145- timerInstallEventsById . set ( event . args . data . timerId , event ) ;
146- } else if ( Types . Events . isTimerFire ( event ) ) {
147- const matchingInstall = timerInstallEventsById . get ( event . args . data . timerId ) ;
148- if ( matchingInstall ) {
149- storeInitiator ( { event, initiator : matchingInstall } ) ;
150- }
151- } else if ( Types . Events . isRequestIdleCallback ( event ) ) {
152- requestIdleCallbackEventsById . set ( event . args . data . id , event ) ;
153- } else if ( Types . Events . isFireIdleCallback ( event ) ) {
154- const matchingRequestEvent = requestIdleCallbackEventsById . get ( event . args . data . id ) ;
155- if ( matchingRequestEvent ) {
156- storeInitiator ( {
157- event,
158- initiator : matchingRequestEvent ,
159- } ) ;
160- }
161120 } else if ( Types . Events . isWebSocketCreate ( event ) ) {
162121 webSocketCreateEventsById . set ( event . args . data . identifier , event ) ;
163122 } else if ( Types . Events . isWebSocketInfo ( event ) || Types . Events . isWebSocketTransfer ( event ) ) {
0 commit comments