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
This commit is contained in:
Timothy Nikkel 2024-05-30 11:03:33 +00:00
parent 189d0cdf8c
commit 4410f432fc

View file

@ -4040,10 +4040,7 @@ imgLoader* nsContentUtils::GetImgLoaderForChannel(nsIChannel* aChannel,
if (!aChannel) {
return imgLoader::NormalLoader();
}
nsCOMPtr<nsILoadContext> context;
NS_QueryNotificationCallbacks(aChannel, context);
return context && context->UsePrivateBrowsing()
? imgLoader::PrivateBrowsingLoader()
return NS_UsePrivateBrowsing(aChannel) ? imgLoader::PrivateBrowsingLoader()
: imgLoader::NormalLoader();
}