QuotaUtilsService.sys.mjs (827B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 import { ContextualIdentityService } from "resource://gre/modules/ContextualIdentityService.sys.mjs"; 6 7 export function QuotaUtilsService() {} 8 9 QuotaUtilsService.prototype = { 10 getPrivateIdentityId(aName) { 11 const privateIdentity = ContextualIdentityService.getPrivateIdentity(aName); 12 if (!privateIdentity) { 13 return 0; 14 } 15 return privateIdentity.userContextId; 16 }, 17 QueryInterface: ChromeUtils.generateQI(["nsIQuotaUtilsService"]), 18 classDescription: "Quota Utils Service", 19 contractID: "@mozilla.org/dom/quota-utils-service;1", 20 classID: Components.ID("3e65d9b5-5b41-4c18-ac7b-681b9df9df97"), 21 };