[Trusted Types + CSP] Implement trusted-types-eval keyword. [chromium/src : main]

0 views
Skip to first unread message

Daniel Vogelheim (Gerrit)

unread,
Dec 5, 2025, 10:03:09 AM (9 days ago) Dec 5
to Daniel Vogelheim, Yifan Luo, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, mkwst+w...@chromium.org, network-ser...@chromium.org
Attention needed from Yifan Luo

Daniel Vogelheim added 1 comment

Patchset-level comments
File-level comment, Patchset 4:
Daniel Vogelheim . resolved

Yifan, please take a look.

Open in Gerrit

Related details

Attention is currently required from:
  • Yifan Luo
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ided5fd680b0fee1782148b48cdcc7705f2e745ef
Gerrit-Change-Number: 7207201
Gerrit-PatchSet: 5
Gerrit-Owner: Daniel Vogelheim <voge...@chromium.org>
Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
Gerrit-Reviewer: Yifan Luo <l...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Yifan Luo <l...@chromium.org>
Gerrit-Comment-Date: Fri, 05 Dec 2025 15:02:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

AI Code Reviewer (Gerrit)

unread,
Dec 5, 2025, 10:06:58 AM (9 days ago) Dec 5
to Daniel Vogelheim, Yifan Luo, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, mkwst+w...@chromium.org, network-ser...@chromium.org
Attention needed from Yifan Luo

AI Code Reviewer added 2 comments

File third_party/blink/renderer/core/frame/csp/csp_directive_list.cc
Line 282, Patchset 5 (Latest):bool CheckTrustedTypesEval(
AI Code Reviewer . unresolved

Google C++ Style Guide: Internal Linkage. This function should be `static` or in an anonymous namespace as it is not exported. Also, the parameter 'policy' is unused; please omit the name to avoid compiler warnings.

To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


_This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
_AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
_[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

Line 475, Patchset 5 (Latest):bool CheckTrustedTypesEvalAndReportViolation(
AI Code Reviewer . unresolved

Google C++ Style Guide: Internal Linkage. This function should be `static` or in an anonymous namespace as it is not exported. Also, the parameter 'exception_status' is unused; please omit the name to avoid compiler warnings.

To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


_This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
_AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
_[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

Open in Gerrit

Related details

Attention is currently required from:
  • Yifan Luo
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ided5fd680b0fee1782148b48cdcc7705f2e745ef
    Gerrit-Change-Number: 7207201
    Gerrit-PatchSet: 5
    Gerrit-Owner: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Yifan Luo <l...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Yifan Luo <l...@chromium.org>
    Gerrit-Comment-Date: Fri, 05 Dec 2025 15:06:47 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Vogelheim (Gerrit)

    unread,
    Dec 5, 2025, 10:23:51 AM (9 days ago) Dec 5
    to Daniel Vogelheim, AI Code Reviewer, Yifan Luo, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, mkwst+w...@chromium.org, network-ser...@chromium.org
    Attention needed from Yifan Luo

    Daniel Vogelheim added 2 comments

    File third_party/blink/renderer/core/frame/csp/csp_directive_list.cc
    Line 282, Patchset 5 (Latest):bool CheckTrustedTypesEval(
    AI Code Reviewer . resolved

    Google C++ Style Guide: Internal Linkage. This function should be `static` or in an anonymous namespace as it is not exported. Also, the parameter 'policy' is unused; please omit the name to avoid compiler warnings.

    To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
    **Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


    _This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
    _AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
    _[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

    Daniel Vogelheim

    OK But Won't Fix: This file defines numerous, conceptually similar `bool CheckXXX(...)` functions. This new function is consistent with all the other ones in this file. Maybe it makes sense to rewrite them all to be static; but I don't want this one function to be inconsistent with all the others.

    Line 475, Patchset 5 (Latest):bool CheckTrustedTypesEvalAndReportViolation(
    AI Code Reviewer . resolved

    Google C++ Style Guide: Internal Linkage. This function should be `static` or in an anonymous namespace as it is not exported. Also, the parameter 'exception_status' is unused; please omit the name to avoid compiler warnings.

    To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
    **Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


    _This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
    _AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
    _[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

    Daniel Vogelheim

    OK But Won't Fix: Just as above, this function is consistent with all the other `bool CheckXXX` functions in this file.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Yifan Luo
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ided5fd680b0fee1782148b48cdcc7705f2e745ef
      Gerrit-Change-Number: 7207201
      Gerrit-PatchSet: 5
      Gerrit-Owner: Daniel Vogelheim <voge...@chromium.org>
      Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
      Gerrit-Reviewer: Yifan Luo <l...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
      Gerrit-Attention: Yifan Luo <l...@chromium.org>
      Gerrit-Comment-Date: Fri, 05 Dec 2025 15:23:37 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Yifan Luo (Gerrit)

      unread,
      Dec 12, 2025, 3:14:42 PM (2 days ago) Dec 12
      to Daniel Vogelheim, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, mkwst+w...@chromium.org, network-ser...@chromium.org
      Attention needed from Daniel Vogelheim

      Yifan Luo added 3 comments

      Patchset-level comments
      File-level comment, Patchset 7 (Latest):
      Yifan Luo . resolved

      Thanks!

      Commit Message
      Line 10, Patchset 7 (Latest):checks, when Trusted Types in enforced. When Trusted Types is not enforced, this directive has no effect.
      Yifan Luo . unresolved

      nit: is?
      ```suggestion
      checks, when Trusted Types is enforced. When Trusted Types is not enforced, this directive has no effect.
      ```

      File third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
      Line 502, Patchset 7 (Latest): if (ExecutionContext* execution_context = ToExecutionContext(context)) {
      if (ContentSecurityPolicy* policy =
      execution_context->GetContentSecurityPolicyForCurrentWorld()) {
      Yifan Luo . unresolved

      It looks a bit weird. In what kind of cases that `execution_context` can be null? Can we move the variable declaration out of the if condition and just add DCHECKs for it?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Vogelheim
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ided5fd680b0fee1782148b48cdcc7705f2e745ef
        Gerrit-Change-Number: 7207201
        Gerrit-PatchSet: 7
        Gerrit-Owner: Daniel Vogelheim <voge...@chromium.org>
        Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
        Gerrit-Reviewer: Yifan Luo <l...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Attention: Daniel Vogelheim <voge...@chromium.org>
        Gerrit-Comment-Date: Fri, 12 Dec 2025 20:14:23 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages