tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 57b138ea0699ee932fea5a6e7b0da6fc9838ffd6
parent 129ae82aa138383667c0295c53da40d7b136d51a
Author: Valentin Gosu <valentin.gosu@gmail.com>
Date:   Wed, 10 Dec 2025 11:21:29 +0000

Bug 2004912 - Forward declare nsHttpResponseHead in SharedSubResourceCache.h r=emilio,firefox-style-system-reviewers

Making changes to nsHttpResponseHead.h or nsHttpHeaderArray.h needs almost a
full recompilation because of the inclusion of the header in
SharedSubResourceCache.h which is then included in many other places.

This patch moves the destructor impl to the cpp file so the
definition of nsHttpResponseHead is accessible to the
destructor via UniquePtr.

Differential Revision: https://phabricator.services.mozilla.com/D275602

Diffstat:
Mlayout/style/SharedSubResourceCache.cpp | 3+++
Mlayout/style/SharedSubResourceCache.h | 7+++++--
2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/layout/style/SharedSubResourceCache.cpp b/layout/style/SharedSubResourceCache.cpp @@ -17,6 +17,7 @@ #include "mozilla/net/HttpBaseChannel.h" #include "nsCOMPtr.h" #include "nsDOMNavigationTiming.h" +#include "nsHttpResponseHead.h" #include "nsIHttpChannel.h" #include "nsIRequest.h" #include "nsITimedChannel.h" @@ -141,6 +142,8 @@ bool ShouldClearEntry(nsIURI* aEntryURI, nsIPrincipal* aEntryLoaderPrincipal, } // namespace SharedSubResourceCacheUtils +SubResourceNetworkMetadataHolder::~SubResourceNetworkMetadataHolder() = default; + SubResourceNetworkMetadataHolder::SubResourceNetworkMetadataHolder( nsIRequest* aRequest) { nsCOMPtr<nsITimedChannel> timedChannel = do_QueryInterface(aRequest); diff --git a/layout/style/SharedSubResourceCache.h b/layout/style/SharedSubResourceCache.h @@ -37,7 +37,6 @@ #include "mozilla/dom/CacheablePerformanceTimingData.h" #include "mozilla/dom/Document.h" #include "nsContentUtils.h" -#include "nsHttpResponseHead.h" #include "nsIMemoryReporter.h" #include "nsISupportsImpl.h" #include "nsRefPtrHashtable.h" @@ -45,6 +44,10 @@ namespace mozilla { +namespace net { +class nsHttpResponseHead; +} + // A struct to hold the network-related metadata associated with the cache. // // When inserting a cache, the consumer should create this from the request and @@ -72,7 +75,7 @@ class SubResourceNetworkMetadataHolder { NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SubResourceNetworkMetadataHolder) private: - ~SubResourceNetworkMetadataHolder() = default; + ~SubResourceNetworkMetadataHolder(); mozilla::Maybe<dom::CacheablePerformanceTimingData> mPerfData; mozilla::UniquePtr<net::nsHttpResponseHead> mResponseHead;