diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /toolkit/components/places/FaviconHelpers.h | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/places/FaviconHelpers.h')
-rw-r--r-- | toolkit/components/places/FaviconHelpers.h | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/toolkit/components/places/FaviconHelpers.h b/toolkit/components/places/FaviconHelpers.h index ba3407722c..aaa5396fe6 100644 --- a/toolkit/components/places/FaviconHelpers.h +++ b/toolkit/components/places/FaviconHelpers.h @@ -14,6 +14,7 @@ #include "nsThreadUtils.h" #include "nsProxyRelease.h" #include "imgLoader.h" +#include "PlacesCompletionCallback.h" class nsIPrincipal; @@ -192,6 +193,33 @@ class AsyncAssociateIconToPage final : public Runnable { }; /** + * Set favicon for the page, finally dispatches an event to the + * main thread to notify the change to observers. + */ +class AsyncSetIconForPage final : public Runnable { + public: + NS_DECL_NSIRUNNABLE + + /** + * Constructor. + * + * @param aIcon + * Icon to be associated. + * @param aPage + * Page to which associate the icon. + * @param aCallback + * Function to be called when the associate process finishes. + */ + AsyncSetIconForPage(const IconData& aIcon, const PageData& aPage, + PlacesCompletionCallback* aCallback); + + private: + nsMainThreadPtrHandle<PlacesCompletionCallback> mCallback; + IconData mIcon; + PageData mPage; +}; + +/** * Asynchronously tries to get the URL of a page's favicon, then notifies the * given observer. */ @@ -256,18 +284,6 @@ class AsyncGetFaviconDataForPage final : public Runnable { nsCString mPageHost; }; -class AsyncReplaceFaviconData final : public Runnable { - public: - NS_DECL_NSIRUNNABLE - - explicit AsyncReplaceFaviconData(const IconData& aIcon); - - private: - nsresult RemoveIconDataCacheEntry(); - - IconData mIcon; -}; - /** * Notifies the icon change to favicon observers. */ @@ -276,7 +292,7 @@ class NotifyIconObservers final : public Runnable { NS_DECL_NSIRUNNABLE /** - * Constructor. + * Constructor for nsIFaviconDataCallback. * * @param aIcon * Icon information. Can be empty if no icon is associated to the page. |