2010-09-10 23:12:11 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2010-09-10 23:12:11 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIURI;
|
|
|
|
|
2011-12-16 11:34:24 +04:00
|
|
|
[scriptable, function, uuid(ef1795ec-7050-4658-b80f-0e48cbe1d64b)]
|
2010-10-19 21:58:33 +04:00
|
|
|
interface nsIIndexedDatabaseUsageCallback : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void onUsageResult(in nsIURI aURI,
|
2011-12-16 11:34:24 +04:00
|
|
|
in unsigned long long aUsage,
|
|
|
|
in unsigned long long aFileUsage);
|
2010-10-19 21:58:33 +04:00
|
|
|
};
|
|
|
|
|
2012-01-03 19:27:39 +04:00
|
|
|
[scriptable, builtinclass, uuid(02256aa7-70d8-473f-bf3b-8cb35d28fd75)]
|
2010-09-10 23:12:11 +04:00
|
|
|
interface nsIIndexedDatabaseManager : nsISupports
|
|
|
|
{
|
2010-10-19 21:58:33 +04:00
|
|
|
/**
|
|
|
|
* Schedules an asynchronous callback that will return the total amount of
|
|
|
|
* disk space being used by databases for the given origin.
|
|
|
|
*
|
|
|
|
* @param aURI
|
|
|
|
* The URI whose usage is being queried.
|
|
|
|
* @param aCallback
|
|
|
|
* The callback that will be called when the usage is available.
|
|
|
|
*/
|
|
|
|
void getUsageForURI(in nsIURI aURI,
|
|
|
|
in nsIIndexedDatabaseUsageCallback aCallback);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cancels an asynchronous usage check initiated by a previous call to
|
|
|
|
* getUsageForURI().
|
|
|
|
*
|
|
|
|
* @param aURI
|
|
|
|
* The URI whose usage is being queried.
|
|
|
|
* @param aCallback
|
|
|
|
* The callback that will be called when the usage is available.
|
|
|
|
*/
|
|
|
|
void cancelGetUsageForURI(in nsIURI aURI,
|
|
|
|
in nsIIndexedDatabaseUsageCallback aCallback);
|
|
|
|
|
2010-09-10 23:12:11 +04:00
|
|
|
|
2010-10-19 21:58:33 +04:00
|
|
|
/**
|
|
|
|
* Removes all databases stored for the given URI. The files may not be
|
|
|
|
* deleted immediately depending on prohibitive concurrent operations.
|
|
|
|
*
|
|
|
|
* @param aURI
|
|
|
|
* The URI whose databases are to be cleared.
|
|
|
|
*/
|
2010-09-10 23:12:11 +04:00
|
|
|
void clearDatabasesForURI(in nsIURI aURI);
|
2012-01-03 19:27:39 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines mozIndexedDB and IDBKeyrange with its static functions on
|
|
|
|
* aObject and initializes DOM exception providers if needed.
|
|
|
|
*
|
|
|
|
* @param aObject
|
|
|
|
* The object, mozIndexedDB and IDBKeyrange should be defined on.
|
|
|
|
*/
|
|
|
|
[implicit_jscontext]
|
|
|
|
void initWindowless(in jsval aObject);
|
2010-09-10 23:12:11 +04:00
|
|
|
};
|