2001-02-24 01:23:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
*
|
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/. */
|
2001-02-24 01:23:55 +03:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2001-02-24 04:27:49 +03:00
|
|
|
/* XXX we should define device and entry info as well (stats, etc) */
|
|
|
|
|
2001-03-08 23:58:11 +03:00
|
|
|
interface nsICacheDeviceInfo;
|
|
|
|
interface nsICacheEntryInfo;
|
|
|
|
|
2001-03-21 01:42:03 +03:00
|
|
|
|
2001-02-24 01:23:55 +03:00
|
|
|
[scriptable, uuid(f8c08c4b-d778-49d1-a59b-866fdc500d95)]
|
|
|
|
interface nsICacheVisitor : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
2001-02-24 04:27:49 +03:00
|
|
|
* Called to provide information about a cache device.
|
|
|
|
*
|
|
|
|
* @param deviceID - specifies the device being visited.
|
|
|
|
* @param deviceInfo - specifies information about this device.
|
|
|
|
*
|
|
|
|
* @return true to start visiting all entries for this device.
|
|
|
|
* @return false to advance to the next device.
|
2001-02-24 01:23:55 +03:00
|
|
|
*/
|
2001-03-08 23:58:11 +03:00
|
|
|
boolean visitDevice(in string deviceID,
|
|
|
|
in nsICacheDeviceInfo deviceInfo);
|
2001-02-24 01:23:55 +03:00
|
|
|
|
|
|
|
/**
|
2001-02-24 04:27:49 +03:00
|
|
|
* Called to provide information about a cache entry.
|
|
|
|
*
|
|
|
|
* @param deviceID - specifies the device being visited.
|
|
|
|
* @param entryInfo - specifies information about this entry.
|
2019-05-23 01:37:14 +03:00
|
|
|
*
|
2001-02-24 04:27:49 +03:00
|
|
|
* @return true to visit the next entry on the current device, or if the
|
|
|
|
* end of the device has been reached, advance to the next device.
|
|
|
|
* @return false to advance to the next device.
|
2001-02-24 01:23:55 +03:00
|
|
|
*/
|
2001-03-08 23:58:11 +03:00
|
|
|
boolean visitEntry(in string deviceID,
|
|
|
|
in nsICacheEntryInfo entryInfo);
|
|
|
|
};
|
|
|
|
|
2001-03-21 01:42:03 +03:00
|
|
|
|
2001-03-08 23:58:11 +03:00
|
|
|
[scriptable, uuid(31d1c294-1dd2-11b2-be3a-c79230dca297)]
|
|
|
|
interface nsICacheDeviceInfo : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Get a human readable description of the cache device.
|
|
|
|
*/
|
2017-10-29 14:19:48 +03:00
|
|
|
readonly attribute ACString description;
|
2019-05-23 01:37:14 +03:00
|
|
|
|
2001-03-08 23:58:11 +03:00
|
|
|
/**
|
|
|
|
* Get a usage report, statistics, miscellaneous data about
|
|
|
|
* the cache device.
|
|
|
|
*/
|
2017-10-29 14:19:48 +03:00
|
|
|
readonly attribute ACString usageReport;
|
2019-05-23 01:37:14 +03:00
|
|
|
|
2001-03-08 23:58:11 +03:00
|
|
|
/**
|
|
|
|
* Get the number of stored cache entries.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long entryCount;
|
2019-05-23 01:37:14 +03:00
|
|
|
|
2001-03-08 23:58:11 +03:00
|
|
|
/**
|
|
|
|
* Get the total size of the stored cache entries.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long totalSize;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the upper limit of the size of the data the cache can store.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long maximumSize;
|
|
|
|
};
|
|
|
|
|
2001-03-21 01:42:03 +03:00
|
|
|
|
2005-01-13 06:25:28 +03:00
|
|
|
[scriptable, uuid(fab51c92-95c3-4468-b317-7de4d7588254)]
|
2001-03-08 23:58:11 +03:00
|
|
|
interface nsICacheEntryInfo : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Get the client id associated with this cache entry.
|
|
|
|
*/
|
2017-10-29 14:19:48 +03:00
|
|
|
readonly attribute ACString clientID;
|
2001-03-08 23:58:11 +03:00
|
|
|
|
2001-04-30 05:18:34 +04:00
|
|
|
/**
|
|
|
|
* Get the id for the device that stores this cache entry.
|
|
|
|
*/
|
2017-10-29 14:19:48 +03:00
|
|
|
readonly attribute ACString deviceID;
|
2001-04-30 05:18:34 +04:00
|
|
|
|
2001-03-08 23:58:11 +03:00
|
|
|
/**
|
|
|
|
* Get the key identifying the cache entry.
|
|
|
|
*/
|
2005-01-13 06:25:28 +03:00
|
|
|
readonly attribute ACString key;
|
2019-05-23 01:37:14 +03:00
|
|
|
|
2001-03-08 23:58:11 +03:00
|
|
|
/**
|
|
|
|
* Get the number of times the cache entry has been opened.
|
|
|
|
*/
|
|
|
|
readonly attribute long fetchCount;
|
|
|
|
|
|
|
|
/**
|
2001-03-14 06:54:05 +03:00
|
|
|
* Get the last time the cache entry was opened (in seconds since the Epoch).
|
2001-03-08 23:58:11 +03:00
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
readonly attribute uint32_t lastFetched;
|
2001-03-08 23:58:11 +03:00
|
|
|
|
|
|
|
/**
|
2001-03-14 06:54:05 +03:00
|
|
|
* Get the last time the cache entry was modified (in seconds since the Epoch).
|
2001-03-08 23:58:11 +03:00
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
readonly attribute uint32_t lastModified;
|
2001-03-08 23:58:11 +03:00
|
|
|
|
|
|
|
/**
|
2001-03-14 06:54:05 +03:00
|
|
|
* Get the expiration time of the cache entry (in seconds since the Epoch).
|
2001-03-08 23:58:11 +03:00
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
readonly attribute uint32_t expirationTime;
|
2001-03-08 23:58:11 +03:00
|
|
|
|
|
|
|
/**
|
2001-03-14 04:11:14 +03:00
|
|
|
* Get the cache entry data size.
|
2001-03-08 23:58:11 +03:00
|
|
|
*/
|
2001-03-14 04:11:14 +03:00
|
|
|
readonly attribute unsigned long dataSize;
|
2001-03-08 23:58:11 +03:00
|
|
|
|
|
|
|
/**
|
2001-03-14 04:11:14 +03:00
|
|
|
* Find out whether or not the cache entry is stream based.
|
2001-03-08 23:58:11 +03:00
|
|
|
*/
|
2001-03-14 04:11:14 +03:00
|
|
|
boolean isStreamBased();
|
2001-02-24 01:23:55 +03:00
|
|
|
};
|