WTF: Add String::contains(StringView) [chromium/src : main]

0 views
Skip to first unread message

Kent Tamura (Gerrit)

unread,
Feb 11, 2026, 1:59:28 AM (yesterday) Feb 11
to Kent Tamura, Fredrik Söderquist, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, AyeAye, feature-me...@chromium.org, video-networking...@google.com, eric.c...@apple.com, devtools-re...@chromium.org, blink-rev...@chromium.org, gl...@chromium.org, kinuko...@chromium.org, silv...@chromium.org, mcasas+med...@chromium.org, blink-re...@chromium.org, emircan+watch...@chromium.org, blink-...@chromium.org
Attention needed from Fredrik Söderquist

Kent Tamura voted and added 1 comment

Votes added by Kent Tamura

Auto-Submit+1

1 comment

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Kent Tamura . resolved

fs@, would you review this please?

Open in Gerrit

Related details

Attention is currently required from:
  • Fredrik Söderquist
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: I394a299db7d1e92e9f757e351a1d8fcb6f477128
Gerrit-Change-Number: 7564090
Gerrit-PatchSet: 4
Gerrit-Owner: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
Gerrit-Comment-Date: Wed, 11 Feb 2026 06:58:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

AI Code Reviewer (Gerrit)

unread,
Feb 11, 2026, 2:00:42 AM (yesterday) Feb 11
to Kent Tamura, Fredrik Söderquist, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, AyeAye, feature-me...@chromium.org, video-networking...@google.com, eric.c...@apple.com, devtools-re...@chromium.org, blink-rev...@chromium.org, gl...@chromium.org, kinuko...@chromium.org, silv...@chromium.org, mcasas+med...@chromium.org, blink-re...@chromium.org, emircan+watch...@chromium.org, blink-...@chromium.org
Attention needed from Fredrik Söderquist

AI Code Reviewer added 1 comment

File third_party/blink/renderer/platform/wtf/text/wtf_string.h
Line 281, Patchset 4 (Latest): bool contains(const StringView& value) const { return find(value) != npos; }
AI Code Reviewer . unresolved

