[traits_bag.h] Use base::ParameterPack for trait validation [chromium/src : main]

0 views
Skip to first unread message

Patrick Monette (Gerrit)

unread,
Mar 27, 2026, 2:50:37 PM (6 days ago) Mar 27
to Etienne Pierre-Doray, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Andrew Rayskiy, Simon Hangl, aixba+wat...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, japhet+...@chromium.org, kinuko...@chromium.org, kuragin+web-ap...@chromium.org, loyso...@chromium.org, marq+...@chromium.org, mek+w...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, rmcelra...@chromium.org, scheduler...@chromium.org, scheduler-...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
Attention needed from Etienne Pierre-Doray

Patrick Monette added 1 comment

Patchset-level comments
File-level comment, Patchset 8 (Latest):
Patrick Monette . resolved

PTAL

Open in Gerrit

Related details

Attention is currently required from:
  • Etienne Pierre-Doray
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: I6a8a48c5a5015167118c33a63e2e021ebd9c83db
Gerrit-Change-Number: 7708114
Gerrit-PatchSet: 8
Gerrit-Owner: Patrick Monette <pmon...@chromium.org>
Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Reviewer: Patrick Monette <pmon...@chromium.org>
Gerrit-CC: Andrew Rayskiy <green...@google.com>
Gerrit-CC: Simon Hangl <sim...@google.com>
Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Comment-Date: Fri, 27 Mar 2026 18:50:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Etienne Pierre-Doray (Gerrit)

unread,
Mar 31, 2026, 8:35:24 AM (2 days ago) Mar 31
to Patrick Monette, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Andrew Rayskiy, Simon Hangl, aixba+wat...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, japhet+...@chromium.org, kinuko...@chromium.org, kuragin+web-ap...@chromium.org, loyso...@chromium.org, marq+...@chromium.org, mek+w...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, rmcelra...@chromium.org, scheduler...@chromium.org, scheduler-...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
Attention needed from Patrick Monette

Etienne Pierre-Doray added 2 comments

File base/traits_bag.h
Line 207, Patchset 8 (Latest): ValidTraits::template HasType<std::remove_cvref_t<T>>::value ||
Etienne Pierre-Doray . unresolved

Nit: decay_t for simplicity
While there are subtle difference I don't think they matter here.

Line 54, Patchset 8 (Latest):inline constexpr bool HasTypeInPack =
Etienne Pierre-Doray . unresolved

This is the same as HasTrait() below?

Open in Gerrit

Related details

Attention is currently required from:
  • Patrick Monette
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: I6a8a48c5a5015167118c33a63e2e021ebd9c83db
    Gerrit-Change-Number: 7708114
    Gerrit-PatchSet: 8
    Gerrit-Owner: Patrick Monette <pmon...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Patrick Monette <pmon...@chromium.org>
    Gerrit-CC: Andrew Rayskiy <green...@google.com>
    Gerrit-CC: Simon Hangl <sim...@google.com>
    Gerrit-Attention: Patrick Monette <pmon...@chromium.org>
    Gerrit-Comment-Date: Tue, 31 Mar 2026 12:35:18 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Patrick Monette (Gerrit)

    unread,
    Mar 31, 2026, 9:43:15 AM (2 days ago) Mar 31
    to Etienne Pierre-Doray, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Andrew Rayskiy, Simon Hangl, aixba+wat...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, japhet+...@chromium.org, kinuko...@chromium.org, kuragin+web-ap...@chromium.org, loyso...@chromium.org, marq+...@chromium.org, mek+w...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, rmcelra...@chromium.org, scheduler...@chromium.org, scheduler-...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
    Attention needed from Etienne Pierre-Doray

    Patrick Monette added 3 comments

    Patchset-level comments
    Patrick Monette . resolved

    PTAnL

    File base/traits_bag.h
    Line 207, Patchset 8 (Latest): ValidTraits::template HasType<std::remove_cvref_t<T>>::value ||
    Etienne Pierre-Doray . unresolved

    Nit: decay_t for simplicity
    While there are subtle difference I don't think they matter here.

    Patrick Monette

    I have a preference for keeping remove_cvref as it has the exact semantics I want. Given that it's isolated to a single concept, I think it's pretty readable as it is.

    Do you have a strong opinion on this?

    Line 54, Patchset 8 (Latest):inline constexpr bool HasTypeInPack =
    Etienne Pierre-Doray . unresolved

    This is the same as HasTrait() below?

    Patrick Monette

    Yes and no.

    HasTypeInPack is the internal helper, with a precise name for what it does. It's used also for the Exclude::Filter method, while HasTrait is the public facing API, with the nice error message. The error message doesn't make sense for Exclude::Filter.

    I also considered moving all helpers to an internal namespace, but wasn't sure if that was warranted given the existence of the trait_helpers namespace.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Etienne Pierre-Doray
    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: I6a8a48c5a5015167118c33a63e2e021ebd9c83db
    Gerrit-Change-Number: 7708114
    Gerrit-PatchSet: 8
    Gerrit-Owner: Patrick Monette <pmon...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Patrick Monette <pmon...@chromium.org>
    Gerrit-CC: Andrew Rayskiy <green...@google.com>
    Gerrit-CC: Simon Hangl <sim...@google.com>
    Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Comment-Date: Tue, 31 Mar 2026 13:43:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Etienne Pierre-Doray (Gerrit)

    unread,
    Apr 1, 2026, 3:09:51 PM (24 hours ago) Apr 1
    to Patrick Monette, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Andrew Rayskiy, Simon Hangl, aixba+wat...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, japhet+...@chromium.org, kinuko...@chromium.org, kuragin+web-ap...@chromium.org, loyso...@chromium.org, marq+...@chromium.org, mek+w...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, rmcelra...@chromium.org, scheduler...@chromium.org, scheduler-...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
    Attention needed from Patrick Monette

    Etienne Pierre-Doray voted and added 3 comments

    Votes added by Etienne Pierre-Doray

    Code-Review+1

    3 comments

    Patchset-level comments
    File-level comment, Patchset 9 (Latest):
    Etienne Pierre-Doray . resolved

    LGTM

    File base/traits_bag.h
    Line 207, Patchset 8: ValidTraits::template HasType<std::remove_cvref_t<T>>::value ||
    Etienne Pierre-Doray . resolved

    Nit: decay_t for simplicity
    While there are subtle difference I don't think they matter here.

    Patrick Monette

    I have a preference for keeping remove_cvref as it has the exact semantics I want. Given that it's isolated to a single concept, I think it's pretty readable as it is.

    Do you have a strong opinion on this?

    Etienne Pierre-Doray

    Acknowledged

    Line 54, Patchset 8:inline constexpr bool HasTypeInPack =
    Etienne Pierre-Doray . unresolved

    This is the same as HasTrait() below?

    Patrick Monette

    Yes and no.

    HasTypeInPack is the internal helper, with a precise name for what it does. It's used also for the Exclude::Filter method, while HasTrait is the public facing API, with the nice error message. The error message doesn't make sense for Exclude::Filter.

    I also considered moving all helpers to an internal namespace, but wasn't sure if that was warranted given the existence of the trait_helpers namespace.

    Etienne Pierre-Doray

    Ah I see, maybe this should go in base/parameter_pack.h though?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Patrick Monette
    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: I6a8a48c5a5015167118c33a63e2e021ebd9c83db
      Gerrit-Change-Number: 7708114
      Gerrit-PatchSet: 9
      Gerrit-Owner: Patrick Monette <pmon...@chromium.org>
      Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Reviewer: Patrick Monette <pmon...@chromium.org>
      Gerrit-CC: Andrew Rayskiy <green...@google.com>
      Gerrit-CC: Simon Hangl <sim...@google.com>
      Gerrit-Attention: Patrick Monette <pmon...@chromium.org>
      Gerrit-Comment-Date: Wed, 01 Apr 2026 19:09:44 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Patrick Monette <pmon...@chromium.org>
      Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Patrick Monette (Gerrit)

      unread,
      Apr 1, 2026, 3:47:23 PM (23 hours ago) Apr 1
      to Gabriel Charette, Etienne Pierre-Doray, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Andrew Rayskiy, Simon Hangl, aixba+wat...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, japhet+...@chromium.org, kinuko...@chromium.org, kuragin+web-ap...@chromium.org, loyso...@chromium.org, marq+...@chromium.org, mek+w...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, rmcelra...@chromium.org, scheduler...@chromium.org, scheduler-...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
      Attention needed from Gabriel Charette

      Patrick Monette added 2 comments

      Patchset-level comments
      File-level comment, Patchset 10 (Latest):
      Patrick Monette . resolved

      Thanks Etienne

      Gab can you take a look, and maybe owners-override if you deem appropriate. Thanks

      File base/traits_bag.h
      Line 54, Patchset 8:inline constexpr bool HasTypeInPack =
      Etienne Pierre-Doray . resolved

      This is the same as HasTrait() below?

      Patrick Monette

      Yes and no.

      HasTypeInPack is the internal helper, with a precise name for what it does. It's used also for the Exclude::Filter method, while HasTrait is the public facing API, with the nice error message. The error message doesn't make sense for Exclude::Filter.

      I also considered moving all helpers to an internal namespace, but wasn't sure if that was warranted given the existence of the trait_helpers namespace.

      Etienne Pierre-Doray

      Ah I see, maybe this should go in base/parameter_pack.h though?

      Patrick Monette

      It could but ultimately I don't think so. While it uses ParameterPack internally as implementation, the pack in the name refers to a variadic pack, not a base::ParameterPack.

      I decided to rename it to HasTypeInVariadicPack

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Gabriel Charette
      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: I6a8a48c5a5015167118c33a63e2e021ebd9c83db
        Gerrit-Change-Number: 7708114
        Gerrit-PatchSet: 10
        Gerrit-Owner: Patrick Monette <pmon...@chromium.org>
        Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
        Gerrit-Reviewer: Gabriel Charette <g...@chromium.org>
        Gerrit-Reviewer: Patrick Monette <pmon...@chromium.org>
        Gerrit-CC: Andrew Rayskiy <green...@google.com>
        Gerrit-CC: Simon Hangl <sim...@google.com>
        Gerrit-Attention: Gabriel Charette <g...@chromium.org>
        Gerrit-Comment-Date: Wed, 01 Apr 2026 19:47:17 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages