Bug 1526591 - Remove devtools.inspector.shapesHighlighter.enabled pref. r=rcaliman
[gecko.git] / netwerk / base / nsIApplicationCacheService.idl
blob9b2b16955e584e92af90afa269bf74347f6a6e9d
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;
10 interface nsIFile;
11 interface nsIURI;
12 interface nsILoadContextInfo;
14 /**
15 * The application cache service manages the set of application cache
16 * groups.
18 [scriptable, uuid(b8b6546c-6cec-4bda-82df-08e006a97b56)]
19 interface nsIApplicationCacheService : nsISupports
21 /**
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);
30 /**
31 * Create a new, empty application cache for the given cache
32 * group.
34 nsIApplicationCache createApplicationCache(in ACString group);
36 /**
37 * Create a new, empty application cache for the given cache
38 * group residing in a custom directory with a custom quota.
40 * @param group
41 * URL of the manifest
42 * @param directory
43 * Actually a reference to a profile directory where to
44 * create the OfflineCache sub-dir.
45 * @param quota
46 * Optional override of the default quota.
48 nsIApplicationCache createCustomApplicationCache(in ACString group,
49 in nsIFile profileDir,
50 in int32_t quota);
52 /**
53 * Get an application cache object for the given client ID.
55 nsIApplicationCache getApplicationCache(in ACString clientID);
57 /**
58 * Get the currently active cache object for a cache group.
60 nsIApplicationCache getActiveCache(in ACString group);
62 /**
63 * Deactivate the currently-active cache object for a cache group.
65 void deactivateGroup(in ACString group);
67 /**
68 * Evict offline cache entries, either all of them or those belonging
69 * to the given origin.
71 void evict(in nsILoadContextInfo aLoadContextInfo);
73 /**
74 * Delete caches whom origin attributes matches the given pattern.
76 void evictMatchingOriginAttributes(in AString aPattern);
78 /**
79 * Try to find the best application cache to serve a resource.
81 nsIApplicationCache chooseApplicationCache(in ACString key,
82 [optional] in nsILoadContextInfo aLoadContextInfo);
84 /**
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.
91 * @param cache
92 * The cache in which the entry is cached now.
93 * @param key
94 * The cache entry key.
96 void cacheOpportunistically(in nsIApplicationCache cache, in ACString key);
98 /**
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
106 * activating time.
108 void getGroupsTimeOrdered([optional] out unsigned long count,
109 [array, size_is(count), retval] out string groupIDs);