Backed out changeset 555c786396f8 (bug 1852046) as requested. CLOSED TREE
[gecko.git] / toolkit / mozapps / extensions / amIAddonManagerStartup.idl
blob10a235a849ecb488054fc43cafd1bc7c74475183
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "nsISupports.idl"
7 interface nsIFile;
8 interface nsIJSRAIIHelper;
9 interface nsIURI;
11 [scriptable, builtinclass, uuid(01dfa47b-87e4-4135-877b-586d033e1b5d)]
12 interface amIAddonManagerStartup : nsISupports
14 /**
15 * Reads and parses startup data from the addonState.json.lz4 file, checks
16 * for modifications, and returns the result.
18 * Returns null for an empty or nonexistent state file, but throws for an
19 * invalid one.
21 [implicit_jscontext]
22 jsval readStartupData();
24 /**
25 * Registers a set of dynamic chrome registry entries, and returns an object
26 * with a `destruct()` method which must be called in order to unregister
27 * the entries.
29 * @param manifestURI The base manifest URI for the entries. URL values are
30 * resolved relative to this URI.
31 * @param entries An array of arrays, each containing a registry entry as it
32 * would appar in a chrome.manifest file. Only the following entry
33 * types are currently accepted:
35 * - "locale" A locale package entry. Must be a 4-element array.
36 * - "override" A URL override entry. Must be a 3-element array.
38 [implicit_jscontext]
39 nsIJSRAIIHelper registerChrome(in nsIURI manifestURI, in jsval entries);
41 [implicit_jscontext]
42 jsval encodeBlob(in jsval value);
44 [implicit_jscontext]
45 jsval decodeBlob(in jsval value);
47 /**
48 * Enumerates over all entries in the JAR file at the given URI, and returns
49 * an array of entry paths which match the given pattern. The URI may be
50 * either a file: URL pointing directly to a zip file, or a jar: URI
51 * pointing to a zip file nested within another zip file. Only one level of
52 * nesting is supported.
54 * This should be used in preference to manually opening or retrieving a
55 * ZipReader from the zip cache, since the former causes main thread IO and
56 * the latter can lead to file locking issues due to unpredictable GC behavior
57 * keeping the cached ZipReader alive after the cache is flushed.
59 * @param uri The URI of the zip file to enumerate.
60 * @param pattern The pattern to match, as passed to nsIZipReader.findEntries.
62 Array<AString> enumerateJAR(in nsIURI uri, in AUTF8String pattern);
64 /**
65 * Similar to |enumerateJAR| above, but accepts the URI of a directory
66 * within a JAR file, and returns a list of all entries below it.
68 * The given URI must be a jar: URI, and its JAR file must point either to a
69 * file: URI, or to a singly-nested JAR within another JAR file (i.e.,
70 * "jar:file:///thing.jar!/" or "jar:jar:file:///thing.jar!/stuff.jar!/").
71 * Multiple levels of nesting are not supported.
73 Array<AString> enumerateJARSubtree(in nsIURI uri);
75 /**
76 * Initializes the URL Preloader.
78 * NOT FOR USE OUTSIDE OF UNIT TESTS.
80 void initializeURLPreloader();