netwerk/cache/nsICacheVisitor.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/cache/nsICacheVisitor.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,123 @@
     1.4 +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     1.5 + *
     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 +/* XXX we should define device and entry info as well (stats, etc) */
    1.13 +
    1.14 +interface nsICacheDeviceInfo;
    1.15 +interface nsICacheEntryInfo;
    1.16 +
    1.17 +
    1.18 +[scriptable, uuid(f8c08c4b-d778-49d1-a59b-866fdc500d95)]
    1.19 +interface nsICacheVisitor : nsISupports
    1.20 +{
    1.21 +    /**
    1.22 +     * Called to provide information about a cache device.
    1.23 +     *
    1.24 +     * @param deviceID - specifies the device being visited.
    1.25 +     * @param deviceInfo - specifies information about this device.
    1.26 +     *
    1.27 +     * @return true to start visiting all entries for this device.
    1.28 +     * @return false to advance to the next device.
    1.29 +     */
    1.30 +    boolean visitDevice(in string               deviceID,
    1.31 +                        in nsICacheDeviceInfo   deviceInfo);
    1.32 +
    1.33 +    /**
    1.34 +     * Called to provide information about a cache entry.
    1.35 +     *
    1.36 +     * @param deviceID - specifies the device being visited.
    1.37 +     * @param entryInfo - specifies information about this entry.
    1.38 +     * 
    1.39 +     * @return true to visit the next entry on the current device, or if the
    1.40 +     *   end of the device has been reached, advance to the next device.
    1.41 +     * @return false to advance to the next device.
    1.42 +     */
    1.43 +    boolean visitEntry(in string                deviceID,
    1.44 +                       in nsICacheEntryInfo     entryInfo);
    1.45 +};
    1.46 +
    1.47 +
    1.48 +[scriptable, uuid(31d1c294-1dd2-11b2-be3a-c79230dca297)]
    1.49 +interface nsICacheDeviceInfo : nsISupports
    1.50 +{
    1.51 +    /**
    1.52 +     * Get a human readable description of the cache device.
    1.53 +     */
    1.54 +    readonly attribute string  description;
    1.55 +    
    1.56 +    /**
    1.57 +     * Get a usage report, statistics, miscellaneous data about
    1.58 +     * the cache device.
    1.59 +     */
    1.60 +    readonly attribute string  usageReport;
    1.61 +    
    1.62 +    /**
    1.63 +     * Get the number of stored cache entries.
    1.64 +     */
    1.65 +    readonly attribute unsigned long  entryCount;
    1.66 +    
    1.67 +    /**
    1.68 +     * Get the total size of the stored cache entries.
    1.69 +     */
    1.70 +    readonly attribute unsigned long  totalSize;
    1.71 +
    1.72 +    /**
    1.73 +     * Get the upper limit of the size of the data the cache can store.
    1.74 +     */
    1.75 +    readonly attribute unsigned long  maximumSize;
    1.76 +};
    1.77 +
    1.78 +
    1.79 +[scriptable, uuid(fab51c92-95c3-4468-b317-7de4d7588254)]
    1.80 +interface nsICacheEntryInfo : nsISupports
    1.81 +{
    1.82 +    /**
    1.83 +     * Get the client id associated with this cache entry.
    1.84 +     */
    1.85 +    readonly attribute string  clientID;
    1.86 +
    1.87 +    /**
    1.88 +     * Get the id for the device that stores this cache entry.
    1.89 +     */
    1.90 +    readonly attribute string deviceID;
    1.91 +
    1.92 +    /**
    1.93 +     * Get the key identifying the cache entry.
    1.94 +     */
    1.95 +    readonly attribute ACString key;
    1.96 +    
    1.97 +    /**
    1.98 +     * Get the number of times the cache entry has been opened.
    1.99 +     */
   1.100 +    readonly attribute long  fetchCount;
   1.101 +
   1.102 +    /**
   1.103 +     * Get the last time the cache entry was opened (in seconds since the Epoch).
   1.104 +     */
   1.105 +    readonly attribute uint32_t  lastFetched;
   1.106 +
   1.107 +    /**
   1.108 +     * Get the last time the cache entry was modified (in seconds since the Epoch).
   1.109 +     */
   1.110 +    readonly attribute uint32_t  lastModified;
   1.111 +
   1.112 +    /**
   1.113 +     * Get the expiration time of the cache entry (in seconds since the Epoch).
   1.114 +     */
   1.115 +    readonly attribute uint32_t  expirationTime;
   1.116 +
   1.117 +    /**
   1.118 +     * Get the cache entry data size.
   1.119 +     */
   1.120 +    readonly attribute unsigned long  dataSize;
   1.121 +
   1.122 +    /**
   1.123 +     * Find out whether or not the cache entry is stream based.
   1.124 +     */
   1.125 +    boolean  isStreamBased();
   1.126 +};

mercurial