dom/quota/nsIQuotaManagerService.idl
author Simon Whitehead <chemnova@gmail.com>
Sat, 13 May 2017 15:12:15 -0500
changeset 358329 633151f5d481d49bd39900d43e6a75d77459a7bb
parent 348790 2c3319501b59c23468e18069268aa5e71d862446
child 439605 75a2cc1386416e4d20da45bf63027540f73c1c04
permissions -rw-r--r--
servo: Merge #16829 - Disallow negative duration for animation and transition (from hiikezoe:disallow-negative-duration); r=emilio <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15343 <!-- Either: --> - [X] There are tests for these changes written by @simon-whitehead . Thank you! <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 4613c0382ab76263fb8202ccf52f4c0520e44809

/* -*- 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
{
  /**
   * Initializes storage directory. This can be used in tests to verify
   * upgrade methods.
   *
   * If the dom.quotaManager.testing preference is not true the call will be
   * a no-op.
   */
  [must_use] nsIQuotaRequest
  init();

  /**
   * Initializes storages for the given principal. This can be used in tests to
   * verify origin initialization.
   *
   * If the dom.quotaManager.testing preference is not true the call will be
   * a no-op.
   *
   * @param aPrincipal
   *        A principal for the origin whose storages are to be initialized.
   * @param aPersistenceType
   *        A string that tells what persistence type of storages will be
   *        initialized.
   */
  [must_use] nsIQuotaRequest
  initStoragesForPrincipal(in nsIPrincipal aPrincipal,
                           in ACString aPersistenceType);

  /**
   * Schedules an asynchronous callback that will inspect all origins and
   * return the total amount of disk space being used by storages for each
   * origin separately.
   *
   * @param aCallback
   *        The callback that will be called when the usage is available.
   * @param aGetAll
   *        An optional boolean to indicate inspection of all origins,
   *        including internal ones.
   */
  [must_use] nsIQuotaUsageRequest
  getUsage(in nsIQuotaUsageCallback aCallback,
           [optional] in boolean aGetAll);

  /**
   * 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.
   */
  [must_use] 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.
   */
  [must_use] nsIQuotaRequest
  clear();

  /**
   * Removes all storages stored for the given principal. 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.
   * @param aPersistenceType
   *        An optional string that tells what persistence type of storages
   *        will be cleared.
   * @param aClearAll
   *        An optional boolean to indicate clearing all storages under the
   *        given origin.
   */
  [must_use] nsIQuotaRequest
  clearStoragesForPrincipal(in nsIPrincipal aPrincipal,
                            [optional] in ACString aPersistenceType,
                            [optional] in boolean aClearAll);

  /**
   * 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.
   */
  [must_use] nsIQuotaRequest
  reset();

  /**
   * Check if given origin is persisted.
   *
   * @param aPrincipal
   *        A principal for the origin which we want to check.
   */
  [must_use] nsIQuotaRequest
  persisted(in nsIPrincipal aPrincipal);

  /**
   * Persist given origin.
   *
   * @param aPrincipal
   *        A principal for the origin which we want to persist.
   */
  [must_use] nsIQuotaRequest
  persist(in nsIPrincipal aPrincipal);
};