gecko-dev/dom/quota/nsIQuotaManagerService.idl
Tom Tung 3b07e666f0 Bug 1281103 - Support getting the group usage and the limit in QuotaManagerService. r=janv.
--HG--
extra : rebase_source : 609795f25eeab0d96f962799629e4e81492fb087
2016-06-24 10:24:06 +08:00

70 lines
2.5 KiB
Plaintext

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
interface nsIPrincipal;
interface nsIQuotaRequest;
interface nsIQuotaUsageCallback;
interface nsIQuotaUsageRequest;
[scriptable, builtinclass, uuid(1b3d0a38-8151-4cf9-89fa-4f92c2ef0e7e)]
interface nsIQuotaManagerService : nsISupports
{
/**
* Schedules an asynchronous callback that will return the total amount of
* disk space being used by storages for the given origin.
*
* @param aPrincipal
* A principal for the origin whose usage is being queried.
* @param aCallback
* The callback that will be called when the usage is available.
* @param aGetGroupUsage
* An optional flag to indicate whether getting group usage and limit
* or origin usage and file usage. The default value is false.
* Note: Origin usage here represents total usage of an origin. However,
* group usage here represents only non-persistent usage of a group.
*/
nsIQuotaUsageRequest
getUsageForPrincipal(in nsIPrincipal aPrincipal,
in nsIQuotaUsageCallback aCallback,
[optional] in boolean aGetGroupUsage);
/**
* Removes all storages. The files may not be deleted immediately depending
* on prohibitive concurrent operations.
* Be careful, this removes *all* the data that has ever been stored!
*
* If the dom.quotaManager.testing preference is not true the call will be
* a no-op.
*/
nsIQuotaRequest
clear();
/**
* Removes all storages stored for the given URI. The files may not be
* deleted immediately depending on prohibitive concurrent operations.
*
* @param aPrincipal
* A principal for the origin whose storages are to be cleared.
*/
nsIQuotaRequest
clearStoragesForPrincipal(in nsIPrincipal aPrincipal,
[optional] in ACString aPersistenceType);
/**
* Resets quota and storage management. This can be used to force
* reinitialization of the temp storage, for example when the pref for
* overriding the temp storage limit has changed.
* Be carefull, this invalidates all live storages!
*
* If the dom.quotaManager.testing preference is not true the call will be
* a no-op.
*/
nsIQuotaRequest
reset();
};