Fix unsafe buffer usage in literal_buffer.h [chromium/src : main]

0 views
Skip to first unread message

AI Code Reviewer (Gerrit)

unread,
Dec 9, 2025, 2:00:59 PM (3 days ago) Dec 9
to Aditi Page, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org

AI Code Reviewer added 1 comment

File third_party/blink/renderer/core/html/parser/literal_buffer.h
Line 93, Patchset 1 (Latest): // To avoid Integer Overflow
AI Code Reviewer . unresolved

Blink Style Guide: Prefer blink:: types over STL and base types. Use 'blink::wtf_size_t' instead of 'size_t' for 'count' and the 'base::CheckedNumeric' template argument to match the rest of the file.

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 set is empty
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: I3b1a8c2edcfb93e42dcfa3b030cb0a48b785f296
Gerrit-Change-Number: 7240951
Gerrit-PatchSet: 1
Gerrit-Owner: Aditi Page <adit...@google.com>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-Comment-Date: Tue, 09 Dec 2025 19:00:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Aditi Page (Gerrit)

unread,
Dec 9, 2025, 2:11:47 PM (3 days ago) Dec 9
to Kouhei Ueno, Arthur Sonzogni, Vincent Scheib, AI Code Reviewer, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
Attention needed from Arthur Sonzogni and Kouhei Ueno

Aditi Page added 1 comment

File third_party/blink/renderer/core/html/parser/literal_buffer.h
Line 93, Patchset 1 (Latest): // To avoid Integer Overflow
AI Code Reviewer . unresolved

Blink Style Guide: Prefer blink:: types over STL and base types. Use 'blink::wtf_size_t' instead of 'size_t' for 'count' and the 'base::CheckedNumeric' template argument to match the rest of the file.

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)_

Aditi Page

Will create a new bug to address this since this is not fixing memory safety.

Open in Gerrit

Related details

Attention is currently required from:
  • Arthur Sonzogni
  • Kouhei Ueno
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: I3b1a8c2edcfb93e42dcfa3b030cb0a48b785f296
Gerrit-Change-Number: 7240951
Gerrit-PatchSet: 1
Gerrit-Owner: Aditi Page <adit...@google.com>
Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-Reviewer: Kouhei Ueno <kou...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Vincent Scheib <sch...@chromium.org>
Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-Attention: Kouhei Ueno <kou...@chromium.org>
Gerrit-Comment-Date: Tue, 09 Dec 2025 19:11:35 +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

Aditi Page (Gerrit)

unread,
Dec 9, 2025, 6:11:26 PM (3 days ago) Dec 9
to Kouhei Ueno, Arthur Sonzogni, Vincent Scheib, AI Code Reviewer, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
Attention needed from Arthur Sonzogni and Kouhei Ueno

Aditi Page added 1 comment

File third_party/blink/renderer/core/html/parser/literal_buffer.h
Line 93, Patchset 1 (Latest): // To avoid Integer Overflow
AI Code Reviewer . resolved

Blink Style Guide: Prefer blink:: types over STL and base types. Use 'blink::wtf_size_t' instead of 'size_t' for 'count' and the 'base::CheckedNumeric' template argument to match the rest of the file.

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)_

Aditi Page

Will create a new bug to address this since this is not fixing memory safety.

