mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb+LibWebView+WebContent: Perform cookie URL filtering in the UI
When cookies change or expire, we currently send a list of all changed cookies to all WebContent processes. We then filter that list in the WebContent process for cookies that match the page's URL before sending out cookie change events to JS. We now perform this filtering in the UI process, so each WebContent process only receives the cookies it would be interested in, if any. This serves two purposes: 1. Less IPC chatter. 2. This will let each ViewImplementation know that its cookie value has actually changed. (2) is for an upcoming change that will introduce a cookie cache, and will allow each view to know it should bust that cache. Note that for this filtering to work, we must iterate ViewImplementation instances rather than WebContentClient in order to have the view's URL. We must then associate the IPC with the view's page ID. No changes to the /cookiestore WPT subtests.
This commit is contained in:
Notes:
github-actions[bot]
2026-02-06 10:48:35 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/76eb5b2fa65 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7700
@@ -259,6 +259,11 @@ void ViewImplementation::set_preferred_motion(Web::CSS::PreferredMotion motion)
|
||||
client().async_set_preferred_motion(page_id(), motion);
|
||||
}
|
||||
|
||||
void ViewImplementation::notify_cookies_changed(ReadonlySpan<Web::Cookie::Cookie> cookies)
|
||||
{
|
||||
client().async_cookies_changed(page_id(), cookies);
|
||||
}
|
||||
|
||||
ByteString ViewImplementation::selected_text()
|
||||
{
|
||||
return client().get_selected_text(page_id());
|
||||
|
||||
Reference in New Issue
Block a user