dom/quota/nsIQuotaManager.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/quota/nsIQuotaManager.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,68 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set ts=2 et sw=2 tw=80: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "nsISupports.idl"
    1.11 +
    1.12 +interface nsIQuotaRequest;
    1.13 +interface nsIURI;
    1.14 +interface nsIUsageCallback;
    1.15 +
    1.16 +[scriptable, builtinclass, uuid(2968fcd5-1872-4ddc-8c16-62b27e357f31)]
    1.17 +interface nsIQuotaManager : nsISupports
    1.18 +{
    1.19 +  /**
    1.20 +   * Schedules an asynchronous callback that will return the total amount of
    1.21 +   * disk space being used by storages for the given origin.
    1.22 +   *
    1.23 +   * @param aURI
    1.24 +   *        The URI whose usage is being queried.
    1.25 +   * @param aCallback
    1.26 +   *        The callback that will be called when the usage is available.
    1.27 +   */
    1.28 +  [optional_argc]
    1.29 +  nsIQuotaRequest
    1.30 +  getUsageForURI(in nsIURI aURI,
    1.31 +                 in nsIUsageCallback aCallback,
    1.32 +                 [optional] in unsigned long aAppId,
    1.33 +                 [optional] in boolean aInMozBrowserOnly);
    1.34 +
    1.35 +  /**
    1.36 +   * Removes all storages. The files may not be deleted immediately depending
    1.37 +   * on prohibitive concurrent operations.
    1.38 +   * Be careful, this removes *all* the data that has ever been stored!
    1.39 +   *
    1.40 +   * If the dom.quotaManager.testing preference is not true the call will be
    1.41 +   * a no-op.
    1.42 +   */
    1.43 +  void
    1.44 +  clear();
    1.45 +
    1.46 +  /**
    1.47 +   * Removes all storages stored for the given URI. The files may not be
    1.48 +   * deleted immediately depending on prohibitive concurrent operations.
    1.49 +   *
    1.50 +   * @param aURI
    1.51 +   *        The URI whose storages are to be cleared.
    1.52 +   */
    1.53 +  [optional_argc]
    1.54 +  void
    1.55 +  clearStoragesForURI(in nsIURI aURI,
    1.56 +                      [optional] in unsigned long aAppId,
    1.57 +                      [optional] in boolean aInMozBrowserOnly,
    1.58 +                      [optional] in ACString aPersistenceType);
    1.59 +
    1.60 +  /**
    1.61 +   * Resets quota and storage management. This can be used to force
    1.62 +   * reinitialization of the temp storage, for example when the pref for
    1.63 +   * overriding the temp storage limit has changed.
    1.64 +   * Be carefull, this invalidates all live storages!
    1.65 +   *
    1.66 +   * If the dom.quotaManager.testing preference is not true the call will be
    1.67 +   * a no-op.
    1.68 +   */
    1.69 +  void
    1.70 +  reset();
    1.71 +};

mercurial