Turn iterator _!=_.end() DCHECK() into CHECK() for services/resource_coordinator [chromium/src : main]

1 view
Skip to first unread message

Alex Gough (Gerrit)

unread,
Jul 14, 2024, 9:38:28 PM (3 days ago) Jul 14
to Alex Gough, Siddhartha S, chromium...@chromium.org, blundell+...@chromium.org, chrome-gr...@chromium.org
Attention needed from Siddhartha S

Message from Alex Gough

Hi everyone - this is generated with `git cl split --max_depth=2`.

This is round two of this effort (and the last major set of CLs)

  • for this weggli query I have removed some matches involving deeper
  • calculations and sites that are nested deeply in loops. Where it looks
  • like a DCHECK is a valid debugging statement I have instead added a
  • comment.

I've run various speedometer runs on a combined version of these CLs
and have not seen any measurable changes.

Open in Gerrit

Related details

Attention is currently required from:
  • Siddhartha S
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • 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: I5cec627c3dd9fcfed34e5c62bb0653a383659f9d
Gerrit-Change-Number: 5706545
Gerrit-PatchSet: 1
Gerrit-Owner: Alex Gough <aj...@chromium.org>
Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
Gerrit-Reviewer: Siddhartha S <ss...@chromium.org>
Gerrit-Attention: Siddhartha S <ss...@chromium.org>
Gerrit-Comment-Date: Mon, 15 Jul 2024 01:38:19 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Siddhartha S (Gerrit)

unread,
Jul 15, 2024, 11:53:34 AM (2 days ago) Jul 15
to Alex Gough, Siddhartha S, chromium...@chromium.org, blundell+...@chromium.org, chrome-gr...@chromium.org
Attention needed from Alex Gough

Siddhartha S voted

Code-Review+1
Commit-Queue+2
Open in Gerrit

Related details

Attention is currently required from:
  • Alex Gough
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • 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: I5cec627c3dd9fcfed34e5c62bb0653a383659f9d
Gerrit-Change-Number: 5706545
Gerrit-PatchSet: 1
Gerrit-Owner: Alex Gough <aj...@chromium.org>
Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
Gerrit-Reviewer: Siddhartha S <ss...@chromium.org>
Gerrit-Attention: Alex Gough <aj...@chromium.org>
Gerrit-Comment-Date: Mon, 15 Jul 2024 15:53:22 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Chromium LUCI CQ (Gerrit)

unread,
Jul 15, 2024, 12:56:04 PM (2 days ago) Jul 15
to Alex Gough, Siddhartha S, chromium...@chromium.org, blundell+...@chromium.org, chrome-gr...@chromium.org

Chromium LUCI CQ submitted the change

Change information

Commit message:
Turn iterator _!=_.end() DCHECK() into CHECK() for services/resource_coordinator

Accessing an invalid iterator can sometimes be a security
issue and these checks are cheap, so upgrade to CHECKs.
Generally these DCHECKS precede a use or erase of the
checked iterator, which if the check is invalid (ie. the
iterator == .end()) is UB.

Added checks are NotFatalUntil::M130.

`base/not_fatal_until.h` is added using tools/add_header.py,
this may result in some main-file (foo.h for foo.cc) headers
being re-sorted to be first as part `git cl format` of this CL.

For this CL instances were located with a weggli query:

```
weggli --verbose=1 --cpp \
'DCHECK(_ != _.end());' \
-p 'DCHECK(_.end() != _);' \
-p 'DCHECK_NE(_, _.end());' \
-p 'DCHECK_NE(_.end(), _);'
```

which should avoid any potentially expensive calculations
of the thing to be matched against .end().

This CL was uploaded by git cl split.

R=ss...@chromium.org
Bug: 351745839
Change-Id: I5cec627c3dd9fcfed34e5c62bb0653a383659f9d
Auto-Submit: Alex Gough <aj...@chromium.org>
Reviewed-by: Siddhartha S <ss...@chromium.org>
Commit-Queue: Siddhartha S <ss...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1327572}
Files:
  • M services/resource_coordinator/memory_instrumentation/coordinator_impl.cc
  • M services/resource_coordinator/public/cpp/memory_instrumentation/client_process_impl.cc
Change size: XS
Delta: 2 files changed, 5 insertions(+), 2 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Siddhartha S
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: I5cec627c3dd9fcfed34e5c62bb0653a383659f9d
Gerrit-Change-Number: 5706545
Gerrit-PatchSet: 2
Gerrit-Owner: Alex Gough <aj...@chromium.org>
Gerrit-Reviewer: Alex Gough <aj...@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