Files
tubestation/caps
Nika Layzell f231bdbc51 Bug 1952914 - Part 1: Reduce complexity of GetSiteOriginNoSuffix, r=ckerschb
The most expensive step in ValidatePrincipal is currently building a
SiteOriginNoSuffix from a ContentPrincipal. This codepath has become more hot
due to new checks using ValidatePrincipal.

This refactors the code to avoid doing any work on the principal in more cases.
The new codepath only computes a different siteOrigin for http(s) URIs, which I
believe should be correct. It also does manual parsing of the origin which was
built by GenerateOriginNoSuffixForURI in order to avoid unnecessary calls to
the URI parser.

Differential Revision: https://phabricator.services.mozilla.com/D242420
2025-03-26 02:18:25 +00:00
..