servo/components/shared/net
Tim van der Lippe 8a837778d9
Create new image cache per document (#36832)
Rather than sharing the full image cache in a script_thread, the image
cache is now unique per document. This ensures that CSP factors no
longer affect whether the image is retrieved from the cache incorrectly.

To do so, the thread_pool is shared across all caches, but the store is
fresh. Except for the place_holder{image,url}, which are cloned. That's
because the `rippy_data` is only available in the constellation and no
longer accessible at the point that we need to create the document in
the script_thread.

Contrary to the description in #36505, the script_thread still has an
image_cache for this reason: so it has access to the store and
thread_pool to clone it.

With these changes, the two CSP tests no longer flake. Confirmed with
running the following commmand:

```
./mach test-wpt tests/wpt/tests/content-security-policy/generic/ --rerun=10
```

Fixes #36505

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-05-04 20:20:56 +00:00
..
fetch fix many clippy warnings (#33510) 2024-09-21 13:58:31 +00:00
tests [#34767] - Range header is missing from CORS header safelist (#35138) 2025-01-24 17:31:27 +00:00
blob_url_store.rs Fix more clippy warnings in components/shared/net (#31548) 2024-03-10 17:47:38 +00:00
Cargo.toml resources: Remove baked in resources (#36042) 2025-04-17 05:12:44 +00:00
filemanager_thread.rs servoshell: Migrate to egui-file-dialog from tinyfiledialogs (#34823) 2025-02-04 18:24:24 +00:00
http_status.rs Update to rust 1.85 (#35628) 2025-02-24 17:44:35 +00:00
image_cache.rs Create new image cache per document (#36832) 2025-05-04 20:20:56 +00:00
lib.rs Update FetchTaskTarget to propagate CSP violations. (#36409) 2025-04-13 20:54:59 +00:00
policy_container.rs Remove referrer policy from document (#34263) 2024-11-19 12:45:10 +00:00
pub_domains.rs fix many clippy warnings (#33510) 2024-09-21 13:58:31 +00:00
quality.rs Fixes for HTTP header compliance. (#32024) 2024-04-11 21:51:23 +00:00
request.rs net: Report memory usage for image cache. (#36556) 2025-04-16 13:11:51 +00:00
response.rs Refuse to provide partial response from earlier ranged request to API that did not make a range request (#36227) 2025-03-31 10:34:32 +00:00
storage_thread.rs Move *_traits and other shared types to shared 2023-11-03 15:38:18 +00:00