commit | 4f000043ec4a5b1986eead39d48c291a118c4496 | [log] [tgz] |
---|---|---|
author | Ben Reich <benreich@chromium.org> | Tue Apr 23 00:44:36 2024 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Apr 23 00:44:36 2024 |
tree | a63cbc828380af5e5d6a1b31bdfcfd34e6932b14 | |
parent | 2707037f1ca5b26d0e50210b9d8eafe4242c6fde [diff] |
[FspCache] Ensure only bytes available locally are served from cache There are a number of readers that always make requests for chunks of 512KiB despite the file not being that big OR the last chunk not being that size. In the event this happens, currently we count that as a cache miss (despite the underlying FSP serving the exact same data that we have locally). To get around this, extract the size from the `OpenFileCallback` and use this to ensure the bytes that are known on disk are always served if the same bytes that are known in the cloud are being served. Another side effect of this is when a large file is being streamed (e.g. a video being played by Gallery) this may be stopped mid way through leaving only half the file on disk. If this occurs, the new logic will ensure all local requests are served locally, whilst any data that isn't available locally will be served via the FSP. Bug: b/335548899 Test: unit_tests --gtest_filter=FileSystemProviderContentCacheImplTest* Change-Id: I7cb84879158f8ae8fa5b7449ee23eb17afbccb01 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5465336 Reviewed-by: Cassy Chun-Crogan <cassycc@google.com> Commit-Queue: Ben Reich <benreich@chromium.org> Cr-Commit-Position: refs/heads/main@{#1290996}
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.