1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
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"
10 interface nsIPrincipal
;
11 interface nsIProperties
;
18 class OriginAttributes
;
19 } // mozilla namespace
22 [ptr] native OriginAttributesPtr
(mozilla
::OriginAttributes
);
27 * @author Stuart Parmenter <pavlov@netscape.com>
31 [scriptable
, builtinclass
, uuid(bfdf23ff
-378e-402e
-8a6c
-840f0c82b6c3
)]
32 interface imgICache
: nsISupports
35 * Evict images from the cache.
37 * @param chrome If TRUE, evict only chrome images.
38 * If FALSE, evict everything except chrome images.
40 void clearCache
(in boolean chrome
);
43 * Evict images from the cache.
45 * @param uri The URI to remove.
46 * @param doc The document to remove the cache entry for.
47 * @throws NS_ERROR_NOT_AVAILABLE if \a uri was unable to be removed from
50 [noscript
] void removeEntry
(in nsIURI uri
, [optional] in Document doc
);
53 * Evict images from the cache with the same origin and the same
54 * originAttributes of the passed principal, across all processes. May only be
55 * called from the parent process.
57 * @param aPrincipal The principal to clear cache entries for. The principals
58 * origin attributes are used to determine whether the private or normal
59 * browsing cache is cleared.
60 * @throws NS_ERROR_NOT_AVAILABLE if not called in the parent process.
62 void removeEntriesFromPrincipalInAllProcesses
(in nsIPrincipal aPrincipal
);
65 * Evict images from the non-chrome cache which match the the given base
66 * domain. Matching cache entries will be cleared across all origin attributes
69 * @param aBaseDomain base domain to delete cache entries for.
70 * @throws NS_ERROR_NOT_AVAILABLE if not called in the parent process.
72 void removeEntriesFromBaseDomainInAllProcesses
(in ACString aBaseDomain
);
76 * Used to get properties such as 'type' and 'content-disposition'
77 * 'type' is a nsISupportsCString containing the images' mime type such as
79 * 'content-disposition' will be a nsISupportsCString containing the header
80 * If you call this before any data has been loaded from a URI, it will
81 * succeed, but come back empty.
83 * Hopefully this will be removed with bug 805119
85 * @param uri The URI to look up.
86 * @param doc Optional pointer to the document that the cache entry belongs to.
87 * @returns NULL if the URL was not found in the cache
90 nsIProperties findEntryProperties
(in nsIURI uri
,
91 [optional] in Document doc
);
94 * Make this cache instance respect private browsing notifications. This
95 * entails clearing the chrome and content caches whenever the
96 * last-pb-context-exited notification is observed.
98 void respectPrivacyNotifications
();
101 * Clear the image cache for a document. Controlled documents are responsible
102 * for doing this manually when they get destroyed.
105 void clearCacheForControlledDocument
(in Document doc
);