Bug 1702600 - Change ToInteger to ToInteger64 in ClientUsageArray::Deserialize; r=#dom-storage a=pascalc
We use uint64_t for usages internally, but the deserializing function was using
ToInteger which can handle only 32bit integers. The problem became more visible
after increasing the group limit from 2GB to 10GB, but it was possible to
experience the problem even before that because persisted origins are not
limited by the group limit.
--- a/dom/quota/ActorsParent.cpp
+++ b/dom/quota/ActorsParent.cpp
@@ -7454,17 +7454,17 @@ nsresult ClientUsageArray::Deserialize(c
.ToRange()) {
QM_TRY(OkIf(token.Length() >= 2), NS_ERROR_FAILURE);
Client::Type clientType;
QM_TRY(OkIf(Client::TypeFromPrefix(token.First(), clientType, fallible)),
NS_ERROR_FAILURE);
nsresult rv;
- const uint64_t usage = Substring(token, 1).ToInteger(&rv);
+ const uint64_t usage = Substring(token, 1).ToInteger64(&rv);
QM_TRY(MOZ_TO_RESULT(rv));
ElementAt(clientType) = Some(usage);
}
return NS_OK;
}