Add method to retrieve or compute SHA256 hash of blink::ParkableString [chromium/src : main]

0 views
Skip to first unread message

Takashi Nakayama (Gerrit)

unread,
Mar 2, 2026, 12:05:04 AM (11 days ago) Mar 2
to Hiroshige Hayashizaki, Leszek Swirski, Benoit Lize, Kouhei Ueno, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, gavinp...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, loading-re...@chromium.org, loading...@chromium.org
Attention needed from Benoit Lize, Hiroshige Hayashizaki, Kouhei Ueno and Leszek Swirski

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Benoit Lize
  • Hiroshige Hayashizaki
  • Kouhei Ueno
  • Leszek Swirski
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: Id6808923ee06bd5fd28a1b717908fadd6e2097a1
Gerrit-Change-Number: 7621772
Gerrit-PatchSet: 4
Gerrit-Owner: Takashi Nakayama <tn...@chromium.org>
Gerrit-Reviewer: Benoit Lize <li...@chromium.org>
Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
Gerrit-Reviewer: Kouhei Ueno <kou...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Takashi Nakayama <tn...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Benoit Lize <li...@chromium.org>
Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
Gerrit-Attention: Kouhei Ueno <kou...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Mon, 02 Mar 2026 05:04:29 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Hiroshige Hayashizaki (Gerrit)

unread,
Mar 3, 2026, 7:13:09 PM (9 days ago) Mar 3
to Takashi Nakayama, Leszek Swirski, Benoit Lize, Kouhei Ueno, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, gavinp...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, loading-re...@chromium.org, loading...@chromium.org
Attention needed from Benoit Lize, Kouhei Ueno, Leszek Swirski and Takashi Nakayama

Hiroshige Hayashizaki added 6 comments

File third_party/blink/renderer/platform/bindings/parkable_string.h
Line 418, Patchset 6 (Latest): // The lifetime of a returning value is the same as that of `this`.
Hiroshige Hayashizaki . unresolved

nit: "The returned `DigestHolder` shouldn't outlive `this`." is clearer.

i.e. The lifetime of a returning value SHOULD BE the same as (OR LESS THAN) that of `this`.

Line 413, Patchset 6 (Latest): std::variant<raw_ptr<const SecureStringDigest>,
Hiroshige Hayashizaki . unresolved

`raw_ref` if this is always non-null?

Line 392, Patchset 6 (Latest): // A reference wrapper to hold the digest of a string.
Hiroshige Hayashizaki . unresolved

Could you elaborate a little more why this is needed and how to use `DigestHolder`?
e.g.

```
`DigestHolder` is to (possibly) keep-alive its underlying temporary
`SecureStringDigest`, so use the result of `DigestHolder.Get()` while its
`DigestHolder` is alive.

Also `DigestHolder` shouldn't outlive its `ParableString`.
```

Line 45, Patchset 6 (Latest):inline constexpr size_t kStringDigestSize = 32; // SHA256.
Hiroshige Hayashizaki . unresolved

Could you split the mechanical renaming of `ParkableStringImpl::SecureDigest` into a separate preparational CL? That will make the codereview much easier.

Line 45, Patchset 6 (Latest):inline constexpr size_t kStringDigestSize = 32; // SHA256.
Hiroshige Hayashizaki . unresolved

I felt perhaps this name is too broad (especially because this is in the global `blink` namespace), but I'll defer to bindings owners.
If we want to have these in `blink::` namespace, it's helpful to have comments to explain what are these and when to use them.

I'm wondering if it's sufficient to move these to `ParkableString::kDigestSize` / `ParkableString::SecureDigest` (if the primary motivation is to avoid references to `ParkableStringImpl`).

Open in Gerrit

Related details

Attention is currently required from:
  • Benoit Lize
  • Kouhei Ueno
  • Leszek Swirski
  • Takashi Nakayama
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: Id6808923ee06bd5fd28a1b717908fadd6e2097a1
    Gerrit-Change-Number: 7621772
    Gerrit-PatchSet: 6
    Gerrit-Owner: Takashi Nakayama <tn...@chromium.org>
    Gerrit-Reviewer: Benoit Lize <li...@chromium.org>
    Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Reviewer: Kouhei Ueno <kou...@chromium.org>
    Gerrit-Reviewer: Takashi Nakayama <tn...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Leszek Swirski <les...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Benoit Lize <li...@chromium.org>
    Gerrit-Attention: Takashi Nakayama <tn...@chromium.org>
    Gerrit-Attention: Kouhei Ueno <kou...@chromium.org>
    Gerrit-Attention: Leszek Swirski <les...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Mar 2026 00:13:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Greg Thompson (Gerrit)

    unread,
    Mar 4, 2026, 2:51:52 AM (9 days ago) Mar 4
    to Takashi Nakayama, Leszek Swirski, Hiroshige Hayashizaki, Benoit Lize, Kouhei Ueno, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, gavinp...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, loading-re...@chromium.org, loading...@chromium.org
    Attention needed from Benoit Lize, Kouhei Ueno, Leszek Swirski and Takashi Nakayama

    Greg Thompson added 1 comment

    File third_party/blink/renderer/platform/bindings/parkable_string.h
    Line 45, Patchset 6 (Latest):inline constexpr size_t kStringDigestSize = 32; // SHA256.
    Greg Thompson . unresolved

    Can we call this what it is -- `kSha256Size`? Or are you trying to leave room to change the algorithm without needing to rename this constant?

    Gerrit-CC: Greg Thompson <g...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Leszek Swirski <les...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Benoit Lize <li...@chromium.org>
    Gerrit-Attention: Takashi Nakayama <tn...@chromium.org>
    Gerrit-Attention: Kouhei Ueno <kou...@chromium.org>
    Gerrit-Attention: Leszek Swirski <les...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Mar 2026 07:51:32 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Cheng (Gerrit)

    unread,
    Mar 4, 2026, 2:57:33 AM (9 days ago) Mar 4
    to Takashi Nakayama, Daniel Cheng, Greg Thompson, Leszek Swirski, Hiroshige Hayashizaki, Benoit Lize, Kouhei Ueno, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, gavinp...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, loading-re...@chromium.org, loading...@chromium.org
    Attention needed from Benoit Lize, Kouhei Ueno, Leszek Swirski and Takashi Nakayama

    Daniel Cheng added 1 comment

    File third_party/blink/renderer/platform/bindings/parkable_string.h
    Line 77, Patchset 6 (Latest): static std::unique_ptr<SecureStringDigest> HashString(StringImpl* string);
    Daniel Cheng . unresolved

    This is pre-existing but it's kind of awkward to use std::unique_ptr<Vector<...>> here... seems like we'd be better off just returning a std::array<uint8_t, 32>.

    The `std::array<...>` costs 128 bits and can probably be passed in two registers.

    `std::unique_ptr` + `Vector` means two indirections through the heap and (presumably) two words of overhead for storing the BRP refcount... so at this point we're already strictly worse than passing the std::array directly...

    Gerrit-CC: Daniel Cheng <dch...@chromium.org>
    Gerrit-CC: Greg Thompson <g...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Leszek Swirski <les...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Benoit Lize <li...@chromium.org>
    Gerrit-Attention: Takashi Nakayama <tn...@chromium.org>
    Gerrit-Attention: Kouhei Ueno <kou...@chromium.org>
    Gerrit-Attention: Leszek Swirski <les...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Mar 2026 07:57:22 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Takashi Nakayama (Gerrit)

    unread,
    Mar 8, 2026, 10:08:39 PM (4 days ago) Mar 8
    to Daniel Cheng, Greg Thompson, Leszek Swirski, Hiroshige Hayashizaki, Benoit Lize, Kouhei Ueno, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, gavinp...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, loading-re...@chromium.org, loading...@chromium.org
    Attention needed from Benoit Lize, Daniel Cheng, Greg Thompson, Hiroshige Hayashizaki, Kouhei Ueno and Leszek Swirski

    Takashi Nakayama added 7 comments

    File third_party/blink/renderer/platform/bindings/parkable_string.h
    Line 418, Patchset 6: // The lifetime of a returning value is the same as that of `this`.
    Hiroshige Hayashizaki . resolved

    nit: "The returned `DigestHolder` shouldn't outlive `this`." is clearer.

    i.e. The lifetime of a returning value SHOULD BE the same as (OR LESS THAN) that of `this`.

    Takashi Nakayama

    Done. Thanks!

    Line 413, Patchset 6: std::variant<raw_ptr<const SecureStringDigest>,
    Hiroshige Hayashizaki . resolved

    `raw_ref` if this is always non-null?

    Takashi Nakayama

    I want to keep this `raw_ptr` because using `raw_ref` here needs a lot of boilerplate code. Let's chat offline if you want further examples.

    Line 407, Patchset 6: DCHECK(digest);
    Hiroshige Hayashizaki . resolved
    Takashi Nakayama

    Done

    Line 392, Patchset 6: // A reference wrapper to hold the digest of a string.
    Hiroshige Hayashizaki . unresolved

    Could you elaborate a little more why this is needed and how to use `DigestHolder`?
    e.g.

    ```
    `DigestHolder` is to (possibly) keep-alive its underlying temporary
    `SecureStringDigest`, so use the result of `DigestHolder.Get()` while its
    `DigestHolder` is alive.

    Also `DigestHolder` shouldn't outlive its `ParableString`.
    ```

    Takashi Nakayama

    Updated. PTAL.

    Line 77, Patchset 6: static std::unique_ptr<SecureStringDigest> HashString(StringImpl* string);
    Daniel Cheng . resolved

    This is pre-existing but it's kind of awkward to use std::unique_ptr<Vector<...>> here... seems like we'd be better off just returning a std::array<uint8_t, 32>.

    The `std::array<...>` costs 128 bits and can probably be passed in two registers.

    `std::unique_ptr` + `Vector` means two indirections through the heap and (presumably) two words of overhead for storing the BRP refcount... so at this point we're already strictly worse than passing the std::array directly...

    Takashi Nakayama

    Acknowledged, but let me do that in a separate CL.

    Line 45, Patchset 6:inline constexpr size_t kStringDigestSize = 32; // SHA256.
    Greg Thompson . resolved

    Can we call this what it is -- `kSha256Size`? Or are you trying to leave room to change the algorithm without needing to rename this constant?

    Takashi Nakayama

    Renamed to `kSha256Bytes`. Thanks!

    Line 45, Patchset 6:inline constexpr size_t kStringDigestSize = 32; // SHA256.
    Hiroshige Hayashizaki . unresolved

    I felt perhaps this name is too broad (especially because this is in the global `blink` namespace), but I'll defer to bindings owners.
    If we want to have these in `blink::` namespace, it's helpful to have comments to explain what are these and when to use them.

    I'm wondering if it's sufficient to move these to `ParkableString::kDigestSize` / `ParkableString::SecureDigest` (if the primary motivation is to avoid references to `ParkableStringImpl`).

    Takashi Nakayama

    Let me keep this as is because I feel like `SecureStringDigest` is a general concept unlimited to `ParkableString` while it is only used by `ParkableString` currently. I added a TODO comment about this. PTAL.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Benoit Lize
    • Daniel Cheng
    • Greg Thompson
    • Hiroshige Hayashizaki
    • Kouhei Ueno
    • Leszek Swirski
    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: Id6808923ee06bd5fd28a1b717908fadd6e2097a1
    Gerrit-Change-Number: 7621772
    Gerrit-PatchSet: 7
    Gerrit-Owner: Takashi Nakayama <tn...@chromium.org>
    Gerrit-Reviewer: Benoit Lize <li...@chromium.org>
    Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Reviewer: Kouhei Ueno <kou...@chromium.org>
    Gerrit-Reviewer: Takashi Nakayama <tn...@chromium.org>
    Gerrit-CC: Daniel Cheng <dch...@chromium.org>
    Gerrit-CC: Greg Thompson <g...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Leszek Swirski <les...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Benoit Lize <li...@chromium.org>
    Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Attention: Kouhei Ueno <kou...@chromium.org>
    Gerrit-Attention: Greg Thompson <g...@chromium.org>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Attention: Leszek Swirski <les...@chromium.org>
    Gerrit-Comment-Date: Mon, 09 Mar 2026 02:08:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Hiroshige Hayashizaki <hiro...@chromium.org>
    Comment-In-Reply-To: Greg Thompson <g...@chromium.org>
    Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Greg Thompson (Gerrit)

    unread,
    Mar 9, 2026, 5:50:48 AM (4 days ago) Mar 9
    to Takashi Nakayama, Daniel Cheng, Leszek Swirski, Hiroshige Hayashizaki, Benoit Lize, Kouhei Ueno, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, gavinp...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, loading-re...@chromium.org, loading...@chromium.org
    Attention needed from Benoit Lize, Daniel Cheng, Hiroshige Hayashizaki, Kouhei Ueno, Leszek Swirski and Takashi Nakayama

    Greg Thompson added 1 comment

    File third_party/blink/renderer/platform/bindings/parkable_string.h
    Line 418, Patchset 6: // The lifetime of a returning value is the same as that of `this`.
    Hiroshige Hayashizaki . unresolved

    nit: "The returned `DigestHolder` shouldn't outlive `this`." is clearer.

    i.e. The lifetime of a returning value SHOULD BE the same as (OR LESS THAN) that of `this`.

    Takashi Nakayama

    Done. Thanks!

    Greg Thompson
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Benoit Lize
    • Daniel Cheng
    • Hiroshige Hayashizaki
    • Kouhei Ueno
    • Leszek Swirski
    • Takashi Nakayama
    Gerrit-Attention: Takashi Nakayama <tn...@chromium.org>
    Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Attention: Kouhei Ueno <kou...@chromium.org>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Attention: Leszek Swirski <les...@chromium.org>
    Gerrit-Comment-Date: Mon, 09 Mar 2026 09:50:32 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Takashi Nakayama <tn...@chromium.org>
    Comment-In-Reply-To: Hiroshige Hayashizaki <hiro...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Hiroshige Hayashizaki (Gerrit)

    unread,
    Mar 9, 2026, 5:30:43 PM (3 days ago) Mar 9
    to Takashi Nakayama, Daniel Cheng, Greg Thompson, Leszek Swirski, Benoit Lize, Kouhei Ueno, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, gavinp...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, loading-re...@chromium.org, loading...@chromium.org
    Attention needed from Benoit Lize, Kouhei Ueno, Leszek Swirski and Takashi Nakayama

    Hiroshige Hayashizaki added 2 comments

    File third_party/blink/renderer/platform/bindings/parkable_string.h
    Line 392, Patchset 6: // A reference wrapper to hold the digest of a string.
    Hiroshige Hayashizaki . resolved

    Could you elaborate a little more why this is needed and how to use `DigestHolder`?
    e.g.

    ```
    `DigestHolder` is to (possibly) keep-alive its underlying temporary
    `SecureStringDigest`, so use the result of `DigestHolder.Get()` while its
    `DigestHolder` is alive.

    Also `DigestHolder` shouldn't outlive its `ParableString`.
    ```

    Takashi Nakayama

    Updated. PTAL.

    Hiroshige Hayashizaki

    Done

    Line 45, Patchset 6:inline constexpr size_t kStringDigestSize = 32; // SHA256.
    Hiroshige Hayashizaki . unresolved

    I felt perhaps this name is too broad (especially because this is in the global `blink` namespace), but I'll defer to bindings owners.
    If we want to have these in `blink::` namespace, it's helpful to have comments to explain what are these and when to use them.

    I'm wondering if it's sufficient to move these to `ParkableString::kDigestSize` / `ParkableString::SecureDigest` (if the primary motivation is to avoid references to `ParkableStringImpl`).

    Takashi Nakayama

    Let me keep this as is because I feel like `SecureStringDigest` is a general concept unlimited to `ParkableString` while it is only used by `ParkableString` currently. I added a TODO comment about this. PTAL.

    Hiroshige Hayashizaki

    OK, then, could you add a comment to explain the "general concept"?
    e.g. what this is, where we (should) use this, that we use SHA256 and why.
    A brief/simple comment should be sufficient.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Benoit Lize
    Gerrit-Attention: Kouhei Ueno <kou...@chromium.org>
    Gerrit-Attention: Leszek Swirski <les...@chromium.org>
    Gerrit-Comment-Date: Mon, 09 Mar 2026 21:30:08 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Takashi Nakayama (Gerrit)

    unread,
    Mar 11, 2026, 9:12:00 PM (24 hours ago) Mar 11
    to Daniel Cheng, Greg Thompson, Leszek Swirski, Hiroshige Hayashizaki, Benoit Lize, Kouhei Ueno, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, gavinp...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, loading-re...@chromium.org, loading...@chromium.org
    Attention needed from Benoit Lize, Greg Thompson, Hiroshige Hayashizaki, Kouhei Ueno and Leszek Swirski

    Takashi Nakayama added 3 comments

    File third_party/blink/renderer/platform/bindings/parkable_string.h
    Line 418, Patchset 6: // The lifetime of a returning value is the same as that of `this`.
    Hiroshige Hayashizaki . resolved

    nit: "The returned `DigestHolder` shouldn't outlive `this`." is clearer.

    i.e. The lifetime of a returning value SHOULD BE the same as (OR LESS THAN) that of `this`.

    Takashi Nakayama

    Done. Thanks!

    Greg Thompson
    how about:
    ```
    [[nodiscard]] DigestHolder Digest() const LIFETIME_BOUND;
    ```
    (https://source.chromium.org/chromium/chromium/src/+/main:base/compiler_specific.h;drc=339cdcedfbf02c8178c399c13a9f1b4188a1164e;l=742)
    Takashi Nakayama

    I didn't know I could use the chromium version of `[[clang::lifetimebound]]`!! I added it to `ParkableString::Digest()` and `DigestHolder::Get()`.

    Line 45, Patchset 6:inline constexpr size_t kStringDigestSize = 32; // SHA256.
    Hiroshige Hayashizaki . resolved

    I felt perhaps this name is too broad (especially because this is in the global `blink` namespace), but I'll defer to bindings owners.
    If we want to have these in `blink::` namespace, it's helpful to have comments to explain what are these and when to use them.

    I'm wondering if it's sufficient to move these to `ParkableString::kDigestSize` / `ParkableString::SecureDigest` (if the primary motivation is to avoid references to `ParkableStringImpl`).

    Takashi Nakayama

    Let me keep this as is because I feel like `SecureStringDigest` is a general concept unlimited to `ParkableString` while it is only used by `ParkableString` currently. I added a TODO comment about this. PTAL.

    Hiroshige Hayashizaki

    OK, then, could you add a comment to explain the "general concept"?
    e.g. what this is, where we (should) use this, that we use SHA256 and why.
    A brief/simple comment should be sufficient.

    Takashi Nakayama

    Done

    Line 45, Patchset 6:inline constexpr size_t kStringDigestSize = 32; // SHA256.
    Hiroshige Hayashizaki . resolved

    Could you split the mechanical renaming of `ParkableStringImpl::SecureDigest` into a separate preparational CL? That will make the codereview much easier.

    Takashi Nakayama

    Separated CL (crrev.com/c/7656343).

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Benoit Lize
    • Greg Thompson
    • Hiroshige Hayashizaki
    • Kouhei Ueno
    • Leszek Swirski
      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: Id6808923ee06bd5fd28a1b717908fadd6e2097a1
        Gerrit-Change-Number: 7621772
        Gerrit-PatchSet: 10
        Gerrit-Owner: Takashi Nakayama <tn...@chromium.org>
        Gerrit-Reviewer: Benoit Lize <li...@chromium.org>
        Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
        Gerrit-Reviewer: Kouhei Ueno <kou...@chromium.org>
        Gerrit-Reviewer: Takashi Nakayama <tn...@chromium.org>
        Gerrit-CC: Daniel Cheng <dch...@chromium.org>
        Gerrit-CC: Greg Thompson <g...@chromium.org>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Leszek Swirski <les...@chromium.org>
        Gerrit-CC: Nate Chapin <jap...@chromium.org>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Attention: Benoit Lize <li...@chromium.org>
        Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
        Gerrit-Attention: Kouhei Ueno <kou...@chromium.org>
        Gerrit-Attention: Greg Thompson <g...@chromium.org>
        Gerrit-Attention: Leszek Swirski <les...@chromium.org>
        Gerrit-Comment-Date: Thu, 12 Mar 2026 01:11:34 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Takashi Nakayama <tn...@chromium.org>
        Comment-In-Reply-To: Hiroshige Hayashizaki <hiro...@chromium.org>
        Comment-In-Reply-To: Greg Thompson <g...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages