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

0 views
Skip to first unread message

Alex Gough (Gerrit)

unread,
Jul 9, 2024, 1:14:29 PM (8 days ago) Jul 9
to Alex Gough, Dale Curtis, Elly FJ, Miguel Casas-Sanchez, Rijubrata Bhaumik, Ken Rockot, Steven Valdez, chromium...@chromium.org, Raphael Kubo Da Costa, Wanming Lin, blundell+...@chromium.org, chrome-gr...@chromium.org, chrome-intell...@chromium.org, marinacio...@chromium.org, mattreyno...@chromium.org, mbarowsky+watc...@chromium.org, network-ser...@chromium.org, odejesu...@chromium.org, olka+...@chromium.org, zhangwen...@google.com
Attention needed from Dale Curtis, Elly FJ, Ken Rockot, Miguel Casas-Sanchez, Rijubrata Bhaumik and Steven Valdez

Message from Alex Gough

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

Apologies if you received an earlier not-working version of this
change - a rebase confused my tool - I've reviewed the whole
diff pre-split and think the same problem hasn't recurred.

I've run various speedometer runs on this and have not seen
any measurable changes - the search used to prime this change
shouldn't have picked any expensive-seeming calculations as
it just looks for a variable being compared to an .end().

Open in Gerrit

Related details

Attention is currently required from:
  • Dale Curtis
  • Elly FJ
  • Ken Rockot
  • Miguel Casas-Sanchez
  • Rijubrata Bhaumik
  • Steven Valdez
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: Ief7d7d9c3745201c243ea72b6d4737ea35cfb1ff
Gerrit-Change-Number: 5689265
Gerrit-PatchSet: 1
Gerrit-Owner: Alex Gough <aj...@chromium.org>
Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Elly FJ <elly...@chromium.org>
Gerrit-Reviewer: Ken Rockot <roc...@google.com>
Gerrit-Reviewer: Miguel Casas-Sanchez <mca...@chromium.org>
Gerrit-Reviewer: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-Reviewer: Steven Valdez <sva...@chromium.org>
Gerrit-CC: Raphael Kubo Da Costa <raphael.ku...@intel.com>
Gerrit-CC: Wanming Lin <wanmi...@intel.com>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Elly FJ <elly...@chromium.org>
Gerrit-Attention: Steven Valdez <sva...@chromium.org>
Gerrit-Attention: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-Attention: Ken Rockot <roc...@google.com>
Gerrit-Attention: Miguel Casas-Sanchez <mca...@chromium.org>
Gerrit-Comment-Date: Tue, 09 Jul 2024 17:14:19 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Elly FJ (Gerrit)

unread,
Jul 9, 2024, 1:17:50 PM (8 days ago) Jul 9
to Alex Gough, Elly FJ, Dale Curtis, Miguel Casas-Sanchez, Rijubrata Bhaumik, Ken Rockot, Steven Valdez, chromium...@chromium.org, Raphael Kubo Da Costa, Wanming Lin, blundell+...@chromium.org, chrome-gr...@chromium.org, chrome-intell...@chromium.org, marinacio...@chromium.org, mattreyno...@chromium.org, mbarowsky+watc...@chromium.org, network-ser...@chromium.org, odejesu...@chromium.org, olka+...@chromium.org, zhangwen...@google.com
Attention needed from Alex Gough, Dale Curtis, Ken Rockot, Miguel Casas-Sanchez, Rijubrata Bhaumik and Steven Valdez

Elly FJ voted and added 1 comment

Votes added by Elly FJ

Code-Review+1

1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Elly FJ . resolved

lgtm for my part

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Gough
  • Dale Curtis
  • Ken Rockot
  • Miguel Casas-Sanchez
  • Rijubrata Bhaumik
  • Steven Valdez
    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: Ief7d7d9c3745201c243ea72b6d4737ea35cfb1ff
    Gerrit-Change-Number: 5689265
    Gerrit-PatchSet: 1
    Gerrit-Owner: Alex Gough <aj...@chromium.org>
    Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Elly FJ <elly...@chromium.org>
    Gerrit-Reviewer: Ken Rockot <roc...@google.com>
    Gerrit-Reviewer: Miguel Casas-Sanchez <mca...@chromium.org>
    Gerrit-Reviewer: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Reviewer: Steven Valdez <sva...@chromium.org>
    Gerrit-CC: Raphael Kubo Da Costa <raphael.ku...@intel.com>
    Gerrit-CC: Wanming Lin <wanmi...@intel.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Alex Gough <aj...@chromium.org>
    Gerrit-Attention: Steven Valdez <sva...@chromium.org>
    Gerrit-Attention: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: Ken Rockot <roc...@google.com>
    Gerrit-Attention: Miguel Casas-Sanchez <mca...@chromium.org>
    Gerrit-Comment-Date: Tue, 09 Jul 2024 17:17:36 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Dale Curtis (Gerrit)

    unread,
    Jul 9, 2024, 2:31:27 PM (8 days ago) Jul 9
    to Alex Gough, Elly FJ, Miguel Casas-Sanchez, Rijubrata Bhaumik, Ken Rockot, Steven Valdez, chromium...@chromium.org, Raphael Kubo Da Costa, Wanming Lin, blundell+...@chromium.org, chrome-gr...@chromium.org, chrome-intell...@chromium.org, marinacio...@chromium.org, mattreyno...@chromium.org, mbarowsky+watc...@chromium.org, network-ser...@chromium.org, odejesu...@chromium.org, olka+...@chromium.org, zhangwen...@google.com
    Attention needed from Alex Gough, Ken Rockot, Miguel Casas-Sanchez, Rijubrata Bhaumik and Steven Valdez

    Dale Curtis voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Gough
    Gerrit-Attention: Alex Gough <aj...@chromium.org>
    Gerrit-Attention: Steven Valdez <sva...@chromium.org>
    Gerrit-Attention: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: Ken Rockot <roc...@google.com>
    Gerrit-Attention: Miguel Casas-Sanchez <mca...@chromium.org>
    Gerrit-Comment-Date: Tue, 09 Jul 2024 18:31:15 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Alex Gough (Gerrit)

    unread,
    Jul 11, 2024, 1:52:10 PM (6 days ago) Jul 11
    to Alex Gough, Colin Blundell, Dale Curtis, Elly FJ, Miguel Casas-Sanchez, Rijubrata Bhaumik, Steven Valdez, chromium...@chromium.org, Raphael Kubo Da Costa, Wanming Lin, blundell+...@chromium.org, chrome-gr...@chromium.org, chrome-intell...@chromium.org, marinacio...@chromium.org, mattreyno...@chromium.org, mbarowsky+watc...@chromium.org, network-ser...@chromium.org, odejesu...@chromium.org, olka+...@chromium.org, zhangwen...@google.com
    Attention needed from Colin Blundell, Miguel Casas-Sanchez, Rijubrata Bhaumik and Steven Valdez

    Alex Gough added 1 comment

    Patchset-level comments
    Alex Gough . resolved

    Ken is OOO so:

    +blundell (various)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Colin Blundell
    • Miguel Casas-Sanchez
    • Rijubrata Bhaumik
    • Steven Valdez
    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: Ief7d7d9c3745201c243ea72b6d4737ea35cfb1ff
    Gerrit-Change-Number: 5689265
    Gerrit-PatchSet: 1
    Gerrit-Owner: Alex Gough <aj...@chromium.org>
    Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
    Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Elly FJ <elly...@chromium.org>
    Gerrit-Reviewer: Miguel Casas-Sanchez <mca...@chromium.org>
    Gerrit-Reviewer: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Reviewer: Steven Valdez <sva...@chromium.org>
    Gerrit-CC: Raphael Kubo Da Costa <raphael.ku...@intel.com>
    Gerrit-CC: Wanming Lin <wanmi...@intel.com>
    Gerrit-Attention: Steven Valdez <sva...@chromium.org>
    Gerrit-Attention: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: Colin Blundell <blun...@chromium.org>
    Gerrit-Attention: Miguel Casas-Sanchez <mca...@chromium.org>
    Gerrit-Comment-Date: Thu, 11 Jul 2024 17:51:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy

    Colin Blundell (Gerrit)

    unread,
    Jul 12, 2024, 3:02:38 AM (6 days ago) Jul 12
    to Alex Gough, Colin Blundell, Dale Curtis, Elly FJ, Miguel Casas-Sanchez, Rijubrata Bhaumik, Steven Valdez, chromium...@chromium.org, Raphael Kubo Da Costa, Wanming Lin, blundell+...@chromium.org, chrome-gr...@chromium.org, chrome-intell...@chromium.org, marinacio...@chromium.org, mattreyno...@chromium.org, mbarowsky+watc...@chromium.org, network-ser...@chromium.org, odejesu...@chromium.org, olka+...@chromium.org, zhangwen...@google.com
    Attention needed from Alex Gough, Miguel Casas-Sanchez, Rijubrata Bhaumik and Steven Valdez

    Colin Blundell voted and added 1 comment

    Votes added by Colin Blundell

    Code-Review+1
    Commit-Queue+2

    1 comment

    Patchset-level comments
    Colin Blundell . resolved

    Thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Gough
    Gerrit-Attention: Alex Gough <aj...@chromium.org>
    Gerrit-Attention: Steven Valdez <sva...@chromium.org>
    Gerrit-Attention: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: Miguel Casas-Sanchez <mca...@chromium.org>
    Gerrit-Comment-Date: Fri, 12 Jul 2024 07:02:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    Jul 12, 2024, 3:49:16 AM (5 days ago) Jul 12
    to Alex Gough, Colin Blundell, Dale Curtis, Elly FJ, Miguel Casas-Sanchez, Rijubrata Bhaumik, Steven Valdez, chromium...@chromium.org, Raphael Kubo Da Costa, Wanming Lin, blundell+...@chromium.org, chrome-gr...@chromium.org, chrome-intell...@chromium.org, marinacio...@chromium.org, mattreyno...@chromium.org, mbarowsky+watc...@chromium.org, network-ser...@chromium.org, odejesu...@chromium.org, olka+...@chromium.org, zhangwen...@google.com

    Chromium LUCI CQ submitted the change

    Change information

    Commit message:
    Turn iterator $var!=.end() DCHECK() into CHECK() for services

    Accessing an invalid iterator can sometimes be a security
    issue and these checks are cheap, so upgrade to CHECKs.

    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($var != _.end());' \
    -p 'DCHECK(_.end() != $var);' \
    -p 'DCHECK_NE($var, _.end());' \
    -p 'DCHECK_NE(_.end(), $var);'
    ```

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

    This CL was uploaded by git cl split.

    R=dalec...@chromium.org, elly...@chromium.org, mca...@chromium.org, rijubrat...@intel.com, roc...@google.com, sva...@chromium.org
    Bug: 351745839
    Change-Id: Ief7d7d9c3745201c243ea72b6d4737ea35cfb1ff
    Reviewed-by: Elly FJ <elly...@chromium.org>
    Auto-Submit: Alex Gough <aj...@chromium.org>
    Reviewed-by: Dale Curtis <dalec...@chromium.org>
    Commit-Queue: Colin Blundell <blun...@chromium.org>
    Reviewed-by: Colin Blundell <blun...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1326606}
    Files:
    • M services/audio/group_coordinator-impl.h
    • M services/audio/loopback_stream.cc
    • M services/audio/output_controller.cc
    • M services/audio/stream_factory.cc
    • M services/cert_verifier/cert_net_url_loader/cert_net_fetcher_url_loader.cc
    • M services/data_decoder/public/cpp/safe_web_bundle_parser.cc
    • M services/device/generic_sensor/platform_sensor_provider_chromeos.cc
    • M services/device/geolocation/geolocation_context.cc
    • M services/device/hid/hid_connection_win.cc
    • M services/device/public/cpp/test/fake_serial_port_manager.cc
    • M services/device/public/cpp/test/test_wake_lock_provider.cc
    • M services/device/serial/fake_serial_device_enumerator.cc
    • M services/device/serial/serial_device_enumerator.cc
    • M services/device/usb/usb_device_handle_usbfs.cc
    • M services/device/usb/usb_device_handle_win.cc
    • M services/device/usb/usb_service.cc
    • M services/device/wake_lock/wake_lock_provider.cc
    • M services/network/cors/cors_url_loader_factory.h
    • M services/network/cors/preflight_controller.cc
    • M services/network/keepalive_statistics_recorder.cc
    • M services/network/mdns_responder.cc
    • M services/network/network_context.cc
    • M services/network/network_service.cc
    • M services/network/trust_tokens/in_memory_trust_token_persister.cc
    • M services/network/web_bundle/web_bundle_chunked_buffer.cc
    • M services/on_device_model/on_device_model_service.cc
    • M services/proxy_resolver_win/windows_system_proxy_resolver_impl.cc
    • M services/resource_coordinator/memory_instrumentation/coordinator_impl.cc
    • M services/service_manager/service_manager.cc
    • M services/viz/public/cpp/gpu/client_gpu_memory_buffer_manager.cc
    Change size: M
    Delta: 30 files changed, 74 insertions(+), 44 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Dale Curtis, +1 by Colin Blundell, +1 by Elly FJ
    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: Ief7d7d9c3745201c243ea72b6d4737ea35cfb1ff
    Gerrit-Change-Number: 5689265
    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