From 4410f432fc707e6b39df29a81ebdb5da4f327394 Mon Sep 17 00:00:00 2001 From: Timothy Nikkel Date: Thu, 30 May 2024 11:03:33 +0000 Subject: [PATCH] Bug 1899684. Use NS_UsePrivateBrowsing in nsContentUtils::GetImgLoaderForChannel. r=necko-reviewers,kershaw NS_UsePrivateBrowsing seems to be the more modern, correct, and widespread way to do this. Differential Revision: https://phabricator.services.mozilla.com/D212086 --- dom/base/nsContentUtils.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 970753820316..387d651b7a7e 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -4040,11 +4040,8 @@ imgLoader* nsContentUtils::GetImgLoaderForChannel(nsIChannel* aChannel, if (!aChannel) { return imgLoader::NormalLoader(); } - nsCOMPtr context; - NS_QueryNotificationCallbacks(aChannel, context); - return context && context->UsePrivateBrowsing() - ? imgLoader::PrivateBrowsingLoader() - : imgLoader::NormalLoader(); + return NS_UsePrivateBrowsing(aChannel) ? imgLoader::PrivateBrowsingLoader() + : imgLoader::NormalLoader(); } // static