Commit e7af7066 authored by Jarryd's avatar Jarryd Committed by Commit Bot

Quota: Make sure divisor is not 0 before dividing.

Bug: 956281
Change-Id: I8c9d37334c79b237e672aa0e8014b534d49f7898
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1585394
Commit-Queue: Jarryd Goodman <jarrydg@chromium.org>
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Auto-Submit: Jarryd Goodman <jarrydg@chromium.org>
Reviewed-by: default avatarMarijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654512}
parent d2f44c7d
...@@ -1488,8 +1488,10 @@ void QuotaManager::DidGetStorageCapacityForHistogram(int64_t usage, ...@@ -1488,8 +1488,10 @@ void QuotaManager::DidGetStorageCapacityForHistogram(int64_t usage,
int64_t available_space) { int64_t available_space) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
UMA_HISTOGRAM_MBYTES("Quota.GlobalUsageOfTemporaryStorage", usage); UMA_HISTOGRAM_MBYTES("Quota.GlobalUsageOfTemporaryStorage", usage);
UMA_HISTOGRAM_PERCENTAGE("Quota.PercentUsedForTemporaryStorage2", if (total_space > 0) {
static_cast<int>((usage * 100) / total_space)); UMA_HISTOGRAM_PERCENTAGE("Quota.PercentUsedForTemporaryStorage2",
static_cast<int>((usage * 100) / total_space));
}
GetGlobalUsage( GetGlobalUsage(
StorageType::kPersistent, StorageType::kPersistent,
......
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