Bumping manifests a=b2g-bump
[gecko.git] / netwerk / cache / nsICacheVisitor.idl
blobddc9936357264f3b014875d759c4daff41d96eea
1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsISupports.idl"
9 /* XXX we should define device and entry info as well (stats, etc) */
11 interface nsICacheDeviceInfo;
12 interface nsICacheEntryInfo;
15 [scriptable, uuid(f8c08c4b-d778-49d1-a59b-866fdc500d95)]
16 interface nsICacheVisitor : nsISupports
18 /**
19 * Called to provide information about a cache device.
21 * @param deviceID - specifies the device being visited.
22 * @param deviceInfo - specifies information about this device.
24 * @return true to start visiting all entries for this device.
25 * @return false to advance to the next device.
27 boolean visitDevice(in string deviceID,
28 in nsICacheDeviceInfo deviceInfo);
30 /**
31 * Called to provide information about a cache entry.
33 * @param deviceID - specifies the device being visited.
34 * @param entryInfo - specifies information about this entry.
36 * @return true to visit the next entry on the current device, or if the
37 * end of the device has been reached, advance to the next device.
38 * @return false to advance to the next device.
40 boolean visitEntry(in string deviceID,
41 in nsICacheEntryInfo entryInfo);
45 [scriptable, uuid(31d1c294-1dd2-11b2-be3a-c79230dca297)]
46 interface nsICacheDeviceInfo : nsISupports
48 /**
49 * Get a human readable description of the cache device.
51 readonly attribute string description;
53 /**
54 * Get a usage report, statistics, miscellaneous data about
55 * the cache device.
57 readonly attribute string usageReport;
59 /**
60 * Get the number of stored cache entries.
62 readonly attribute unsigned long entryCount;
64 /**
65 * Get the total size of the stored cache entries.
67 readonly attribute unsigned long totalSize;
69 /**
70 * Get the upper limit of the size of the data the cache can store.
72 readonly attribute unsigned long maximumSize;
76 [scriptable, uuid(fab51c92-95c3-4468-b317-7de4d7588254)]
77 interface nsICacheEntryInfo : nsISupports
79 /**
80 * Get the client id associated with this cache entry.
82 readonly attribute string clientID;
84 /**
85 * Get the id for the device that stores this cache entry.
87 readonly attribute string deviceID;
89 /**
90 * Get the key identifying the cache entry.
92 readonly attribute ACString key;
94 /**
95 * Get the number of times the cache entry has been opened.
97 readonly attribute long fetchCount;
99 /**
100 * Get the last time the cache entry was opened (in seconds since the Epoch).
102 readonly attribute uint32_t lastFetched;
105 * Get the last time the cache entry was modified (in seconds since the Epoch).
107 readonly attribute uint32_t lastModified;
110 * Get the expiration time of the cache entry (in seconds since the Epoch).
112 readonly attribute uint32_t expirationTime;
115 * Get the cache entry data size.
117 readonly attribute unsigned long dataSize;
120 * Find out whether or not the cache entry is stream based.
122 boolean isStreamBased();