2001-04-13 02:44:30 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-21 11:12:37 +00:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-04-13 02:44:30 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2005-03-23 21:09:02 +00:00
|
|
|
interface imgIRequest;
|
2018-06-20 15:57:50 +00:00
|
|
|
interface nsIPrincipal;
|
2005-03-23 21:09:02 +00:00
|
|
|
interface nsIProperties;
|
2015-10-26 20:03:26 +00:00
|
|
|
interface nsIURI;
|
2001-06-18 06:36:37 +00:00
|
|
|
|
2018-05-11 17:46:15 +00:00
|
|
|
webidl Document;
|
|
|
|
|
2018-06-20 15:57:50 +00:00
|
|
|
%{ C++
|
|
|
|
namespace mozilla {
|
|
|
|
class OriginAttributes;
|
|
|
|
} // mozilla namespace
|
|
|
|
%}
|
|
|
|
|
|
|
|
[ptr] native OriginAttributesPtr(mozilla::OriginAttributes);
|
|
|
|
|
2001-04-13 02:44:30 +00:00
|
|
|
/**
|
|
|
|
* imgICache interface
|
|
|
|
*
|
|
|
|
* @author Stuart Parmenter <pavlov@netscape.com>
|
2005-03-23 21:09:02 +00:00
|
|
|
* @version 0.1
|
2001-04-13 02:44:30 +00:00
|
|
|
* @see imagelib2
|
|
|
|
*/
|
2015-10-28 20:01:07 +00:00
|
|
|
[scriptable, builtinclass, uuid(bfdf23ff-378e-402e-8a6c-840f0c82b6c3)]
|
2001-04-13 02:44:30 +00:00
|
|
|
interface imgICache : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Evict images from the cache.
|
|
|
|
*
|
|
|
|
* @param chrome If TRUE, evict only chrome images.
|
|
|
|
* If FALSE, evict everything except chrome images.
|
|
|
|
*/
|
|
|
|
void clearCache(in boolean chrome);
|
2001-06-18 06:36:37 +00:00
|
|
|
|
2017-04-11 08:14:09 +00:00
|
|
|
/**
|
|
|
|
* Evict images from the cache.
|
|
|
|
*
|
|
|
|
* @param uri The URI to remove.
|
|
|
|
* @param doc The document to remove the cache entry for.
|
|
|
|
* @throws NS_ERROR_NOT_AVAILABLE if \a uri was unable to be removed from
|
|
|
|
* the cache.
|
|
|
|
*/
|
2018-05-11 17:46:15 +00:00
|
|
|
[noscript] void removeEntry(in nsIURI uri, [optional] in Document doc);
|
2017-04-11 08:14:09 +00:00
|
|
|
|
2018-06-20 15:57:50 +00:00
|
|
|
/**
|
|
|
|
* Evict images from the cache with the same origin and the same
|
2021-05-27 12:37:04 +00:00
|
|
|
* originAttributes of the passed principal, across all processes. May only be
|
|
|
|
* called from the parent process.
|
2018-06-20 15:57:50 +00:00
|
|
|
*
|
2021-05-27 12:37:04 +00:00
|
|
|
* @param aPrincipal The principal to clear cache entries for. The principals
|
|
|
|
* origin attributes are used to determine whether the private or normal
|
|
|
|
* browsing cache is cleared.
|
|
|
|
* @throws NS_ERROR_NOT_AVAILABLE if not called in the parent process.
|
2018-06-20 15:57:50 +00:00
|
|
|
*/
|
2021-05-27 12:37:04 +00:00
|
|
|
void removeEntriesFromPrincipalInAllProcesses(in nsIPrincipal aPrincipal);
|
2018-06-20 15:57:50 +00:00
|
|
|
|
2021-05-27 12:37:04 +00:00
|
|
|
/**
|
|
|
|
* Evict images from the non-chrome cache which match the the given base
|
|
|
|
* domain. Matching cache entries will be cleared across all origin attributes
|
|
|
|
* and all processes.
|
|
|
|
*
|
|
|
|
* @param aBaseDomain base domain to delete cache entries for.
|
|
|
|
* @throws NS_ERROR_NOT_AVAILABLE if not called in the parent process.
|
|
|
|
*/
|
|
|
|
void removeEntriesFromBaseDomainInAllProcesses(in ACString aBaseDomain);
|
|
|
|
|
2005-03-23 21:09:02 +00:00
|
|
|
/**
|
|
|
|
* Find Properties
|
|
|
|
* Used to get properties such as 'type' and 'content-disposition'
|
2014-12-05 23:12:08 +00:00
|
|
|
* 'type' is a nsISupportsCString containing the images' mime type such as
|
|
|
|
* 'image/png'
|
2005-03-23 21:09:02 +00:00
|
|
|
* 'content-disposition' will be a nsISupportsCString containing the header
|
2014-12-05 23:12:08 +00:00
|
|
|
* If you call this before any data has been loaded from a URI, it will
|
|
|
|
* succeed, but come back empty.
|
2005-03-23 21:09:02 +00:00
|
|
|
*
|
2012-10-24 18:40:41 +00:00
|
|
|
* Hopefully this will be removed with bug 805119
|
|
|
|
*
|
2005-03-23 21:09:02 +00:00
|
|
|
* @param uri The URI to look up.
|
2015-10-26 20:03:26 +00:00
|
|
|
* @param doc Optional pointer to the document that the cache entry belongs to.
|
2005-03-23 21:09:02 +00:00
|
|
|
* @returns NULL if the URL was not found in the cache
|
|
|
|
*/
|
2016-08-29 05:34:32 +00:00
|
|
|
[must_use]
|
|
|
|
nsIProperties findEntryProperties(in nsIURI uri,
|
2018-05-11 17:46:15 +00:00
|
|
|
[optional] in Document doc);
|
2012-06-26 04:20:12 +00:00
|
|
|
|
|
|
|
/**
|
2014-12-05 23:12:08 +00:00
|
|
|
* Make this cache instance respect private browsing notifications. This
|
|
|
|
* entails clearing the chrome and content caches whenever the
|
|
|
|
* last-pb-context-exited notification is observed.
|
2012-06-26 04:20:12 +00:00
|
|
|
*/
|
|
|
|
void respectPrivacyNotifications();
|
2015-10-28 20:01:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Clear the image cache for a document. Controlled documents are responsible
|
|
|
|
* for doing this manually when they get destroyed.
|
|
|
|
*/
|
|
|
|
[noscript, notxpcom]
|
2019-01-02 13:05:23 +00:00
|
|
|
void clearCacheForControlledDocument(in Document doc);
|
2001-04-13 02:44:30 +00:00
|
|
|
};
|