Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c6598da6cf2a095929b14ae38e135f9a08ef9fcd
https://github.com/WebKit/WebKit/commit/c6598da6cf2a095929b14ae38e135f9a08ef9fcd
Author: Anuj Panta <[email protected]>
Date: 2025-11-11 (Tue, 11 Nov 2025)
Changed paths:
M Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
M Source/WebKit/UIProcess/Automation/WebAutomationSession.h
M Source/WebKit/UIProcess/Automation/protocol/BidiBrowsingContext.json
M Source/WebKit/UIProcess/WebFrameProxy.cpp
M Source/WebKit/UIProcess/WebFrameProxy.h
Log Message:
-----------
WebDriver Bidi: implement context created event and destroyed
https://bugs.webkit.org/show_bug.cgi?id=297401
rdar://158325731
Reviewed by BJ Burg.
Added contextCreated and contextDestroyed events to track browsing context life
cycles.
Events are emitted at key points in page and frame creation/destruction to
provide proper
information like parent relationship and opener details. Hooking into
didCreatePage()
and didCreateSubFrame() for creation events. We recursively emit events for
existing frame
hierarchies with getAllFrameTrees(). Destruction events are triggered from
disconnect() for
frames and willClosePage() for pages. A key note is cleanup logic about
removing context
handles from the m_handleWebPageMap was moved to the new destruction methods.
* Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::closeBrowsingContext):
(WebKit::WebAutomationSession::didCreatePage):
(WebKit::WebAutomationSession::emitContextCreatedEvent):
(WebKit::getClientWindowAndUserContext):
(WebKit::WebAutomationSession::getOpenerPage):
(WebKit::WebAutomationSession::didCreateFrame):
(WebKit::WebAutomationSession::willDestroyFrame):
(WebKit::WebAutomationSession::contextCreatedForFrame):
(WebKit::WebAutomationSession::recursivelyEmitContextCreatedEvent):
(WebKit::WebAutomationSession::contextDestroyedForPage):
(WebKit::WebAutomationSession::contextDestroyedForFrame):
(WebKit::WebAutomationSession::willClosePage):
* Source/WebKit/UIProcess/Automation/WebAutomationSession.h:
* Source/WebKit/UIProcess/Automation/protocol/BidiBrowsingContext.json:
* Source/WebKit/UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::disconnect):
(WebKit::WebFrameProxy::isConnected const):
(WebKit::WebFrameProxy::didCreateSubframe):
* Source/WebKit/UIProcess/WebFrameProxy.h:
Canonical link: https://commits.webkit.org/302865@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications