tor-browser

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

commit 8a5709ccf18d435c7fce7c9c7e1c3059cf314f87
parent a25f1d8c2a59aa7d0200a52c8c3763ac6c09fde8
Author: Tom Schuster <tschuster@mozilla.com>
Date:   Mon,  5 Jan 2026 11:16:20 +0000

Bug 2006937 - Remove an open coded version of NS_IsAboutSrcdoc from ReferrerInfo::ShouldResponseInheritReferrerInfo. r=emilio

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

Diffstat:
Mdom/security/ReferrerInfo.cpp | 12++----------
1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/dom/security/ReferrerInfo.cpp b/dom/security/ReferrerInfo.cpp @@ -30,6 +30,7 @@ #include "nsIPipe.h" #include "nsIURL.h" #include "nsIWebProgressListener.h" +#include "nsNetUtil.h" #include "nsScriptSecurityManager.h" #include "nsStreamUtils.h" #include "nsWhitespaceTokenizer.h" @@ -277,16 +278,7 @@ bool ReferrerInfo::ShouldResponseInheritReferrerInfo(nsIChannel* aChannel) { nsresult rv = aChannel->GetURI(getter_AddRefs(channelURI)); NS_ENSURE_SUCCESS(rv, false); - bool isAbout = channelURI->SchemeIs("about"); - if (!isAbout) { - return false; - } - - nsAutoCString aboutSpec; - rv = channelURI->GetSpec(aboutSpec); - NS_ENSURE_SUCCESS(rv, false); - - return aboutSpec.EqualsLiteral("about:srcdoc"); + return NS_IsAboutSrcdoc(channelURI); } /* static */