diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /toolkit/components/places/nsIFaviconService.idl | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/places/nsIFaviconService.idl')
-rw-r--r-- | toolkit/components/places/nsIFaviconService.idl | 82 |
1 files changed, 23 insertions, 59 deletions
diff --git a/toolkit/components/places/nsIFaviconService.idl b/toolkit/components/places/nsIFaviconService.idl index 5bc26545c6..f0aeda711f 100644 --- a/toolkit/components/places/nsIFaviconService.idl +++ b/toolkit/components/places/nsIFaviconService.idl @@ -9,6 +9,7 @@ interface nsIURI; interface nsIPrincipal; interface mozIPlacesPendingOperation; interface nsIFaviconDataCallback; +interface PlacesCompletionCallback; [scriptable, uuid(e81e0b0c-b9f1-4c2e-8f3c-b809933cf73c)] interface nsIFaviconService : nsISupports @@ -141,72 +142,35 @@ interface nsIFaviconService : nsISupports [optional] in unsigned long long aRequestContextID); /** - * Sets the data for a given favicon URI either by replacing existing data in - * the database or taking the place of otherwise fetched icon data when - * calling setAndFetchFaviconForPage later. - * - * Favicon data for favicon URIs that are not associated with a page URI via - * setAndFetchFaviconForPage will be stored in memory, but may be expired at - * any time, so you should make an effort to associate favicon URIs with page - * URIs as soon as possible. - * - * It's better to not use this function for chrome: icon URIs since you can - * reference the chrome image yourself. getFaviconLinkForIcon/Page will ignore - * any associated data if the favicon URI is "chrome:" and just return the - * same chrome URI. - * - * This function does NOT send out notifications that the data has changed. - * Pages using this favicons that are visible in history or bookmarks views - * will keep the old icon until they have been refreshed by other means. - * - * This function tries to optimize the favicon size, if it is bigger - * than a defined limit we will try to convert it to a 16x16 png image. - * If the conversion fails and favicon is still bigger than our max accepted - * size it won't be saved. - * - * @param aFaviconURI - * URI of the favicon whose data is being set. - * @param aData - * Binary contents of the favicon to save - * @param aMimeType - * MIME type of the data to store. This is important so that we know - * what to report when the favicon is used. You should always set this - * param unless you are clearing an icon. - * @param [optional] aExpiration - * Time in microseconds since the epoch when this favicon expires. - * Until this time, we won't try to load it again. - * @throws NS_ERROR_FAILURE - * Thrown if the favicon is overbloated and won't be saved to the db. - */ - void replaceFaviconData(in nsIURI aFaviconURI, - in Array<octet> aData, - in AUTF8String aMimeType, - [optional] in PRTime aExpiration); - - /** - * Same as replaceFaviconData but the data is provided by a string - * containing a data URL. - * - * @see replaceFaviconData + * Stores the relation between a page URI and a favicon URI, whose icon data + * is provided through a data URL. + * The process is asynchronous and a callback with the status of the operation + * will be invoked at the end of it. * + * @param aPageURI + * URI of the page whose favicon is being set. * @param aFaviconURI - * URI of the favicon whose data is being set. + * URI of the favicon to associate with the page. * @param aDataURL - * string containing a data URL that represents the contents of - * the favicon to save + * String that represents a data URL to replace as the favicon content. * @param [optional] aExpiration * Time in microseconds since the epoch when this favicon expires. * Until this time, we won't try to load it again. - * @param [optional] aLoadingPrincipal - * Principal of the page whose favicon is being set. If this argument - * is omitted, the loadingPrincipal defaults to the nullPrincipal. - * @throws NS_ERROR_FAILURE - * Thrown if the favicon is overbloated and won't be saved to the db. + * If this argument is omitted, the expiration defaults to + * 7 days (FaviconHelpers::MAX_FAVICON_EXPIRATION) from now. + * @param [optional] aCallback + * Once we're done setting and/or fetching the favicon, we invoke this + * callback. + * + * @see PlacesCompletionCallback in PlacesCompletionCallback.idl. */ - void replaceFaviconDataFromDataURL(in nsIURI aFaviconURI, - in AString aDataURL, - [optional] in PRTime aExpiration, - [optional] in nsIPrincipal aLoadingPrincipal); + void setFaviconForPage( + in nsIURI aPageURI, + in nsIURI aFaviconURI, + in nsIURI aDataURL, + [optional] in PRTime aExpiration, + [optional] in PlacesCompletionCallback aCallback + ); /** * Retrieves the favicon URI associated to the given page, if any. |