commit | 3fd2c26569a69d2c0cfd9303a60838bc8130eaff | [log] [tgz] |
---|---|---|
author | Jarryd <jarrydg@chromium.org> | Wed Sep 16 06:31:55 2020 |
committer | Commit Bot <commit-bot@chromium.org> | Wed Sep 16 06:31:55 2020 |
tree | 59092b519c979b634fd8f4aec2ecfdfab7c94869 | |
parent | fdc59761fa658f64f7689c60261826597eadf80b [diff] |
Quota: Fix precision mistakes for storage pressure. There have been a number of reports about the storage pressure notification being shown, even when there is an absence of storage pressure. This is due to a numerical precision issue, where division of two ints would almost always return 0. This 0 meant that a condition that checked for storage pressure would always pass, and QuotaManger would fire storage pressure notifications for all write errors, regardless of disk availability. This change removes the division operation entirely with a little trick: - Given percent_available = 100 * available_space / total, - percent_available < kStoragePressureThresholdRatio is equivalent to (substitution): - 100 * available_space / total < kStoragePressureThresholdRatio is equivalent to (multiply both sides by total): - 100 * available_space < kStoragePressureThresholdRatio * total TBR=pwnall@chromium.org Bug: 1127237 Change-Id: I79c5ff47f27824d25ff8e47dc4aed859c8d3cd7d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2412758 Reviewed-by: Jarryd Goodman <jarrydg@chromium.org> Commit-Queue: Jarryd Goodman <jarrydg@chromium.org> Cr-Commit-Position: refs/heads/master@{#807356}
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.
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.