Bug 1626570 - Improve handling of copying arrays in dom/quota/. r=dom-workers-and-storage-reviewers,janv

Differential Revision: https://phabricator.services.mozilla.com/D73629
This commit is contained in:
Simon Giesecke 2020-05-05 12:58:56 +00:00
Родитель acbc34d97d
Коммит 53e4e4c078
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -853,6 +853,7 @@ namespace {
} // namespace
// XXX Change this not to derive from AutoTArray.
class ClientUsageArray final
: public AutoTArray<Maybe<uint64_t>, Client::TYPE_MAX> {
public:
@ -861,6 +862,12 @@ class ClientUsageArray final
void Serialize(nsACString& aText) const;
nsresult Deserialize(const nsACString& aText);
ClientUsageArray Clone() const {
ClientUsageArray res;
res.Assign(*this);
return res;
}
};
class OriginInfo final {
@ -7954,7 +7961,7 @@ OriginInfo::OriginInfo(GroupInfo* aGroupInfo, const nsACString& aOrigin,
const ClientUsageArray& aClientUsages, uint64_t aUsage,
int64_t aAccessTime, bool aPersisted,
bool aDirectoryExists)
: mClientUsages(aClientUsages),
: mClientUsages(aClientUsages.Clone()),
mGroupInfo(aGroupInfo),
mOrigin(aOrigin),
mUsage(aUsage),