Skip to content

Commit

Permalink
[GTK][Debug] ASSERTs on inspector tests
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=270447

Reviewed by Carlos Garcia Campos.

`InspectorTimelineAgent` uses a stack to store timeline records and
expects `pushCurrentRecord()`/`didCompleteCurrentRecord()` to be called
in the correct order.

But since frame rendering occurs more frequently than compositing,
associated records may be processed in the wrong order:

- push `TimelineRecordType::RenderingFrame`
- push `TimelineRecordType::Composite`
- complete `TimelineRecordType::RenderingFrame`
- complete `TimelineRecordType::Composite`

To prevent this, we must explicitly call `didComposite()` before pushing
a new `RenderingFrame` record, like it's done on Mac.

* Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::internalStart):

Canonical link: https://commits.webkit.org/275785@main
  • Loading branch information
obyknovenius committed Mar 7, 2024
1 parent 669cd08 commit 4a1b2c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ void InspectorTimelineAgent::internalStart(std::optional<int>&& maxCallStackDept
pushCurrentRecord(TimelineRecordFactory::createRenderingFrameData(name), TimelineRecordType::RenderingFrame, false, nullptr);
break;
case RunLoop::Event::DidDispatch:
if (m_startedComposite)
didComposite();
didCompleteCurrentRecord(TimelineRecordType::RenderingFrame);
break;
}
Expand Down

0 comments on commit 4a1b2c8

Please sign in to comment.