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 interface nsIApplicationCache
;
12 interface nsILoadContextInfo
;
15 * The application cache service manages the set of application cache
18 [scriptable
, uuid(b8b6546c
-6cec
-4bda
-82df
-08e006a97b56
)]
19 interface nsIApplicationCacheService
: nsISupports
22 * Create group string identifying cache group according the manifest
23 * URL and the given principal.
25 ACString buildGroupIDForInfo
(in nsIURI aManifestURL
,
26 in nsILoadContextInfo aLoadContextInfo
);
27 ACString buildGroupIDForSuffix
(in nsIURI aManifestURL
,
28 in ACString aOriginSuffix
);
31 * Create a new, empty application cache for the given cache
34 nsIApplicationCache createApplicationCache
(in ACString group
);
37 * Create a new, empty application cache for the given cache
38 * group residing in a custom directory with a custom quota.
43 * Actually a reference to a profile directory where to
44 * create the OfflineCache sub-dir.
46 * Optional override of the default quota.
48 nsIApplicationCache createCustomApplicationCache
(in ACString group
,
49 in nsIFile profileDir
,
53 * Get an application cache object for the given client ID.
55 nsIApplicationCache getApplicationCache
(in ACString clientID
);
58 * Get the currently active cache object for a cache group.
60 nsIApplicationCache getActiveCache
(in ACString group
);
63 * Deactivate the currently-active cache object for a cache group.
65 void deactivateGroup
(in ACString group
);
68 * Evict offline cache entries, either all of them or those belonging
69 * to the given origin.
71 void evict
(in nsILoadContextInfo aLoadContextInfo
);
74 * Delete caches whom origin attributes matches the given pattern.
76 void evictMatchingOriginAttributes
(in AString aPattern
);
79 * Try to find the best application cache to serve a resource.
81 nsIApplicationCache chooseApplicationCache
(in ACString key
,
82 [optional] in nsILoadContextInfo aLoadContextInfo
);
85 * Flags the key as being opportunistically cached.
87 * This method should also propagate the entry to other
88 * application caches with the same opportunistic namespace, but
89 * this is not currently implemented.
92 * The cache in which the entry is cached now.
94 * The cache entry key.
96 void cacheOpportunistically
(in nsIApplicationCache cache
, in ACString key
);
99 * Get the list of application cache groups.
101 void getGroups
([optional] out unsigned long count
,
102 [array
, size_is(count
), retval] out string groupIDs
);
105 * Get the list of application cache groups in the order of
108 void getGroupsTimeOrdered
([optional] out unsigned long count
,
109 [array
, size_is(count
), retval] out string groupIDs
);