tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Utils.js (822B)


      1 /**
      2 * Any copyright is dedicated to the Public Domain.
      3 * http://creativecommons.org/publicdomain/zero/1.0/
      4 */
      5 
      6 let UtilsChild;
      7 
      8 async function ensureUtilsChild() {
      9  if (UtilsChild) {
     10    return;
     11  }
     12 
     13  const { UtilsChild: importedUtilsChild } = await import(
     14    "/dom/quota/test/modules/worker/UtilsChild.mjs"
     15  );
     16 
     17  UtilsChild = importedUtilsChild;
     18 }
     19 
     20 const Utils = {
     21  async getCachedOriginUsage() {
     22    await ensureUtilsChild();
     23 
     24    const result = await UtilsChild.getCachedOriginUsage();
     25    return result;
     26  },
     27 
     28  async shrinkStorageSize(size) {
     29    await ensureUtilsChild();
     30 
     31    const result = await UtilsChild.shrinkStorageSize(size);
     32    return result;
     33  },
     34 
     35  async restoreStorageSize() {
     36    await ensureUtilsChild();
     37 
     38    const result = await UtilsChild.restoreStorageSize();
     39    return result;
     40  },
     41 };