mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 11:58:55 +00:00

This patch is meant to be a proposed short run fix to prevent ApplyAddonContentScriptCSP from leaking the ExpandedPrincipal and nsCSPContext instance because they keep a reference to each other. This patch prevent that leak by creating a clone of the ExpandedPrincipal and then use that cloned instance in the call to nsCSPContext::SetRequestContextWithPrincipal. Once Bug 1548468 will move the CSP off the ExpandedPrincipal class, cloning the expanded principal to prevent that leak should not be necessary anymore. Differential Revision: https://phabricator.services.mozilla.com/D132144