Aditi Page

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Arthur Sonzogni
  • Kouhei Ueno
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: I3b1a8c2edcfb93e42dcfa3b030cb0a48b785f296
    Gerrit-Change-Number: 7240951
    Gerrit-PatchSet: 1
    Gerrit-Owner: Aditi Page <adit...@google.com>
    Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Reviewer: Kouhei Ueno <kou...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Vincent Scheib <sch...@chromium.org>
    Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Attention: Kouhei Ueno <kou...@chromium.org>
    Gerrit-Comment-Date: Tue, 09 Dec 2025 23:11:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Comment-In-Reply-To: Aditi Page <adit...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kouhei Ueno (Gerrit)

    unread,
    Dec 9, 2025, 7:37:05 PM (3 days ago) Dec 9
    to Aditi Page, Mason Freed, Arthur Sonzogni, Vincent Scheib, AI Code Reviewer, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
    Attention needed from Aditi Page, Arthur Sonzogni and Mason Freed

    Kouhei Ueno added 1 comment

    Patchset-level comments
    File-level comment, Patchset 2 (Latest):
    Kouhei Ueno . resolved

    Mason: I'd like to rely on you to make the call. I worry the performance implication of the change in the hot code path. Should we request measurements?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Aditi Page
    • Arthur Sonzogni
    • Mason Freed
    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: I3b1a8c2edcfb93e42dcfa3b030cb0a48b785f296
    Gerrit-Change-Number: 7240951
    Gerrit-PatchSet: 2
    Gerrit-Owner: Aditi Page <adit...@google.com>
    Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Reviewer: Kouhei Ueno <kou...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Vincent Scheib <sch...@chromium.org>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Attention: Aditi Page <adit...@google.com>
    Gerrit-Comment-Date: Wed, 10 Dec 2025 00:36:31 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mason Freed (Gerrit)

    unread,
    Dec 10, 2025, 6:47:35 PM (2 days ago) Dec 10
    to Aditi Page, Kouhei Ueno, Arthur Sonzogni, Vincent Scheib, AI Code Reviewer, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
    Attention needed from Aditi Page and Arthur Sonzogni

    Mason Freed added 1 comment

    Patchset-level comments
    Kouhei Ueno . unresolved

    Mason: I'd like to rely on you to make the call. I worry the performance implication of the change in the hot code path. Should we request measurements?

    Mason Freed

    Yeah, I'm definitely concerned about the same thing. This adds a ton of `CHECK` calls that likely slow down the parser significantly.

    I'll try to kick some off.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Aditi Page
    • Arthur Sonzogni
    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: I3b1a8c2edcfb93e42dcfa3b030cb0a48b785f296
      Gerrit-Change-Number: 7240951
      Gerrit-PatchSet: 2
      Gerrit-Owner: Aditi Page <adit...@google.com>
      Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
      Gerrit-Reviewer: Kouhei Ueno <kou...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Vincent Scheib <sch...@chromium.org>
      Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
      Gerrit-Attention: Aditi Page <adit...@google.com>
      Gerrit-Comment-Date: Wed, 10 Dec 2025 23:47:26 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Kouhei Ueno <kou...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Mason Freed (Gerrit)

      unread,
      Dec 10, 2025, 6:49:27 PM (2 days ago) Dec 10
      to Aditi Page, Kouhei Ueno, Arthur Sonzogni, Vincent Scheib, AI Code Reviewer, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
      Attention needed from Aditi Page and Arthur Sonzogni

      Mason Freed added 1 comment

      Patchset-level comments
      Kouhei Ueno . unresolved

      Mason: I'd like to rely on you to make the call. I worry the performance implication of the change in the hot code path. Should we request measurements?

      Mason Freed

      Yeah, I'm definitely concerned about the same thing. This adds a ton of `CHECK` calls that likely slow down the parser significantly.

      I'll try to kick some off.

      Gerrit-Comment-Date: Wed, 10 Dec 2025 23:49:16 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
      Comment-In-Reply-To: Kouhei Ueno <kou...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      chromeperf@appspot.gserviceaccount.com (Gerrit)

      unread,
      Dec 10, 2025, 7:08:22 PM (2 days ago) Dec 10
      to Aditi Page, Mason Freed, Kouhei Ueno, Arthur Sonzogni, Vincent Scheib, AI Code Reviewer, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
      Attention needed from Aditi Page and Arthur Sonzogni

      Message from chrom...@appspot.gserviceaccount.com

      😿 Job mac-m4-mini-perf/speedometer3 failed.

      See results at: https://pinpoint-dot-chromeperf.appspot.com/job/12e6bfdf310000

      Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
      Gerrit-Attention: Aditi Page <adit...@google.com>
      Gerrit-Comment-Date: Thu, 11 Dec 2025 00:08:11 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Arthur Sonzogni (Gerrit)

      unread,
      Dec 11, 2025, 5:35:34 AM (yesterday) Dec 11
      to Aditi Page, chrom...@appspot.gserviceaccount.com, Mason Freed, Kouhei Ueno, Vincent Scheib, AI Code Reviewer, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
      Attention needed from Aditi Page

      Arthur Sonzogni voted and added 1 comment

      Votes added by Arthur Sonzogni

      Code-Review-1

      1 comment

      Patchset-level comments
      Arthur Sonzogni . resolved

      Hi Aditi,

      Looking at the code, it doesn't compile for multiple reasons, including `-WUnsafe-buffer-usage`. In the future, could you please:

      • Compile the code locally.
      • Press the Commit-queue: +1 button and wait for the commit queue results before requesting a code review.

      About this patch, I don't think it would be trivial to use AI to fix the UNSAFE_TODO here. Mostly likely, they will be replaced by `UNSAFE_BUFFERS` and a comment explaining why this is safe.

      BTW, this isn't the original [AI patch](https://chromium-review.googlesource.com/c/chromium/src/+/7090591) that was proposed for the rotation.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aditi Page
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is blockingCode-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: I3b1a8c2edcfb93e42dcfa3b030cb0a48b785f296
        Gerrit-Change-Number: 7240951
        Gerrit-PatchSet: 2
        Gerrit-Owner: Aditi Page <adit...@google.com>
        Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
        Gerrit-Reviewer: Kouhei Ueno <kou...@chromium.org>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Vincent Scheib <sch...@chromium.org>
        Gerrit-Attention: Aditi Page <adit...@google.com>
        Gerrit-Comment-Date: Thu, 11 Dec 2025 10:35:18 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        blocking_requirement
        open
        diffy

        Aditi Page (Gerrit)

        unread,
        6:25 AM (14 hours ago) 6:25 AM
        to Chromium LUCI CQ, Arthur Sonzogni, chrom...@appspot.gserviceaccount.com, Mason Freed, Kouhei Ueno, Vincent Scheib, AI Code Reviewer, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
        Attention needed from Kouhei Ueno and Mason Freed

        Aditi Page added 1 comment

        Patchset-level comments
        File-level comment, Patchset 2:
        Kouhei Ueno . resolved

        Mason: I'd like to rely on you to make the call. I worry the performance implication of the change in the hot code path. Should we request measurements?

        Mason Freed

        Yeah, I'm definitely concerned about the same thing. This adds a ton of `CHECK` calls that likely slow down the parser significantly.

        I'll try to kick some off.

        Mason Freed

        https://pinpoint-dot-chromeperf.appspot.com/job/12e6bfdf310000

        Aditi Page

        Acknowledged

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Kouhei Ueno
        • Mason Freed
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is blockingCode-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: I3b1a8c2edcfb93e42dcfa3b030cb0a48b785f296
          Gerrit-Change-Number: 7240951
          Gerrit-PatchSet: 5
          Gerrit-Owner: Aditi Page <adit...@google.com>
          Gerrit-Reviewer: Aditi Page <adit...@google.com>
          Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
          Gerrit-Reviewer: Kouhei Ueno <kou...@chromium.org>
          Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
          Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
          Gerrit-Attention: Mason Freed <mas...@chromium.org>
          Gerrit-Attention: Kouhei Ueno <kou...@chromium.org>
          Gerrit-Comment-Date: Fri, 12 Dec 2025 11:25:38 +0000
          satisfied_requirement
          unsatisfied_requirement
          blocking_requirement
          open
          diffy
          Reply all
          Reply to author
          Forward
          0 new messages