WTF: Add String::Split*() methods taking a function predicate [chromium/src : main]

0 views
Skip to first unread message

Kent Tamura (Gerrit)

unread,
Apr 17, 2026, 4:24:08 AM (13 days ago) Apr 17
to Kent Tamura, Fredrik Söderquist, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, blink-rev...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@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 3 (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: Iae56cd45960fb8293014675fb23a785edf576014
Gerrit-Change-Number: 7772027
Gerrit-PatchSet: 3
Gerrit-Owner: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
Gerrit-Comment-Date: Fri, 17 Apr 2026 08:23:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Fredrik Söderquist (Gerrit)

unread,
Apr 17, 2026, 5:04:17 AM (13 days ago) Apr 17
to Kent Tamura, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, blink-rev...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
Attention needed from Kent Tamura

Fredrik Söderquist voted and added 2 comments

Votes added by Fredrik Söderquist

Code-Review+1

2 comments

Patchset-level comments
Fredrik Söderquist . resolved

Have a slight reservation against the view+offset callback - I feel that having just the view (of the current/remaining string) might be easier to work with. I can see the argument for that this way may offer more performance benefits though, so I'm fine with it. I guess any future use will dictate improvements.

File third_party/blink/renderer/platform/wtf/text/string_impl.h
Line 1052, Patchset 3 (Latest):// This is not in string_intnernal.h because this should be visible from
Fredrik Söderquist . unresolved

Typo

Open in Gerrit

Related details

Attention is currently required from:
  • Kent Tamura
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: Iae56cd45960fb8293014675fb23a785edf576014
    Gerrit-Change-Number: 7772027
    Gerrit-PatchSet: 3
    Gerrit-Owner: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-Attention: Kent Tamura <tk...@chromium.org>
    Gerrit-Comment-Date: Fri, 17 Apr 2026 09:04:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kent Tamura (Gerrit)

    unread,
    Apr 17, 2026, 8:29:25 PM (12 days ago) Apr 17
    to Kent Tamura, Fredrik Söderquist, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, blink-rev...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org

    Kent Tamura voted and added 1 comment

    Votes added by Kent Tamura

    Auto-Submit+1
    Commit-Queue+2

    1 comment

    File third_party/blink/renderer/platform/wtf/text/string_impl.h
    Line 1052, Patchset 3:// This is not in string_intnernal.h because this should be visible from
    Fredrik Söderquist . resolved

    Typo

    Kent Tamura

    Done

    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: Iae56cd45960fb8293014675fb23a785edf576014
      Gerrit-Change-Number: 7772027
      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-Comment-Date: Sat, 18 Apr 2026 00:28:54 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Fredrik Söderquist <f...@opera.com>
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Apr 17, 2026, 9:29:21 PM (12 days ago) Apr 17
      to Kent Tamura, Fredrik Söderquist, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, blink-rev...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org

      Chromium LUCI CQ submitted the change with unreviewed changes

      Unreviewed changes

      3 is the latest approved patch-set.
      The change was submitted with unreviewed changes in the following files:

      ```
      The name of the file: third_party/blink/renderer/platform/wtf/text/string_impl.h
      Insertions: 1, Deletions: 1.

      @@ -1049,7 +1049,7 @@

      namespace internal {

      -// This is not in string_intnernal.h because this should be visible from
      +// This is not in string_internal.h because this should be visible from
      // wtf_string.h and we don't want to include string_internal.h from
      // wtf_string.h.
      template <typename StringType, typename FinderType, bool allow_empty_entries>
      ```

      Change information

      Commit message:
      WTF: Add String::Split*() methods taking a function predicate

      This change introduces new overloads for `String::Split()` and
      `String::SplitSkippingEmpty()` that accept a `Finder` function. This
      addresses the long-standing TODO comment to refactor
      `SplitOnASCIIWhitespace` into a more general `String::Split(predicate)`
      method.

      The new `Finder` function provides a highly flexible mechanism for
      string splitting, allowing for:

      - Custom separator definitions beyond a single character (e.g.,
      multiple separators like "\\n" and "\\r\\n").
      - Splitting based on arbitrary predicates (e.g., `IsHTMLSpace`).
      - Splitting using zero-length separators to separate individual
      characters.

      As part of this change, `SplitOnASCIIWhitespace()` in
      `html_parser_idioms.cc` is refactored to use the new
      `SplitSkippingEmpty()` method, simplifying its implementation and
      demonstrating the utility of the new generic splitting capabilities.

      This CL should have no behavior changes.
      Change-Id: Iae56cd45960fb8293014675fb23a785edf576014
      Auto-Submit: Kent Tamura <tk...@chromium.org>
      Commit-Queue: Kent Tamura <tk...@chromium.org>
      Reviewed-by: Fredrik Söderquist <f...@opera.com>
      Cr-Commit-Position: refs/heads/main@{#1616984}
      Files:
      • M third_party/blink/renderer/core/html/parser/html_parser_idioms.cc
      • M third_party/blink/renderer/platform/wtf/text/string_impl.h
      • M third_party/blink/renderer/platform/wtf/text/wtf_string.h
      • M third_party/blink/renderer/platform/wtf/text/wtf_string_test.cc
      Change size: M
      Delta: 4 files changed, 154 insertions(+), 20 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: Iae56cd45960fb8293014675fb23a785edf576014
      Gerrit-Change-Number: 7772027
      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>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages