From a90a5cba08fdf6c0ceb95101c275108a152a3aed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:37 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- dom/html/HTMLDNSPrefetch.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'dom/html/HTMLDNSPrefetch.h') diff --git a/dom/html/HTMLDNSPrefetch.h b/dom/html/HTMLDNSPrefetch.h index 5820a6ecb2..5fd263d3f5 100644 --- a/dom/html/HTMLDNSPrefetch.h +++ b/dom/html/HTMLDNSPrefetch.h @@ -55,7 +55,13 @@ class HTMLDNSPrefetch { Medium, High, }; - static nsresult Prefetch(SupportsDNSPrefetch&, Element&, Priority); + enum class PrefetchSource { + LinkDnsPrefetch, + AnchorSpeculativePrefetch, + }; + static nsresult DeferPrefetch(SupportsDNSPrefetch& aSupports, + Element& aElement, Priority aPriority); + static void SendRequest(Element& aElement, nsIDNSService::DNSFlags aFlags); static nsresult Prefetch( const nsAString& host, bool isHttps, const OriginAttributes& aPartitionedPrincipalOriginAttributes, @@ -68,9 +74,9 @@ class HTMLDNSPrefetch { nsresult aReason); static void ElementDestroyed(Element&, SupportsDNSPrefetch&); - private: static nsIDNSService::DNSFlags PriorityToDNSServiceFlags(Priority); + private: static nsresult Prefetch( const nsAString& host, bool isHttps, const OriginAttributes& aPartitionedPrincipalOriginAttributes, @@ -114,8 +120,8 @@ class SupportsDNSPrefetch { mDNSPrefetchDeferred(false), mDestroyedCalled(false) {} - void CancelDNSPrefetch(Element&); - void TryDNSPrefetch(Element&); + void CancelDNSPrefetch(Element& aOwner); + void TryDNSPrefetch(Element& aOwner, HTMLDNSPrefetch::PrefetchSource aSource); // This MUST be called on the destructor of the Element subclass. // Our own destructor ensures that. -- cgit v1.2.3