Fix UNSAFE_TODO in process_iterator_win.cc [chromium/src : main]

0 views
Skip to first unread message

David Bienvenu (Gerrit)

unread,
Dec 30, 2025, 2:35:59 PM12/30/25
to Greg Thompson, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Greg Thompson

David Bienvenu added 1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
David Bienvenu . resolved

I'm not sure if EqualsCaseInsensitiveASCII is OK here. Gemini swears up and down that it is even though some non-ascii characters won't be handled correctly, unless the locale is set correctly.

Open in Gerrit

Related details

Attention is currently required from:
  • Greg Thompson
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: I06d9d60d31e5bd747539afcf98c32476bef69edb
Gerrit-Change-Number: 7331427
Gerrit-PatchSet: 3
Gerrit-Owner: David Bienvenu <davidb...@chromium.org>
Gerrit-Reviewer: David Bienvenu <davidb...@chromium.org>
Gerrit-Reviewer: Greg Thompson <g...@chromium.org>
Gerrit-Attention: Greg Thompson <g...@chromium.org>
Gerrit-Comment-Date: Tue, 30 Dec 2025 19:35:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Greg Thompson (Gerrit)

unread,
Jan 5, 2026, 4:06:00 AM (11 days ago) Jan 5
to David Bienvenu, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from David Bienvenu

Greg Thompson added 1 comment

File base/process/process_iterator_win.cc
Line 38, Patchset 3 (Latest): base::span(reinterpret_cast<uint8_t*>(&entry_), sizeof(entry_)));
Greg Thompson . unresolved

this method should operate on the provided `entry` rather than `entry_`.

Open in Gerrit

Related details

Attention is currently required from:
  • David Bienvenu
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: I06d9d60d31e5bd747539afcf98c32476bef69edb
    Gerrit-Change-Number: 7331427
    Gerrit-PatchSet: 3
    Gerrit-Owner: David Bienvenu <davidb...@chromium.org>
    Gerrit-Reviewer: David Bienvenu <davidb...@chromium.org>
    Gerrit-Reviewer: Greg Thompson <g...@chromium.org>
    Gerrit-Attention: David Bienvenu <davidb...@chromium.org>
    Gerrit-Comment-Date: Mon, 05 Jan 2026 09:05:42 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    David Bienvenu (Gerrit)

    unread,
    Jan 5, 2026, 10:32:54 AM (10 days ago) Jan 5
    to Greg Thompson, Chromium LUCI CQ, chromium...@chromium.org
    Attention needed from Greg Thompson

    David Bienvenu added 1 comment

    File base/process/process_iterator_win.cc
    Line 38, Patchset 3: base::span(reinterpret_cast<uint8_t*>(&entry_), sizeof(entry_)));
    Greg Thompson . resolved

    this method should operate on the provided `entry` rather than `entry_`.

    David Bienvenu

    Done. It's tempting to just inline this code into CheckForNextProcess since it's the only caller of InitProcessEntry. wdyt?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Greg Thompson
    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: I06d9d60d31e5bd747539afcf98c32476bef69edb
      Gerrit-Change-Number: 7331427
      Gerrit-PatchSet: 4
      Gerrit-Owner: David Bienvenu <davidb...@chromium.org>
      Gerrit-Reviewer: David Bienvenu <davidb...@chromium.org>
      Gerrit-Reviewer: Greg Thompson <g...@chromium.org>
      Gerrit-Attention: Greg Thompson <g...@chromium.org>
      Gerrit-Comment-Date: Mon, 05 Jan 2026 15:32:44 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Greg Thompson <g...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Greg Thompson (Gerrit)

      unread,
      Jan 6, 2026, 3:22:56 AM (10 days ago) Jan 6
      to David Bienvenu, Chromium LUCI CQ, chromium...@chromium.org
      Attention needed from David Bienvenu

      Greg Thompson added 1 comment

      File base/process/process_iterator_win.cc
      Line 22, Patchset 5 (Latest): InitProcessEntry(&entry_);
      Greg Thompson . unresolved
      how about:
      ```
      entry_ = ProcessEntry{{.dwSize = sizeof(entry_)}};
      ```
      let the language do the job for us rather than fiddle with span stuff.
      Open in Gerrit

      Related details

      Attention is currently required from:
      • David Bienvenu
      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: I06d9d60d31e5bd747539afcf98c32476bef69edb
        Gerrit-Change-Number: 7331427
        Gerrit-PatchSet: 5
        Gerrit-Owner: David Bienvenu <davidb...@chromium.org>
        Gerrit-Reviewer: David Bienvenu <davidb...@chromium.org>
        Gerrit-Reviewer: Greg Thompson <g...@chromium.org>
        Gerrit-Attention: David Bienvenu <davidb...@chromium.org>
        Gerrit-Comment-Date: Tue, 06 Jan 2026 08:22:43 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        David Bienvenu (Gerrit)

        unread,
        Jan 7, 2026, 12:14:53 PM (8 days ago) Jan 7
        to Greg Thompson, Chromium LUCI CQ, chromium...@chromium.org
        Attention needed from Greg Thompson

        David Bienvenu added 2 comments

        Patchset-level comments
        File-level comment, Patchset 6 (Latest):
        David Bienvenu . resolved

        PTAL (and weigh in on the case insensitivity issue for non ascii characters). Thx!

        File base/process/process_iterator_win.cc
        Line 22, Patchset 5: InitProcessEntry(&entry_);
        Greg Thompson . resolved
        how about:
        ```
        entry_ = ProcessEntry{{.dwSize = sizeof(entry_)}};
        ```
        let the language do the job for us rather than fiddle with span stuff.
        David Bienvenu

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Greg Thompson
        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: I06d9d60d31e5bd747539afcf98c32476bef69edb
        Gerrit-Change-Number: 7331427
        Gerrit-PatchSet: 6
        Gerrit-Owner: David Bienvenu <davidb...@chromium.org>
        Gerrit-Reviewer: David Bienvenu <davidb...@chromium.org>
        Gerrit-Reviewer: Greg Thompson <g...@chromium.org>
        Gerrit-Attention: Greg Thompson <g...@chromium.org>
        Gerrit-Comment-Date: Wed, 07 Jan 2026 17:14:41 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Greg Thompson <g...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Greg Thompson (Gerrit)

        unread,
        Jan 8, 2026, 3:51:28 AM (8 days ago) Jan 8
        to David Bienvenu, Chromium LUCI CQ, chromium...@chromium.org
        Attention needed from David Bienvenu

        Greg Thompson added 1 comment

        File base/process/process_iterator_win.cc
        Line 34, Patchset 6 (Latest): return base::EqualsCaseInsensitiveASCII(executable_name_, entry_exe_view) &&
        Greg Thompson . unresolved

        `FilePath::CompareIgnoreCase` seems appropriate since `exe_file()` returns the basename of the file.

        i'd be tempted to change `ProcessEntry::exe_file()` so that it returns a `const FilePath::CharType*` so that the type makes this more explicit.

        if you want to stick with the ASCII comparison, we could change `NamedProcessIterator` so that it requires a US-ASCII `executable_name` arg. i think that's a more intrusive change, though, so i wouldn't really suggest that we actually go that way. as it is, it's not safe to assume that these are ASCII strings.

        (also, not that we don't need `base::` in front of things here.)

        Open in Gerrit

        Related details

        Attention is currently required from:
        • David Bienvenu
        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: I06d9d60d31e5bd747539afcf98c32476bef69edb
          Gerrit-Change-Number: 7331427
          Gerrit-PatchSet: 6
          Gerrit-Owner: David Bienvenu <davidb...@chromium.org>
          Gerrit-Reviewer: David Bienvenu <davidb...@chromium.org>
          Gerrit-Reviewer: Greg Thompson <g...@chromium.org>
          Gerrit-Attention: David Bienvenu <davidb...@chromium.org>
          Gerrit-Comment-Date: Thu, 08 Jan 2026 08:51:15 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          David Bienvenu (Gerrit)

          unread,
          Jan 14, 2026, 4:22:06 PM (yesterday) Jan 14
          to Greg Thompson, Chromium LUCI CQ, chromium...@chromium.org
          Attention needed from Greg Thompson

          David Bienvenu added 2 comments

          David Bienvenu . resolved

          PTAL

          File base/process/process_iterator_win.cc
          Line 34, Patchset 6: return base::EqualsCaseInsensitiveASCII(executable_name_, entry_exe_view) &&
          Greg Thompson . resolved

          `FilePath::CompareIgnoreCase` seems appropriate since `exe_file()` returns the basename of the file.

          i'd be tempted to change `ProcessEntry::exe_file()` so that it returns a `const FilePath::CharType*` so that the type makes this more explicit.

          if you want to stick with the ASCII comparison, we could change `NamedProcessIterator` so that it requires a US-ASCII `executable_name` arg. i think that's a more intrusive change, though, so i wouldn't really suggest that we actually go that way. as it is, it's not safe to assume that these are ASCII strings.

          (also, not that we don't need `base::` in front of things here.)

          David Bienvenu

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Greg Thompson
          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: I06d9d60d31e5bd747539afcf98c32476bef69edb
            Gerrit-Change-Number: 7331427
            Gerrit-PatchSet: 7
            Gerrit-Owner: David Bienvenu <davidb...@chromium.org>
            Gerrit-Reviewer: David Bienvenu <davidb...@chromium.org>
            Gerrit-Reviewer: Greg Thompson <g...@chromium.org>
            Gerrit-Attention: Greg Thompson <g...@chromium.org>
            Gerrit-Comment-Date: Wed, 14 Jan 2026 21:21:55 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Greg Thompson <g...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Greg Thompson (Gerrit)

            unread,
            3:28 AM (17 hours ago) 3:28 AM
            to David Bienvenu, Francois Pierre Doray, Chromium LUCI CQ, chromium...@chromium.org
            Attention needed from David Bienvenu and Francois Pierre Doray

            Greg Thompson voted and added 3 comments

            Votes added by Greg Thompson

            Code-Review+1

            3 comments

            Patchset-level comments
            File-level comment, Patchset 8 (Latest):
            Greg Thompson . resolved

            lgtm w/ two optional suggestions.

            @fdo...@chromium.org: //base/OWNERS stamp, please.

            File base/process/process_iterator_win.cc
            Line 31, Patchset 8 (Latest): std::wstring_view entry_exe_view(entry().exe_file());
            Greg Thompson . unresolved

            make this `FilePath::StringViewType` while you're at it? :-)

            (no good deed goes unpunished...)

            Line 33, Patchset 8 (Latest): return FilePath::CompareIgnoreCase(executable_name_, entry_exe_view) == 0 &&
            Greg Thompson . unresolved

            nit: `FilePath::CompareEqualIgnoreCase(executable_name_, entry_exe_view)` rather than reimplement it here?

            Open in Gerrit

            Related details

            Attention is currently required from:
            • David Bienvenu
            • Francois Pierre Doray
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not 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: I06d9d60d31e5bd747539afcf98c32476bef69edb
              Gerrit-Change-Number: 7331427
              Gerrit-PatchSet: 8
              Gerrit-Owner: David Bienvenu <davidb...@chromium.org>
              Gerrit-Reviewer: David Bienvenu <davidb...@chromium.org>
              Gerrit-Reviewer: Francois Pierre Doray <fdo...@chromium.org>
              Gerrit-Reviewer: Greg Thompson <g...@chromium.org>
              Gerrit-Attention: David Bienvenu <davidb...@chromium.org>
              Gerrit-Attention: Francois Pierre Doray <fdo...@chromium.org>
              Gerrit-Comment-Date: Thu, 15 Jan 2026 08:27:43 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              David Bienvenu (Gerrit)

              unread,
              6:26 PM (2 hours ago) 6:26 PM
              to Francois Pierre Doray, Greg Thompson, Chromium LUCI CQ, chromium...@chromium.org
              Attention needed from Francois Pierre Doray

              David Bienvenu added 2 comments

              File base/process/process_iterator_win.cc
              Line 31, Patchset 8: std::wstring_view entry_exe_view(entry().exe_file());
              Greg Thompson . resolved

              make this `FilePath::StringViewType` while you're at it? :-)

              (no good deed goes unpunished...)

              David Bienvenu

              Done

              Line 33, Patchset 8: return FilePath::CompareIgnoreCase(executable_name_, entry_exe_view) == 0 &&
              Greg Thompson . resolved

              nit: `FilePath::CompareEqualIgnoreCase(executable_name_, entry_exe_view)` rather than reimplement it here?

              David Bienvenu

              Done

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Francois Pierre Doray
              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: I06d9d60d31e5bd747539afcf98c32476bef69edb
                Gerrit-Change-Number: 7331427
                Gerrit-PatchSet: 8
                Gerrit-Owner: David Bienvenu <davidb...@chromium.org>
                Gerrit-Reviewer: David Bienvenu <davidb...@chromium.org>
                Gerrit-Reviewer: Francois Pierre Doray <fdo...@chromium.org>
                Gerrit-Reviewer: Greg Thompson <g...@chromium.org>
                Gerrit-Attention: Francois Pierre Doray <fdo...@chromium.org>
                Gerrit-Comment-Date: Thu, 15 Jan 2026 23:25:51 +0000
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy
                Reply all
                Reply to author
                Forward
                0 new messages