Skip to content
Snippets Groups Projects
  • Luca Greco's avatar
    635e7a73
    Bug 1741600 - Fix ExpandedPrincipal and nsCSPContext leaks triggered by... · 635e7a73
    Luca Greco authored
    Bug 1741600 - Fix ExpandedPrincipal and nsCSPContext leaks triggered by ApplyAddonContentScriptCSP. r=ckerschb,robwu
    
    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
    635e7a73
    History
    Bug 1741600 - Fix ExpandedPrincipal and nsCSPContext leaks triggered by...
    Luca Greco authored
    Bug 1741600 - Fix ExpandedPrincipal and nsCSPContext leaks triggered by ApplyAddonContentScriptCSP. r=ckerschb,robwu
    
    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