Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5c7bdc5d1f25eebabd8f7079279232e02d629df9
https://github.com/WebKit/WebKit/commit/5c7bdc5d1f25eebabd8f7079279232e02d629df9
Author: Qianlang Chen <[email protected]>
Date: 2026-01-12 (Mon, 12 Jan 2026)
Changed paths:
M Source/WebKit/UIProcess/Inspector/WebInspectorBackendProxy.cpp
M Source/WebKit/UIProcess/Inspector/WebInspectorBackendProxy.h
M Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp
M Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.h
Log Message:
-----------
Web Inspector: Break ref-cycle between WebInspectorUIProxy and
WebInspectorBackendProxy
rdar://167106238
https://bugs.webkit.org/show_bug.cgi?id=305138
Reviewed by BJ Burg.
WebInspectorUIProxy and WebInspectorBackendProxy must not hold strong
refs to each other. Given the backend proxy is created by the UI, make
its m_proxy a weak ref. This is safe despite the backend proxy is
ref-counted because its other user AuxiliaryProcess only stores weak
refs to message receivers, meaning WebInspectorBackendProxy cannot
outlive its owner WebInspectorUIProxy.
No new tests: no change in observable behavior. Tested manually that
inspector opens and closes OK, and element selection works fine.
* Source/WebKit/UIProcess/Inspector/WebInspectorBackendProxy.h:
* Source/WebKit/UIProcess/Inspector/WebInspectorBackendProxy.cpp:
(WebKit::WebInspectorBackendProxy::requestOpenLocalInspectorFrontend):
(WebKit::WebInspectorBackendProxy::didClose):
(WebKit::WebInspectorBackendProxy::bringToFront):
(WebKit::WebInspectorBackendProxy::elementSelectionChanged):
(WebKit::WebInspectorBackendProxy::timelineRecordingChanged):
(WebKit::WebInspectorBackendProxy::setDeveloperPreferenceOverride):
(WebKit::WebInspectorBackendProxy::setEmulatedConditions):
(WebKit::WebInspectorBackendProxy::attachAvailabilityChanged):
(WebKit::WebInspectorBackendProxy::WebInspectorBackendProxy):
(WebKit::WebInspectorBackendProxy::protectedProxy const):
Use WeakRef to break the ref cycle.
* Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.h:
* Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp:
(WebKit::WebInspectorUIProxy::WebInspectorUIProxy):
(WebKit::WebInspectorUIProxy::updateForNewPageProcess):
Using a const Ref should be cleaner given m_backend can't be null.
Canonical link: https://commits.webkit.org/305482@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications