Begin converting code to use base's string_view helpers. [chromium/src : main]

0 views
Skip to first unread message

Tom Sepez (Gerrit)

unread,
Nov 20, 2025, 6:11:36 PM (2 days ago) Nov 20
to Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Andrew Rayskiy, Kentaro Hara, Raphael Kubo da Costa, Stephen Chenney, Simon Hangl, asvitki...@chromium.org, blink-revie...@chromium.org, blink-reviews-p...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, bnc+...@chromium.org, cc-...@chromium.org, chromiumme...@microsoft.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, geoffla...@chromium.org, hayato...@chromium.org, jshin...@chromium.org, kinuko...@chromium.org, net-r...@chromium.org, ricea...@chromium.org, rmcelra...@chromium.org, security-...@chromium.org, twifka...@chromium.org
Attention needed from Daniel Cheng

Tom Sepez added 6 comments

File base/base64.cc
Line 85, Patchset 4: RemoveChars(input, base::as_string_view(kInfraAsciiWhitespace),
Daniel Cheng . resolved

I'm fine with this as a straighforward conversion, but it seems like there's some future room for simplification, e.g. can't this just be `RemoveChars(input, kInfraAsciiWhitespace))`?

Tom Sepez

Yeah, removeChars should take a span of chars as its second arg. Later.

File base/strings/string_slice.h
Line 92, Patchset 4: // Note 1: using as_string_view() or span() can cause issues with constexpr
Daniel Cheng . resolved

Nit: remove this

Tom Sepez

Done

File components/crx_file/id_util.cc
Line 63, Patchset 4: base::as_string_view(base::as_byte_span(new_path.value()));
Daniel Cheng . resolved

... this is extremely suspect and seems like this should just be passing around a byte span.

Maybe we can just fix `GenerateId()` in this CL?

Tom Sepez

Split into separate CL.

File components/signin/public/base/session_binding_utils.cc
Line 58, Patchset 4: return Base64UrlEncode(base::as_string_view(data));
Daniel Cheng . resolved

Maybe this should just pass a byte span through to line 50?

Tom Sepez

Done. Actually just calls alternate API in same manner as 52

File components/webrtc/fake_ssl_client_socket.cc
Line 89, Patchset 4: return base::as_string_view(kSslClientHello);
Daniel Cheng . resolved

I guess this is fine, but I have to admit that the overlap between `base::as_string_view()` and `base::MakeStringViewWithNulChars()` doesn't seem the best; should we be trying to fix that at some point?

Tom Sepez

Yeah, not sure what the right thing is. Note that WithNulChars omits trailing nul.

File gpu/command_buffer/service/passthrough_program_cache.cc
Line 165, Patchset 4: auto key_string = base::as_string_view(key);
auto value_string = base::as_string_view(value);
Daniel Cheng . resolved

Do we need these at all?

Tom Sepez

Nope.

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
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: I601ffa3337106a5b521596d3047daf29f4808f36
Gerrit-Change-Number: 7136975
Gerrit-PatchSet: 8
Gerrit-Owner: Tom Sepez <tse...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
Gerrit-CC: Andrew Rayskiy <green...@google.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-CC: Simon Hangl <sim...@google.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Thu, 20 Nov 2025 23:11:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniel Cheng (Gerrit)

unread,
Nov 21, 2025, 1:05:58 PM (yesterday) Nov 21
to Tom Sepez, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Andrew Rayskiy, Kentaro Hara, Raphael Kubo da Costa, Stephen Chenney, Simon Hangl, asvitki...@chromium.org, blink-revie...@chromium.org, blink-reviews-p...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, bnc+...@chromium.org, cc-...@chromium.org, chromiumme...@microsoft.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, geoffla...@chromium.org, hayato...@chromium.org, jshin...@chromium.org, kinuko...@chromium.org, net-r...@chromium.org, ricea...@chromium.org, rmcelra...@chromium.org, security-...@chromium.org, twifka...@chromium.org
Attention needed from Tom Sepez

Daniel Cheng voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Tom Sepez
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I601ffa3337106a5b521596d3047daf29f4808f36
    Gerrit-Change-Number: 7136975
    Gerrit-PatchSet: 9
    Gerrit-Owner: Tom Sepez <tse...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
    Gerrit-CC: Andrew Rayskiy <green...@google.com>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Simon Hangl <sim...@google.com>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-Attention: Tom Sepez <tse...@chromium.org>
    Gerrit-Comment-Date: Fri, 21 Nov 2025 18:05:37 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Cheng (Gerrit)

    unread,
    Nov 21, 2025, 1:06:01 PM (yesterday) Nov 21
    to Tom Sepez, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Andrew Rayskiy, Kentaro Hara, Raphael Kubo da Costa, Stephen Chenney, Simon Hangl, asvitki...@chromium.org, blink-revie...@chromium.org, blink-reviews-p...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, bnc+...@chromium.org, cc-...@chromium.org, chromiumme...@microsoft.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, geoffla...@chromium.org, hayato...@chromium.org, jshin...@chromium.org, kinuko...@chromium.org, net-r...@chromium.org, ricea...@chromium.org, rmcelra...@chromium.org, security-...@chromium.org, twifka...@chromium.org
    Attention needed from Tom Sepez

    Daniel Cheng voted Mega-CQ+1

    Mega-CQ+1
    Gerrit-Comment-Date: Fri, 21 Nov 2025 18:05:50 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages