ladybird/Libraries/LibWebView
Timothy Flynn 0482b6bb57 LibWeb+LibWebView+WebContent: Implement versioning for document cookies
This patch introduces a cookie cache in the WebContent process to reduce
blocking IPC calls when JS accesses document.cookie. The UI process now
maintains a cookie version counter per-domain in shared memory. When JS
reads document.cookie, we check whether we have a valid cached cookie by
comparing the current shared version to the last used version. If they
match, the cached cookie is returned without IPC.

This optimization is based on Chromium's shared versioning, in which it
was observed that 87% of document.cookie accesses were redundant. See:
https://blog.chromium.org/2024/06/introducing-shared-memory-versioning-to.html

Note that this cache only supports document.cookie, not HTTP Cookie
headers. HTTP cookies are attached to requests with varying URLs and
paths. The cookies that match the document URL might not match the
request URL, which we wouldn't know from WebContent. So attaching the
cached document cookie would be incorrect.

On https://twinings.co.uk, we see approximately 600 document.cookie
requests while the page loads. This patch reduces the time spent in
the document.cookie getter from ~45ms to 2-3ms.
2026-02-05 07:28:07 -05:00
..
Plugins LibGfx+LibWeb: Resolve font features per font rather than per element 2026-02-02 14:11:43 +00:00
WebUI LibWebView: Add a settings section to manage browsing data caches 2025-11-12 09:06:21 -05:00
Application.cpp LibWebView+UI: Always ask the user where to save screenshots 2026-02-05 07:27:34 -05:00
Application.h LibWebView+UI: Add a context menu item to download images 2026-02-05 07:27:34 -05:00
Attribute.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Attribute.h LibWebView: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
Autocomplete.cpp LibHTTP+LibWeb+RequestServer: Move Fetch's HTTP header infra to LibHTTP 2025-11-27 14:57:29 +01:00
Autocomplete.h LibWebView: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
BrowserProcess.cpp LibWebView: Implement stubbed out BrowserProcess methods on Windows 2025-10-29 21:07:52 -06:00
BrowserProcess.h LibWebView: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
CMakeLists.txt LibWebView+UI: Add a context menu item to download images 2026-02-05 07:27:34 -05:00
ConsoleOutput.cpp LibDevTools+LibWebView+WebContent: Report exceptions to DevTools 2025-03-27 14:14:02 +00:00
ConsoleOutput.h LibWebView: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
CookieJar.cpp LibWeb+LibWebView+WebContent: Implement versioning for document cookies 2026-02-05 07:28:07 -05:00
CookieJar.h LibWeb+LibWebView+WebContent: Implement versioning for document cookies 2026-02-05 07:28:07 -05:00
DOMNodeProperties.cpp LibDevTools+LibWebView+WebContent: Selectively fetch DOM node properties 2025-03-20 09:01:26 +01:00
DOMNodeProperties.h LibWebView: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
FileDownloader.cpp LibWebView+UI: Add a context menu item to download images 2026-02-05 07:27:34 -05:00
FileDownloader.h LibWebView+UI: Add a context menu item to download images 2026-02-05 07:27:34 -05:00
Forward.h LibDatabase+LibWebView: Extract our SQLite wrapper to its own library 2025-10-14 13:40:33 +02:00
HeadlessWebView.cpp LibWebView: Notify all views when shared WebContent crashes 2026-01-13 23:57:46 +01:00
HeadlessWebView.h LibWebView: Notify all views when shared WebContent crashes 2026-01-13 23:57:46 +01:00
HelperProcess.cpp LibWeb+LibWebView+WebWorker: Enable the HTTP memory cache in workers 2026-01-22 07:05:06 -05:00
HelperProcess.h LibWebView: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
MachPortServer.cpp Everywhere: Move the thread name parameter for Thread constructors 2026-01-26 15:51:46 -06:00
MachPortServer.h Everywhere: Use a forward declaration for pointers to Threading::Thread 2025-09-22 17:28:21 -05:00
Menu.cpp LibWebView+UI: Add structures to hold context menu and action data 2025-09-11 14:23:45 -04:00
Menu.h LibWebView+UI: Add a context menu item to download images 2026-02-05 07:27:34 -05:00
Mutation.cpp LibWeb+LibWebView+WebContent: Inform the UI about DOM mutations 2025-03-08 01:25:55 +01:00
Mutation.h LibWebView: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
Native.css Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Options.h WebContent+LibWebView: Rename --layout-test-mode flag to --test-mode 2026-01-20 06:58:16 -05:00
PageInfo.h test-web: Dump stacking context tree in layout test output 2025-07-09 14:36:08 +02:00
Process.cpp LibCore+Everywhere: Make Windows's System::ioctl consistent with POSIX 2026-01-19 06:53:29 -05:00
Process.h test-web: Add results directory and live terminal display 2026-01-13 21:05:58 +01:00
ProcessHandle.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
ProcessHandle.h Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
ProcessManager.cpp LibWebView: Defer process cleanup to avoid signal handler deadlock 2026-01-13 21:05:58 +01:00
ProcessManager.h LibWebView: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
ProcessType.h LibWebView: Rename the Chrome process type to Browser 2025-03-15 19:57:27 -04:00
SearchEngine.cpp LibWebView: Support custom search engines 2025-04-06 13:45:10 +02:00
SearchEngine.h LibWebView: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
Settings.cpp LibWeb+LibWebView+WebContent: Replace DNT with GPC 2025-09-16 10:38:20 +02:00
Settings.h LibWeb+LibWebView+WebContent: Replace DNT with GPC 2025-09-16 10:38:20 +02:00
SiteIsolation.cpp LibWebView: Keep javascript URL navigations in the same process 2025-03-16 10:59:41 -04:00
SiteIsolation.h LibWebView: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
SourceHighlighter.cpp Everywhere: Replace miscellaneous references to the chrome process 2025-03-15 19:57:27 -04:00
SourceHighlighter.h Everywhere: Slap some [[clang::lifetimebound]] where appropriate 2025-09-01 11:11:38 +02:00
StorageJar.cpp LibWeb: Fix storage set broadcast event never broadcasting old value 2026-01-21 22:27:59 +01:00
StorageJar.h LibWeb: Fix storage set broadcast event never broadcasting old value 2026-01-21 22:27:59 +01:00
StorageSetResult.h LibWeb: Fix storage set broadcast event never broadcasting old value 2026-01-21 22:27:59 +01:00
UIProcessClient.ipc Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
UIProcessServer.ipc Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
URL.cpp LibWebView: Add a bit of explicit handling for "localhost:port" URLs 2025-11-08 11:14:44 -05:00
URL.h LibWebView: Return a ByteString from WebView::url_text_to_copy 2025-09-11 14:23:45 -04:00
UserAgent.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
UserAgent.h LibWebView: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
Utilities.cpp LibWebView+UI: Migrate some UI process init to LibWebView 2025-06-11 07:26:32 -04:00
Utilities.h LibWebView: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
ViewImplementation.cpp LibWeb+LibWebView+WebContent: Implement versioning for document cookies 2026-02-05 07:28:07 -05:00
ViewImplementation.h LibWeb+LibWebView+WebContent: Implement versioning for document cookies 2026-02-05 07:28:07 -05:00
WebContentClient.cpp LibWeb+LibWebView+WebContent: Implement versioning for document cookies 2026-02-05 07:28:07 -05:00
WebContentClient.h LibWeb+LibWebView+WebContent: Implement versioning for document cookies 2026-02-05 07:28:07 -05:00
WebUI.cpp Everywhere: Make TransportSocket non-movable 2025-04-09 15:27:52 +02:00
WebUI.h LibWebView: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00