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.
56 * @param aPrincipal The principal
58 void removeEntriesFromPrincipal
(in nsIPrincipal aPrincipal
);
62 * Used to get properties such as 'type' and 'content-disposition'
63 * 'type' is a nsISupportsCString containing the images' mime type such as
65 * 'content-disposition' will be a nsISupportsCString containing the header
66 * If you call this before any data has been loaded from a URI, it will
67 * succeed, but come back empty.
69 * Hopefully this will be removed with bug 805119
71 * @param uri The URI to look up.
72 * @param doc Optional pointer to the document that the cache entry belongs to.
73 * @returns NULL if the URL was not found in the cache
76 nsIProperties findEntryProperties
(in nsIURI uri
,
77 [optional] in Document doc
);
80 * Make this cache instance respect private browsing notifications. This
81 * entails clearing the chrome and content caches whenever the
82 * last-pb-context-exited notification is observed.
84 void respectPrivacyNotifications
();
87 * Clear the image cache for a document. Controlled documents are responsible
88 * for doing this manually when they get destroyed.
91 void clearCacheForControlledDocument
(in Document doc
);