nit: Blink Style Guide: Naming - Use 'CamelCase' for all function names. This method should be named 'Contains'. Note that a 'Contains' method accepting 'StringView' already exists (via the overload with a default argument), so this addition appears redundant.

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:
  • Fredrik Söderquist
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: I394a299db7d1e92e9f757e351a1d8fcb6f477128
    Gerrit-Change-Number: 7564090
    Gerrit-PatchSet: 4
    Gerrit-Owner: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
    Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
    Gerrit-Comment-Date: Wed, 11 Feb 2026 07:00:38 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Fredrik Söderquist (Gerrit)

    unread,
    Feb 11, 2026, 4:50:25 AM (yesterday) Feb 11
    to Kent Tamura, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, AyeAye, feature-me...@chromium.org, video-networking...@google.com, eric.c...@apple.com, devtools-re...@chromium.org, blink-rev...@chromium.org, gl...@chromium.org, kinuko...@chromium.org, silv...@chromium.org, mcasas+med...@chromium.org, blink-re...@chromium.org, emircan+watch...@chromium.org, blink-...@chromium.org
    Attention needed from Kent Tamura

    Fredrik Söderquist voted and added 1 comment

    Votes added by Fredrik Söderquist

    Code-Review+1
    Commit-Queue+2

    1 comment

    File third_party/blink/renderer/platform/wtf/text/wtf_string.h
    Line 281, Patchset 4 (Latest): bool contains(const StringView& value) const { return find(value) != npos; }
    AI Code Reviewer . resolved

    nit: Blink Style Guide: Naming - Use 'CamelCase' for all function names. This method should be named 'Contains'. Note that a 'Contains' method accepting 'StringView' already exists (via the overload with a default argument), so this addition appears redundant.

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

    Fredrik Söderquist

    OK But Won't Fix: It's intentional. For std::string compatibility.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Kent Tamura
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement 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: I394a299db7d1e92e9f757e351a1d8fcb6f477128
      Gerrit-Change-Number: 7564090
      Gerrit-PatchSet: 4
      Gerrit-Owner: Kent Tamura <tk...@chromium.org>
      Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
      Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
      Gerrit-Attention: Kent Tamura <tk...@chromium.org>
      Gerrit-Comment-Date: Wed, 11 Feb 2026 09:50:13 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Feb 11, 2026, 4:53:54 AM (yesterday) Feb 11
      to Kent Tamura, Fredrik Söderquist, AI Code Reviewer, chromium...@chromium.org, srirama chandra sekhar, AyeAye, feature-me...@chromium.org, video-networking...@google.com, eric.c...@apple.com, devtools-re...@chromium.org, blink-rev...@chromium.org, gl...@chromium.org, kinuko...@chromium.org, silv...@chromium.org, mcasas+med...@chromium.org, blink-re...@chromium.org, emircan+watch...@chromium.org, blink-...@chromium.org

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      WTF: Add String::contains(StringView)

      This change introduces a new method `String::contains(StringView)` which
      is compatible with the C++23 `std::string::contains`.

      This new method is then used to replace numerous calls to
      `String::Find(...) != kNotFound` and `String::Find(...) == kNotFound`,
      improving code readability across many files.
      Bug: 473854537
      Change-Id: I394a299db7d1e92e9f757e351a1d8fcb6f477128
      Reviewed-by: Fredrik Söderquist <f...@opera.com>
      Commit-Queue: Fredrik Söderquist <f...@opera.com>
      Auto-Submit: Kent Tamura <tk...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1583081}
      Files:
      • M third_party/blink/renderer/core/exported/web_frame_serializer_sanitization_test.cc
      • M third_party/blink/renderer/core/html/forms/html_input_element.cc
      • M third_party/blink/renderer/core/html/track/vtt/vtt_region.cc
      • M third_party/blink/renderer/core/inspector/dom_patch_support.cc
      • M third_party/blink/renderer/core/inspector/inspector_style_sheet.cc
      • M third_party/blink/renderer/modules/mediarecorder/media_recorder_handler.cc
      • M third_party/blink/renderer/modules/mediarecorder/media_recorder_handler_unittest.cc
      • M third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc
      • M third_party/blink/renderer/platform/wtf/text/wtf_string.h
      Change size: M
      Delta: 9 files changed, 102 insertions(+), 108 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Fredrik Söderquist
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I394a299db7d1e92e9f757e351a1d8fcb6f477128
      Gerrit-Change-Number: 7564090
      Gerrit-PatchSet: 5
      Gerrit-Owner: Kent Tamura <tk...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
      Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      open
      diffy
      satisfied_requirement

      Kent Tamura (Gerrit)

      unread,
      Feb 11, 2026, 6:00:17 PM (11 hours ago) Feb 11
      to Chromium LUCI CQ, Kent Tamura, Fredrik Söderquist, AI Code Reviewer, chromium...@chromium.org, srirama chandra sekhar, AyeAye, feature-me...@chromium.org, video-networking...@google.com, eric.c...@apple.com, devtools-re...@chromium.org, blink-rev...@chromium.org, gl...@chromium.org, kinuko...@chromium.org, silv...@chromium.org, mcasas+med...@chromium.org, blink-re...@chromium.org, emircan+watch...@chromium.org, blink-...@chromium.org

      Kent Tamura added 1 comment

      File third_party/blink/renderer/platform/wtf/text/wtf_string.h
      Line 281, Patchset 4: bool contains(const StringView& value) const { return find(value) != npos; }
      AI Code Reviewer . resolved

      nit: Blink Style Guide: Naming - Use 'CamelCase' for all function names. This method should be named 'Contains'. Note that a 'Contains' method accepting 'StringView' already exists (via the overload with a default argument), so this addition appears redundant.

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

      Fredrik Söderquist

      OK But Won't Fix: It's intentional. For std::string compatibility.

      Kent Tamura

      Thanks!

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement 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: I394a299db7d1e92e9f757e351a1d8fcb6f477128
      Gerrit-Change-Number: 7564090
      Gerrit-PatchSet: 5
      Gerrit-Owner: Kent Tamura <tk...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
      Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
      Gerrit-Comment-Date: Wed, 11 Feb 2026 22:59:52 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Comment-In-Reply-To: Fredrik Söderquist <f...@opera.com>
      satisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages