Skip to content

Commit

Permalink
Web Inspector: Console cleared unexpectedly when inspector reopens
Browse files Browse the repository at this point in the history
rdar://124171190
https://bugs.webkit.org/show_bug.cgi?id=270607

Reviewed by Devin Rousso.

* Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::enable):
- Do not clear the backlog of messages when console agent is enabled.

Canonical link: https://commits.webkit.org/276705@main
  • Loading branch information
the-chenergy authored and rcaliman-apple committed Mar 26, 2024
1 parent e3a4419 commit fd9d7ea
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,8 @@ Protocol::ErrorStringOr<void> InspectorConsoleAgent::enable()
expiredMessage.addToFrontend(*m_frontendDispatcher, m_injectedScriptManager, false);
}

Vector<std::unique_ptr<ConsoleMessage>> messages;
m_consoleMessages.swap(messages);

for (size_t i = 0; i < messages.size(); ++i)
messages[i]->addToFrontend(*m_frontendDispatcher, m_injectedScriptManager, false);
for (auto& message : m_consoleMessages)
message->addToFrontend(*m_frontendDispatcher, m_injectedScriptManager, false);

return { };
}
Expand Down

0 comments on commit fd9d7ea

Please sign in to comment.