michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIQuotaRequest; michael@0: interface nsIURI; michael@0: interface nsIUsageCallback; michael@0: michael@0: [scriptable, builtinclass, uuid(2968fcd5-1872-4ddc-8c16-62b27e357f31)] michael@0: interface nsIQuotaManager : nsISupports michael@0: { michael@0: /** michael@0: * Schedules an asynchronous callback that will return the total amount of michael@0: * disk space being used by storages for the given origin. michael@0: * michael@0: * @param aURI michael@0: * The URI whose usage is being queried. michael@0: * @param aCallback michael@0: * The callback that will be called when the usage is available. michael@0: */ michael@0: [optional_argc] michael@0: nsIQuotaRequest michael@0: getUsageForURI(in nsIURI aURI, michael@0: in nsIUsageCallback aCallback, michael@0: [optional] in unsigned long aAppId, michael@0: [optional] in boolean aInMozBrowserOnly); michael@0: michael@0: /** michael@0: * Removes all storages. The files may not be deleted immediately depending michael@0: * on prohibitive concurrent operations. michael@0: * Be careful, this removes *all* the data that has ever been stored! michael@0: * michael@0: * If the dom.quotaManager.testing preference is not true the call will be michael@0: * a no-op. michael@0: */ michael@0: void michael@0: clear(); michael@0: michael@0: /** michael@0: * Removes all storages stored for the given URI. The files may not be michael@0: * deleted immediately depending on prohibitive concurrent operations. michael@0: * michael@0: * @param aURI michael@0: * The URI whose storages are to be cleared. michael@0: */ michael@0: [optional_argc] michael@0: void michael@0: clearStoragesForURI(in nsIURI aURI, michael@0: [optional] in unsigned long aAppId, michael@0: [optional] in boolean aInMozBrowserOnly, michael@0: [optional] in ACString aPersistenceType); michael@0: michael@0: /** michael@0: * Resets quota and storage management. This can be used to force michael@0: * reinitialization of the temp storage, for example when the pref for michael@0: * overriding the temp storage limit has changed. michael@0: * Be carefull, this invalidates all live storages! michael@0: * michael@0: * If the dom.quotaManager.testing preference is not true the call will be michael@0: * a no-op. michael@0: */ michael@0: void michael@0: reset(); michael@0: };