From fc23666842768b09efd143e8d8232497eb57598e Mon Sep 17 00:00:00 2001 From: ankur22 Date: Tue, 8 Nov 2022 16:26:57 +0000 Subject: [PATCH] Remove the child frame check in recalcLifecycle The reason this was in place was due to out of order CDP events. Before PR #555, there was a slim chance that the root frame would receive lifecycle events before its child frames. This is now not the case and we can see after extensive stress tests that the child frame first receives CDP events and then the root/main frame. --- common/frame.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/common/frame.go b/common/frame.go index 77abc7cd5..15bd76e78 100644 --- a/common/frame.go +++ b/common/frame.go @@ -200,25 +200,6 @@ func (f *Frame) recalculateLifecycle() { } f.lifecycleEventsMu.RUnlock() - // Only consider a life cycle event as fired if it has triggered for all of subtree. - f.childFramesMu.RLock() - { - for child := range f.childFrames { - cf := child.(*Frame) - // a precaution for preventing a deadlock in *Frame.childFramesMu - if cf == f { - continue - } - cf.recalculateLifecycle() - for k := range events { - if !cf.hasSubtreeLifecycleEventFired(k) { - delete(events, k) - } - } - } - } - f.childFramesMu.RUnlock() - // Check if any of the fired events should be considered fired when looking at the entire subtree. mainFrame := f.manager.MainFrame() for k := range events {