servo/components/net/tests
Sebastian C 27c8a899ea
Replace hsts preload list hashmap with an FST (#37015)
This reduces the memory used by the preload list to just 1.9MB. The
total memory savings in HSTS from
pre-103cbed928
is now 62MB, or 96%. And in terms of total resident memory is a 7.5%
reduction. The DAFSA/DAWG used by Firefox is 1.1MB so there could be
additional gains available but this seems like the best option based on
maintained libraries available (I could not find a good maintained
library for DAFSAs in Rust).

The main trick is this: the FST map API is currently designed to map
byte sequences to u64 values. Because we only need to determine if a
preloaded domain has the `includeSubdomains` flag set, we encode that
into the lowest bit of the ids in the map. This way finding an entry in
the map directly provides us with the `includeSubdomains` flag and we
don't need to keep another mapping in memory or on disk.

Updated the `./mach update-hsts-preload` command to generate the new FST
map file. (Not sure if I need to update any dev-dependencies anywhere
for this change)

This change also replaces the use of "mozilla.org" with "example.com" in
the HSTS unit tests to make sure that entries in the preload list do not
influence the tests (since example.com should not ever end up on the
preload list)

Testing: Updated unit tests
Fixes: #25929

---------

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-05-20 04:26:55 +00:00
..
parsable_mime
cookie.rs Fix handling of __Secure- and __Host- Cookie prefixes (#33717) 2024-10-09 04:52:48 +00:00
cookie_http_state.rs dependencies: Upgrade cookie and rename Servo's Cookie to ServoCookie (#32861) 2024-07-26 16:13:39 +00:00
cookie_http_state_utils.py Fix remaining flake8 warnings 2020-06-21 03:34:32 +02:00
data_loader.rs Include WebViewId into EmbedderMsg variants where possible (#35211) 2025-01-30 11:15:35 +00:00
fetch.rs Embed user agent stylesheets and media control resouces in libservo (#36803) 2025-05-04 18:48:09 +00:00
file_loader.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
filemanager_thread.rs servoshell: Migrate to egui-file-dialog from tinyfiledialogs (#34823) 2025-02-04 18:24:24 +00:00
hsts.rs Replace hsts preload list hashmap with an FST (#37015) 2025-05-20 04:26:55 +00:00
http_cache.rs Update rustfmt to the 2024 style edition (#35764) 2025-03-03 11:26:53 +00:00
http_loader.rs fix: ReadableStream::get_in_memory_bytes too large (#36914) 2025-05-12 16:00:14 +00:00
main.rs Update FetchTaskTarget to propagate CSP violations. (#36409) 2025-04-13 20:54:59 +00:00
mime_classifier.rs clippy: fix warnings in components/net (#31564) 2024-03-10 15:34:16 +00:00
resource_thread.rs libservo: Remove a couple EmbedderMethods (#36276) 2025-04-01 22:59:50 +00:00
subresource_integrity.rs Update rustfmt to the 2024 style edition (#35764) 2025-03-03 11:26:53 +00:00
test.jpeg