CSP: move 'upgrade-insecure-request' out of |directives|.
Up to very recently, the CSP mojo struct only contained directives using a list of CSP sources, except for 'upgrade-insecure-requests', which used an empty list. In the next few weeks. Two new directives will be added: - treat-as-public-address (https://crbug.com/1042164) - sandbox (https://crbug.com/1041376) So there will be 3 kind of directives: 1) The ones containing a set of CSPSources. 2) The ones with no data. 3) The WebSandboxPolicy one. [Question] Can we continue storing everything in the map |directive|? |directive| is: map: CSPDirectiveName -> CSPSourceList. To continue [A], we could make |directives| to store a mojo union. union { CSPSourceList source_list WebSandboxFlags sandbox_flags void none. } or we could stop storing everything in |directives| [B]. Instead, we could just add more attributes. It is not clear to me what in between [A] and [B] to be preferable. This patch tries [B]. Please let me know if you think otherwise. [A] would gives: ~~~ - csp->directives[kSandbox].get_sandbox_flag(); - csp->directives[FrameAncestors].get_source_list(); ~~~ [B] would gives: ~~ - csp->sandbox - csp->directives[FrameAncestors]; ~~ cons of [B] is that we need to update all the conversions from/to this CSP struct in between non-blink/blink-public/blink-private. Bug: 1041376 Change-Id: I8ed473bca2d47beaab82187a68204cc10643e0ab Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2165113Reviewed-by:Camille Lamy <clamy@chromium.org> Reviewed-by:
Daniel Vogelheim <vogelheim@chromium.org> Reviewed-by:
Mike West <mkwst@chromium.org> Commit-Queue: Mike West <mkwst@chromium.org> Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org> Cr-Commit-Position: refs/heads/master@{#763439}
Showing
Please register or sign in to comment