Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0e40cc1ed3a51283798297dad6918ae54f132285
https://github.com/WebKit/WebKit/commit/0e40cc1ed3a51283798297dad6918ae54f132285
Author: Anuj Panta <[email protected]>
Date: 2026-07-13 (Mon, 13 Jul 2026)
Changed paths:
A
LayoutTests/http/tests/site-isolation/inspector/storage/storage-frontend-gate-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/storage/storage-frontend-gate.html
M
LayoutTests/http/tests/site-isolation/inspector/storage/storage-set-and-delete-cookies-expected.txt
M
LayoutTests/http/tests/site-isolation/inspector/storage/storage-set-and-delete-cookies.html
M LayoutTests/platform/mac-site-isolation/TestExpectations
M LayoutTests/platform/mac-wk2/TestExpectations
M Source/WebInspectorUI/UserInterface/Base/Main.js
A Source/WebInspectorUI/UserInterface/Controllers/StorageManager.js
M Source/WebInspectorUI/UserInterface/Main.html
M Source/WebInspectorUI/UserInterface/Models/CookieStorageObject.js
M Source/WebInspectorUI/UserInterface/Protocol/MultiplexingBackendTarget.js
M Source/WebInspectorUI/UserInterface/Test.html
M Source/WebInspectorUI/UserInterface/Test/Test.js
M Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js
M Source/WebKit/UIProcess/Inspector/Agents/InspectorStorageAgent.cpp
Log Message:
-----------
Web Inspector: [SI] wire the frontend cookie UI onto the UIProcess Storage
domain https://bugs.webkit.org/show_bug.cgi?id=318789 rdar://181612724
Reviewed by Qianlang Chen.
Wire the frontend onto the UIProcess Storage domain added in the previous
commit so cookie inspection sees cross-origin iframe cookies under Site
Isolation, which the in-process Page cookie commands cannot.
WI.StorageManager owns the domain's enable/disable lifecycle. Like
BrowserManager, the Storage domain lives on the UIProcess (multiplexing)
backend target, so MultiplexingBackendTarget.initialize() calls
storageManager.initializeTarget() directly -- that target is added without
dispatching TargetAdded and its initialize() does not iterate WI.managers,
so an explicit call is required for the enable to actually reach the backend
(the same reason browserManager is wired there). The manager exposes the gate
WI.storageManager.shouldUseStorageDomain: true only when Site Isolation is
active (a WI.FrameTarget exists) and the backend declares the Storage domain.
WI.isSiteIsolationEnabled is promoted from the test harness into Base/Main.js
(kept in Test.js, matching the other duplicated target utilities) so
production can read it.
WI.CookieStorageObject (the represented object) owns cookie get/set/delete
and the choice of backend: under Site Isolation it routes through
WI.backendTarget.StorageAgent (which reads the authoritative NetworkProcess
store and so sees out-of-process cross-origin iframe cookies), otherwise it
keeps the exact legacy Page path -- non-Site-Isolation sessions are unchanged.
The model also exposes canGetCookies / canSetCookie / canDeleteCookie in place
of the hardcoded Page.* command checks. Storage.deleteCookies is filter-based,
so a single-cookie delete targets it by (name, domain, path).
CookieStorageContentView only asks the represented object for cookies and for
which operations are available; it no longer knows which backend serves them.
The view refreshes on TargetAdded (gated by the model's
reloadsCookiesOnTargetAdded) so a cookie set by a cross-origin iframe appears
once that frame becomes its own target.
setCookie no longer files a session cookie as epoch-expired: getCookies
serializes a session cookie's absent expiry as 0 (Cookie::expires is
optional), and echoing that back set expires to the 1970 epoch. Honor
`session` (and reject a non-positive timestamp) so the set/get round-trip
preserves session cookies, matching WI.Cookie's own (!session && expires)
rule.
The two tests that require an out-of-process frame target skip on the
Site-Isolation-off bot (they await a TargetAdded that never fires) and pass
on mac-site-isolation, matching the sibling frame-target tests.
Test: http/tests/site-isolation/inspector/storage/storage-frontend-gate.html
*
LayoutTests/http/tests/site-isolation/inspector/storage/storage-frontend-gate-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/storage/storage-frontend-gate.html:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/storage/storage-set-and-delete-cookies-expected.txt:
*
LayoutTests/http/tests/site-isolation/inspector/storage/storage-set-and-delete-cookies.html:
* LayoutTests/platform/mac-site-isolation/TestExpectations:
* LayoutTests/platform/mac-wk2/TestExpectations:
* Source/WebInspectorUI/UserInterface/Base/Main.js:
(WI.loaded):
* Source/WebInspectorUI/UserInterface/Controllers/StorageManager.js: Added.
(WI.StorageManager):
(WI.StorageManager.prototype.get domains):
(WI.StorageManager.prototype.activateExtraDomain):
(WI.StorageManager.prototype.initializeTarget):
(WI.StorageManager.prototype.get shouldUseStorageDomain):
(WI.StorageManager.prototype.get hasStorageDomain):
(WI.StorageManager.prototype.enable):
(WI.StorageManager.prototype.disable):
* Source/WebInspectorUI/UserInterface/Main.html:
* Source/WebInspectorUI/UserInterface/Models/CookieStorageObject.js:
(WI.CookieStorageObject.prototype.get canGetCookies):
(WI.CookieStorageObject.prototype.get canSetCookie):
(WI.CookieStorageObject.prototype.get canDeleteCookie):
(WI.CookieStorageObject.prototype.get reloadsCookiesOnTargetAdded):
(WI.CookieStorageObject.prototype.getCookies):
(WI.CookieStorageObject.prototype.setCookie):
(WI.CookieStorageObject.prototype.deleteCookie):
(WI.CookieStorageObject.prototype.get _useStorageDomain):
* Source/WebInspectorUI/UserInterface/Protocol/MultiplexingBackendTarget.js:
(WI.MultiplexingBackendTarget.prototype.initialize):
* Source/WebInspectorUI/UserInterface/Test.html:
* Source/WebInspectorUI/UserInterface/Test/Test.js:
(WI.loaded):
* Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js:
(WI.CookieStorageContentView):
(WI.CookieStorageContentView.prototype.closed):
(WI.CookieStorageContentView.prototype.tableCellContextMenuClicked):
(WI.CookieStorageContentView.prototype.tableDidRemoveRows):
(WI.CookieStorageContentView.prototype.get _canGetCookies):
(WI.CookieStorageContentView.prototype.get _canSetCookie):
(WI.CookieStorageContentView.prototype.get _canDeleteCookie):
(WI.CookieStorageContentView.prototype._getCookies):
(WI.CookieStorageContentView.prototype._setCookie):
(WI.CookieStorageContentView.prototype._deleteCookie):
(WI.CookieStorageContentView.prototype._handleTargetAdded):
(WI.CookieStorageContentView.prototype.async _willDismissCookiePopover):
(WI.CookieStorageContentView.prototype._handleClearNavigationItemClicked):
(WI.CookieStorageContentView.prototype._reloadCookies):
(WI.CookieStorageContentView.prototype._handleTableKeyDown):
* Source/WebKit/UIProcess/Inspector/Agents/InspectorStorageAgent.cpp:
(WebKit::InspectorStorageAgent::setCookie):
Canonical link: https://commits.webkit.org/317130@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications