spanification: automatically spanify sandbox/linux/services/credentials.cc [chromium/src : main]

0 views
Skip to first unread message

Yuki Shiino (Gerrit)

unread,
Aug 18, 2025, 9:38:11 PMAug 18
to Keishi Hattori, Yuki Shiino, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
Attention needed from Keishi Hattori

Yuki Shiino voted and added 1 comment

Votes added by Yuki Shiino

Code-Review+1

1 comment

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Yuki Shiino . resolved

@kei...@chromium.org, would you take a look?

Open in Gerrit

Related details

Attention is currently required from:
  • Keishi Hattori
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
Gerrit-Change-Number: 6849760
Gerrit-PatchSet: 5
Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
Gerrit-Attention: Keishi Hattori <kei...@chromium.org>
Gerrit-Comment-Date: Tue, 19 Aug 2025 01:37:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Keishi Hattori (Gerrit)

unread,
Aug 19, 2025, 12:40:00 AMAug 19
to Yuki Shiino, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
Attention needed from Yuki Shiino

Keishi Hattori voted and added 1 comment

Votes added by Keishi Hattori

Code-Review+1

1 comment

Patchset-level comments
Keishi Hattori . resolved

LGTM

Open in Gerrit

Related details

Attention is currently required from:
  • Yuki Shiino
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
    Gerrit-Change-Number: 6849760
    Gerrit-PatchSet: 5
    Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
    Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
    Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
    Gerrit-Attention: Yuki Shiino <yukis...@chromium.org>
    Gerrit-Comment-Date: Tue, 19 Aug 2025 04:39:28 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yuki Shiino (Gerrit)

    unread,
    Aug 19, 2025, 1:04:37 AMAug 19
    to Keishi Hattori, Yuki Shiino, Matthew Denton, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
    Attention needed from Keishi Hattori and Matthew Denton

    Yuki Shiino added 1 comment

    Patchset-level comments
    Yuki Shiino . resolved

    Matthew, would you review this patch as an owner?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Keishi Hattori
    • Matthew Denton
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
    Gerrit-Change-Number: 6849760
    Gerrit-PatchSet: 5
    Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
    Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
    Gerrit-Reviewer: Matthew Denton <mpde...@chromium.org>
    Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
    Gerrit-Attention: Keishi Hattori <kei...@chromium.org>
    Gerrit-Attention: Matthew Denton <mpde...@chromium.org>
    Gerrit-Comment-Date: Tue, 19 Aug 2025 05:04:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Matthew Denton (Gerrit)

    unread,
    Aug 19, 2025, 2:38:11 AMAug 19
    to Keishi Hattori, Yuki Shiino, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
    Attention needed from Keishi Hattori and Yuki Shiino

    Matthew Denton added 1 comment

    File sandbox/linux/services/credentials.cc
    Line 92, Patchset 5 (Latest): void* stack = base::span<char>(stack_buf)
    .subspan(base::SpanificationSizeofForStdArray(stack_buf))
    .data();
    Matthew Denton . unresolved

    This seems very verbose, is there no better way to get a pointer to the "one past the end" of an array?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Keishi Hattori
    • Yuki Shiino
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
      Gerrit-Change-Number: 6849760
      Gerrit-PatchSet: 5
      Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
      Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
      Gerrit-Reviewer: Matthew Denton <mpde...@chromium.org>
      Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
      Gerrit-Attention: Keishi Hattori <kei...@chromium.org>
      Gerrit-Attention: Yuki Shiino <yukis...@chromium.org>
      Gerrit-Comment-Date: Tue, 19 Aug 2025 06:38:05 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Yuki Shiino (Gerrit)

      unread,
      Aug 19, 2025, 3:42:50 AMAug 19
      to Keishi Hattori, Yuki Shiino, Matthew Denton, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
      Attention needed from Keishi Hattori and Matthew Denton

      Yuki Shiino added 2 comments

      Patchset-level comments
      File-level comment, Patchset 6 (Latest):
      Yuki Shiino . resolved

      Thank you for the quick review. I addressed the review comment.

      File sandbox/linux/services/credentials.cc
      Line 92, Patchset 5: void* stack = base::span<char>(stack_buf)
      .subspan(base::SpanificationSizeofForStdArray(stack_buf))
      .data();
      Matthew Denton . unresolved

      This seems very verbose, is there no better way to get a pointer to the "one past the end" of an array?

      Yuki Shiino

      I introduced a helper function. Does this look fine?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Keishi Hattori
      • Matthew Denton
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
        Gerrit-Change-Number: 6849760
        Gerrit-PatchSet: 6
        Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
        Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
        Gerrit-Reviewer: Matthew Denton <mpde...@chromium.org>
        Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
        Gerrit-Attention: Keishi Hattori <kei...@chromium.org>
        Gerrit-Attention: Matthew Denton <mpde...@chromium.org>
        Gerrit-Comment-Date: Tue, 19 Aug 2025 07:42:23 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Matthew Denton <mpde...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Matthew Denton (Gerrit)

        unread,
        Aug 19, 2025, 3:44:00 AMAug 19
        to Keishi Hattori, Yuki Shiino, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
        Attention needed from Keishi Hattori and Yuki Shiino

        Matthew Denton voted and added 1 comment

        Votes added by Matthew Denton

        Code-Review+1

        1 comment

        Patchset-level comments
        Matthew Denton . resolved

        LGTM thanks!

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Keishi Hattori
        • Yuki Shiino
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
          Gerrit-Change-Number: 6849760
          Gerrit-PatchSet: 6
          Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Matthew Denton <mpde...@chromium.org>
          Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
          Gerrit-Attention: Keishi Hattori <kei...@chromium.org>
          Gerrit-Attention: Yuki Shiino <yukis...@chromium.org>
          Gerrit-Comment-Date: Tue, 19 Aug 2025 07:43:50 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Matthew Denton (Gerrit)

          unread,
          Aug 19, 2025, 3:44:16 AMAug 19
          to Keishi Hattori, Yuki Shiino, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
          Attention needed from Yuki Shiino

          Matthew Denton added 1 comment

          File sandbox/linux/services/credentials.cc
          Line 92, Patchset 5: void* stack = base::span<char>(stack_buf)
          .subspan(base::SpanificationSizeofForStdArray(stack_buf))
          .data();
          Matthew Denton . resolved

          This seems very verbose, is there no better way to get a pointer to the "one past the end" of an array?

          Yuki Shiino

          I introduced a helper function. Does this look fine?

          Matthew Denton

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Yuki Shiino
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
          Gerrit-Change-Number: 6849760
          Gerrit-PatchSet: 6
          Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Matthew Denton <mpde...@chromium.org>
          Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
          Gerrit-Attention: Yuki Shiino <yukis...@chromium.org>
          Gerrit-Comment-Date: Tue, 19 Aug 2025 07:44:04 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Yuki Shiino <yukis...@chromium.org>
          Comment-In-Reply-To: Matthew Denton <mpde...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Keishi Hattori (Gerrit)

          unread,
          Aug 19, 2025, 3:44:29 AMAug 19
          to Yuki Shiino, Matthew Denton, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
          Attention needed from Yuki Shiino

          Keishi Hattori voted and added 2 comments

          Votes added by Keishi Hattori

          Code-Review+1

          2 comments

          Patchset-level comments
          Keishi Hattori . resolved

          LGTM

          File base/containers/auto_spanification_helper.h
          Line 96, Patchset 6 (Latest):constexpr ElementMaybeConst* SpanificationEndPtrOf(
          Keishi Hattori . unresolved

          one past the end pointers are scary so it would be nice to have a helper function to make them stand out.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Yuki Shiino
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
          Gerrit-Change-Number: 6849760
          Gerrit-PatchSet: 6
          Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Matthew Denton <mpde...@chromium.org>
          Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
          Gerrit-Attention: Yuki Shiino <yukis...@chromium.org>
          Gerrit-Comment-Date: Tue, 19 Aug 2025 07:44:03 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Matthew Denton (Gerrit)

          unread,
          Aug 19, 2025, 3:46:30 AMAug 19
          to Keishi Hattori, Yuki Shiino, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
          Attention needed from Keishi Hattori and Yuki Shiino

          Matthew Denton added 1 comment

          File base/containers/auto_spanification_helper.h
          Line 96, Patchset 6 (Latest):constexpr ElementMaybeConst* SpanificationEndPtrOf(
          Keishi Hattori . unresolved

          one past the end pointers are scary so it would be nice to have a helper function to make them stand out.

          Matthew Denton

          Perhaps if we don't want this, this particular part of the code could be a good candidate for UNSAFE_BUFFERS() and safety comment since there is really no danger of unsafety here, and the pointer addition is pretty clear.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Keishi Hattori
          • Yuki Shiino
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
          Gerrit-Change-Number: 6849760
          Gerrit-PatchSet: 6
          Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Matthew Denton <mpde...@chromium.org>
          Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
          Gerrit-Attention: Keishi Hattori <kei...@chromium.org>
          Gerrit-Attention: Yuki Shiino <yukis...@chromium.org>
          Gerrit-Comment-Date: Tue, 19 Aug 2025 07:46:22 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Keishi Hattori <kei...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Matthew Denton (Gerrit)

          unread,
          Aug 19, 2025, 3:48:41 AMAug 19
          to Keishi Hattori, Yuki Shiino, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
          Attention needed from Keishi Hattori and Yuki Shiino

          Matthew Denton added 1 comment

          File base/containers/auto_spanification_helper.h
          Line 96, Patchset 6 (Latest):constexpr ElementMaybeConst* SpanificationEndPtrOf(
          Keishi Hattori . unresolved

          one past the end pointers are scary so it would be nice to have a helper function to make them stand out.

          Matthew Denton

          Perhaps if we don't want this, this particular part of the code could be a good candidate for UNSAFE_BUFFERS() and safety comment since there is really no danger of unsafety here, and the pointer addition is pretty clear.

          Matthew Denton

          It could also return a subspan of zero length like the original change was doing, and then we just call data() on that.

          Gerrit-Comment-Date: Tue, 19 Aug 2025 07:48:32 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Keishi Hattori <kei...@chromium.org>
          Comment-In-Reply-To: Matthew Denton <mpde...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Yuki Shiino (Gerrit)

          unread,
          Aug 19, 2025, 4:55:19 AMAug 19
          to Keishi Hattori, Yuki Shiino, Stephen Nusko, Matthew Denton, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
          Attention needed from Keishi Hattori, Matthew Denton and Stephen Nusko

          Yuki Shiino added 2 comments

          Patchset-level comments
          File-level comment, Patchset 7 (Latest):
          Yuki Shiino . resolved

          Thank you both. Would you take another look?

          +R=nuskos@ for owner review of auto_spanification_helper.h.

          File base/containers/auto_spanification_helper.h
          Line 96, Patchset 6:constexpr ElementMaybeConst* SpanificationEndPtrOf(
          Keishi Hattori . unresolved

          one past the end pointers are scary so it would be nice to have a helper function to make them stand out.

          Matthew Denton

          Perhaps if we don't want this, this particular part of the code could be a good candidate for UNSAFE_BUFFERS() and safety comment since there is really no danger of unsafety here, and the pointer addition is pretty clear.

          Matthew Denton

          It could also return a subspan of zero length like the original change was doing, and then we just call data() on that.

          Yuki Shiino

          Would you folks take another look?

          Taking your advice, I annotated the helper functions with UNSAFE_BUFFER_USAGE (which requires UNSAFE_BUFFERS on call sites), and added UNSAFE_BUFFERS to the call site. PRECONDITION: and SAFETY: comments are added, too.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Keishi Hattori
          • Matthew Denton
          • Stephen Nusko
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
          Gerrit-Change-Number: 6849760
          Gerrit-PatchSet: 7
          Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Matthew Denton <mpde...@chromium.org>
          Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
          Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
          Gerrit-Attention: Keishi Hattori <kei...@chromium.org>
          Gerrit-Attention: Matthew Denton <mpde...@chromium.org>
          Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
          Gerrit-Comment-Date: Tue, 19 Aug 2025 08:54:46 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Matthew Denton (Gerrit)

          unread,
          Aug 19, 2025, 5:04:40 PMAug 19
          to Keishi Hattori, Yuki Shiino, Stephen Nusko, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
          Attention needed from Keishi Hattori, Stephen Nusko and Yuki Shiino

          Matthew Denton voted and added 1 comment

          Votes added by Matthew Denton

          Code-Review+1

          1 comment

          File base/containers/auto_spanification_helper.h
          Line 96, Patchset 6:constexpr ElementMaybeConst* SpanificationEndPtrOf(
          Keishi Hattori . unresolved

          one past the end pointers are scary so it would be nice to have a helper function to make them stand out.

          Matthew Denton

          Perhaps if we don't want this, this particular part of the code could be a good candidate for UNSAFE_BUFFERS() and safety comment since there is really no danger of unsafety here, and the pointer addition is pretty clear.

          Matthew Denton

          It could also return a subspan of zero length like the original change was doing, and then we just call data() on that.

          Yuki Shiino

          Would you folks take another look?

          Taking your advice, I annotated the helper functions with UNSAFE_BUFFER_USAGE (which requires UNSAFE_BUFFERS on call sites), and added UNSAFE_BUFFERS to the call site. PRECONDITION: and SAFETY: comments are added, too.

          Matthew Denton

          Thanks, still +1

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Keishi Hattori
          • Stephen Nusko
          • Yuki Shiino
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
          Gerrit-Change-Number: 6849760
          Gerrit-PatchSet: 7
          Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Matthew Denton <mpde...@chromium.org>
          Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
          Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
          Gerrit-Attention: Keishi Hattori <kei...@chromium.org>
          Gerrit-Attention: Yuki Shiino <yukis...@chromium.org>
          Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
          Gerrit-Comment-Date: Tue, 19 Aug 2025 21:04:28 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Keishi Hattori <kei...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Stephen Nusko (Gerrit)

          unread,
          Aug 20, 2025, 12:27:52 AMAug 20
          to Keishi Hattori, Yuki Shiino, Matthew Denton, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
          Attention needed from Keishi Hattori and Yuki Shiino

          Stephen Nusko added 1 comment

          File base/containers/auto_spanification_helper.h
          Line 78, Patchset 7 (Latest):// SpanificationEndPtrOf was introduced temporarily in order to help the auto
          Stephen Nusko . unresolved

          If this is temporary what do we expect people to actually write?

          ```
          // Safety: stack is never referenced?
          void* stack = UNSAFE_BUFFER(stack_buf.data() + stack_buf.size());
          ```

          I see in the other comment chain @kei...@chromium.org was suggesting another function to make it clear, but then we expect that to be the end result no?

          So I think either

          1) We keep the function but remove the mention of temporary and perhaps call it EndPtrOf(), then we expect UNSAFE_BUFFER(EndPtrOf(stack_buf)) with a safety promising it won't be referenced.

          2) We just keep it as UNSAFE_BUFFER(stack_buf.data() + stack_buf.size()) because that is what we expect long term people to write.

          Thoughts? I think we should be consistent and give advice for folks in this scenario.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Keishi Hattori
          • Yuki Shiino
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
          Gerrit-Change-Number: 6849760
          Gerrit-PatchSet: 7
          Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Matthew Denton <mpde...@chromium.org>
          Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
          Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
          Gerrit-Attention: Keishi Hattori <kei...@chromium.org>
          Gerrit-Attention: Yuki Shiino <yukis...@chromium.org>
          Gerrit-Comment-Date: Wed, 20 Aug 2025 04:27:38 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Yuki Shiino (Gerrit)

          unread,
          Aug 20, 2025, 4:35:48 AMAug 20
          to Keishi Hattori, Yuki Shiino, Stephen Nusko, Matthew Denton, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
          Attention needed from Keishi Hattori, Matthew Denton and Stephen Nusko

          Yuki Shiino added 2 comments

          Patchset-level comments
          File-level comment, Patchset 9 (Latest):
          Yuki Shiino . resolved

          The patch became so simple now. Would you take yet another look?

          File base/containers/auto_spanification_helper.h
          Line 78, Patchset 7:// SpanificationEndPtrOf was introduced temporarily in order to help the auto
          Stephen Nusko . unresolved

          If this is temporary what do we expect people to actually write?

          ```
          // Safety: stack is never referenced?
          void* stack = UNSAFE_BUFFER(stack_buf.data() + stack_buf.size());
          ```

          I see in the other comment chain @kei...@chromium.org was suggesting another function to make it clear, but then we expect that to be the end result no?

          So I think either

          1) We keep the function but remove the mention of temporary and perhaps call it EndPtrOf(), then we expect UNSAFE_BUFFER(EndPtrOf(stack_buf)) with a safety promising it won't be referenced.

          2) We just keep it as UNSAFE_BUFFER(stack_buf.data() + stack_buf.size()) because that is what we expect long term people to write.

          Thoughts? I think we should be consistent and give advice for folks in this scenario.

          Yuki Shiino

          I agree that this will be the end state in this specific case. For other cases, we should encourage the use of iterators instead of raw pointers.

          I go with Option 2) UNSAFE_BUFFERS(stack_buf.data() + stack_buf.size()) with a SAFETY: comment.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Keishi Hattori
          • Matthew Denton
          • Stephen Nusko
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
          Gerrit-Change-Number: 6849760
          Gerrit-PatchSet: 9
          Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Matthew Denton <mpde...@chromium.org>
          Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
          Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
          Gerrit-Attention: Keishi Hattori <kei...@chromium.org>
          Gerrit-Attention: Matthew Denton <mpde...@chromium.org>
          Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
          Gerrit-Comment-Date: Wed, 20 Aug 2025 08:35:17 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Stephen Nusko <nus...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Stephen Nusko (Gerrit)

          unread,
          Aug 20, 2025, 4:56:19 AMAug 20
          to Keishi Hattori, Yuki Shiino, Matthew Denton, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
          Attention needed from Keishi Hattori, Matthew Denton and Yuki Shiino

          Stephen Nusko voted and added 1 comment

          Votes added by Stephen Nusko

          Code-Review+1

          1 comment

          File base/containers/auto_spanification_helper.h
          Line 78, Patchset 7:// SpanificationEndPtrOf was introduced temporarily in order to help the auto
          Stephen Nusko . resolved

          If this is temporary what do we expect people to actually write?

          ```
          // Safety: stack is never referenced?
          void* stack = UNSAFE_BUFFER(stack_buf.data() + stack_buf.size());
          ```

          I see in the other comment chain @kei...@chromium.org was suggesting another function to make it clear, but then we expect that to be the end result no?

          So I think either

          1) We keep the function but remove the mention of temporary and perhaps call it EndPtrOf(), then we expect UNSAFE_BUFFER(EndPtrOf(stack_buf)) with a safety promising it won't be referenced.

          2) We just keep it as UNSAFE_BUFFER(stack_buf.data() + stack_buf.size()) because that is what we expect long term people to write.

          Thoughts? I think we should be consistent and give advice for folks in this scenario.

          Yuki Shiino

          I agree that this will be the end state in this specific case. For other cases, we should encourage the use of iterators instead of raw pointers.

          I go with Option 2) UNSAFE_BUFFERS(stack_buf.data() + stack_buf.size()) with a SAFETY: comment.

          Stephen Nusko

          Acknowledged

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Keishi Hattori
          • Matthew Denton
          • Yuki Shiino
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
            Gerrit-Change-Number: 6849760
            Gerrit-PatchSet: 10
            Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
            Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
            Gerrit-Reviewer: Matthew Denton <mpde...@chromium.org>
            Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
            Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
            Gerrit-Attention: Keishi Hattori <kei...@chromium.org>
            Gerrit-Attention: Yuki Shiino <yukis...@chromium.org>
            Gerrit-Attention: Matthew Denton <mpde...@chromium.org>
            Gerrit-Comment-Date: Wed, 20 Aug 2025 08:55:47 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            Comment-In-Reply-To: Yuki Shiino <yukis...@chromium.org>
            Comment-In-Reply-To: Stephen Nusko <nus...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Matthew Denton (Gerrit)

            unread,
            Aug 20, 2025, 2:37:32 PMAug 20
            to Keishi Hattori, Yuki Shiino, Stephen Nusko, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
            Attention needed from Keishi Hattori and Yuki Shiino

            Matthew Denton voted Code-Review+1

            Code-Review+1
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Keishi Hattori
            • Yuki Shiino
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
            Gerrit-Change-Number: 6849760
            Gerrit-PatchSet: 10
            Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
            Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
            Gerrit-Reviewer: Matthew Denton <mpde...@chromium.org>
            Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
            Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
            Gerrit-Attention: Keishi Hattori <kei...@chromium.org>
            Gerrit-Attention: Yuki Shiino <yukis...@chromium.org>
            Gerrit-Comment-Date: Wed, 20 Aug 2025 18:37:22 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Yuki Shiino (Gerrit)

            unread,
            Aug 20, 2025, 9:30:39 PMAug 20
            to Keishi Hattori, Yuki Shiino, Matthew Denton, Stephen Nusko, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
            Attention needed from Keishi Hattori

            Yuki Shiino voted and added 1 comment

            Votes added by Yuki Shiino

            Code-Review+1
            Commit-Queue+2

            1 comment

            Patchset-level comments
            File-level comment, Patchset 10 (Latest):
            Yuki Shiino . resolved

            Thank you for the review.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Keishi Hattori
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
            Gerrit-Change-Number: 6849760
            Gerrit-PatchSet: 10
            Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
            Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
            Gerrit-Reviewer: Matthew Denton <mpde...@chromium.org>
            Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
            Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
            Gerrit-Attention: Keishi Hattori <kei...@chromium.org>
            Gerrit-Comment-Date: Thu, 21 Aug 2025 01:30:01 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Yuki Shiino (Gerrit)

            unread,
            Aug 20, 2025, 9:31:36 PMAug 20
            to Keishi Hattori, Yuki Shiino, Matthew Denton, Stephen Nusko, AyeAye, Chromium LUCI CQ, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org
            Attention needed from Keishi Hattori

            Yuki Shiino voted and added 1 comment

            Votes added by Yuki Shiino

            Commit-Queue+2

            1 comment

            File base/containers/auto_spanification_helper.h
            Line 96, Patchset 6:constexpr ElementMaybeConst* SpanificationEndPtrOf(
            Keishi Hattori . resolved

            one past the end pointers are scary so it would be nice to have a helper function to make them stand out.

            Matthew Denton

            Perhaps if we don't want this, this particular part of the code could be a good candidate for UNSAFE_BUFFERS() and safety comment since there is really no danger of unsafety here, and the pointer addition is pretty clear.

            Matthew Denton

            It could also return a subspan of zero length like the original change was doing, and then we just call data() on that.

            Yuki Shiino

            Would you folks take another look?

            Taking your advice, I annotated the helper functions with UNSAFE_BUFFER_USAGE (which requires UNSAFE_BUFFERS on call sites), and added UNSAFE_BUFFERS to the call site. PRECONDITION: and SAFETY: comments are added, too.

            Matthew Denton

            Thanks, still +1

            Yuki Shiino

            Done

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Keishi Hattori
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
            Gerrit-Change-Number: 6849760
            Gerrit-PatchSet: 10
            Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
            Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
            Gerrit-Reviewer: Matthew Denton <mpde...@chromium.org>
            Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
            Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
            Gerrit-Attention: Keishi Hattori <kei...@chromium.org>
            Gerrit-Comment-Date: Thu, 21 Aug 2025 01:31:06 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            Comment-In-Reply-To: Keishi Hattori <kei...@chromium.org>
            Comment-In-Reply-To: Yuki Shiino <yukis...@chromium.org>
            Comment-In-Reply-To: Matthew Denton <mpde...@chromium.org>
            satisfied_requirement
            open
            diffy

            Chromium LUCI CQ (Gerrit)

            unread,
            Aug 20, 2025, 9:34:14 PMAug 20
            to Keishi Hattori, Yuki Shiino, Matthew Denton, Stephen Nusko, AyeAye, wfh+...@chromium.org, tracing...@chromium.org, spang...@chromium.org, rsesek...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, mpdento...@chromium.org

            Chromium LUCI CQ submitted the change

            Change information

            Commit message:
            spanification: automatically spanify sandbox/linux/services/credentials.cc

            This is the result of running the automatic spanification on linux and
            updating code to use and pass spans where size is known.

            The original patch was fully automated using script:
            //tools/clang/spanify/rewrite-multiple-platforms.sh -platforms=linux
            Then refined with gemini-cli

            gemini-run/batch-run-1755453491/group_100
            Bug: 439964610
            Change-Id: I1a12dbbd008d24b19b2a3728faf283691d94c62a
            Reviewed-by: Matthew Denton <mpde...@chromium.org>
            Reviewed-by: Yuki Shiino <yukis...@chromium.org>
            Reviewed-by: Stephen Nusko <nus...@chromium.org>
            Commit-Queue: Yuki Shiino <yukis...@chromium.org>
            Cr-Commit-Position: refs/heads/main@{#1504325}
            Files:
            • M sandbox/linux/services/credentials.cc
            Change size: S
            Delta: 1 file changed, 5 insertions(+), 8 deletions(-)
            Branch: refs/heads/main
            Submit Requirements:
            • requirement satisfiedCode-Review: +1 by Yuki Shiino, +1 by Matthew Denton, +1 by Stephen Nusko
            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: I1a12dbbd008d24b19b2a3728faf283691d94c62a
            Gerrit-Change-Number: 6849760
            Gerrit-PatchSet: 11
            Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
            Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
            open
            diffy
            satisfied_requirement
            Reply all
            Reply to author
            Forward
            0 new messages