summaryrefslogtreecommitdiffstats
path: root/dom/quota/test/modules/content/Utils.mjs
blob: c6a7415dba19c960c41c23a3c89da1abd4cac7f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/**
 * Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/
 */

// This file expectes the SpecialPowers to be available in the scope
// it is loaded into.
/* global SpecialPowers */

import { getUsageForOrigin } from "./StorageUtils.mjs";

export const Utils = {
  async getCachedOriginUsage() {
    const principal = SpecialPowers.wrap(document).nodePrincipal;
    const result = await getUsageForOrigin(principal, true);
    return result.usage;
  },
};