Commit 68b00aee authored by Jarryd's avatar Jarryd Committed by Commit Bot

Qutoa: Fix divide-by-0 crash.

Add an guard to QuotaManager::MaybeRunStoragePressureCallback() for
the case when |total_space| is 0. Also add a TODO to figure out
how we want to handle this case over the long run.

Bug: 1059221
Change-Id: I9abba6cf21f810339fc6f115d9d484eaaed88abe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2093692Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Jarryd Goodman <jarrydg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748306}
parent 8b54e866
......@@ -1492,6 +1492,11 @@ void QuotaManager::MaybeRunStoragePressureCallback(const url::Origin& origin,
int64_t total_space,
int64_t available_space) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// TODO(https://crbug.com/1059560): Figure out what 0 total_space means
// and how to handle the storage pressure callback in these cases.
if (total_space == 0)
return;
if (!storage_pressure_callback_) {
// Quota will hold onto a storage pressure notification if no storage
// pressure callback is set.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment