commit | 72a570b14e3dd4b479868367188dfca4ef238fb8 | [log] [tgz] |
---|---|---|
author | Rune Lillesveen <futhark@chromium.org> | Mon Apr 25 23:31:22 2022 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Apr 25 23:31:22 2022 |
tree | 9d061a0a32f434b5fcb121485f95b3e694d267d0 | |
parent | 34b2d3869f9da2afab0d9c047b72c8aa8995953d [diff] |
Reland: Add document-wide cache for StyleFetchedImage (This reland modifies the original CL to use a String instead of a KURL as the map key to see how that affects memory use.) StyleFetchedImage is cached on the CSSImageValue object and re-used each time a declaration applies to an element's ComputedStyle. The problem arises when the same url is used in different declarations, or even worse, when the CSSImageValue is regenerated every time when a custom property url is substituted into another property. In those cases we create a new StyleFetchedImage and re-fetch the resource. Use the same StyleFetchedImage for the cached image url for all CSSImageValue objects for the same Document. The cache is a map from url into a weak StyleFetchedImage such that it will be garbage collected once there are no more CSSImageValues referencing the StyleFetchedImage. Bug: 961600 Change-Id: I880fa7b072d93362e6f8893169fdb9875b6bce9d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3599174 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/main@{#995863}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone
! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.