Add plugin option to skip complex constructor checks for aggregate types [chromium/src : main]

2 views
Skip to first unread message

Daniel Cheng (Gerrit)

unread,
Apr 17, 2026, 3:15:53 AM (9 days ago) Apr 17
to Daniel Cheng, Hans Wennborg, Andrew Grieve, Nico Weber, David Benjamin, Jeremy Roman, Tom Sepez, Peter Kasting, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Rijubrata Bhaumik, asvitki...@chromium.org, bartek...@chromium.org, cc-...@chromium.org, chfreme...@chromium.org, chromeos-gfx-...@google.com, chromiumme...@microsoft.com, feature-me...@chromium.org, grt+...@chromium.org, jasonrobe...@google.com, jdeblas...@chromium.org, jophba...@chromium.org, jshin...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, mac-r...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, mfoltz+wa...@chromium.org, net-r...@chromium.org, oshima...@chromium.org, spang...@chromium.org, tracing...@chromium.org, vaapi-...@chromium.org, wfh+...@chromium.org
Attention needed from Andrew Grieve, David Benjamin, Hans Wennborg, Jeremy Roman and Nico Weber

Daniel Cheng voted and added 1 comment

Votes added by Daniel Cheng

Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Daniel Cheng . resolved

Sorry for the wide audience. I finally got around to poking at this a bit after @davi...@chromium.org complained about this (yet again) 9 months ago or so. The original criteria (only public fields and no virtual methods) we had discussed more or less maps to "is a C++ aggregate", so the only extension is to make this aggregate logic apply to base classes as well. https://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html#a179a178d382b17321ff67e39b5641058 says base classes are not allowed, but as of C++23, aggregates may have base classes; however, a non-aggregate base class does not appear to disqualify a derived class from being an aggregate.

Originally I had also pushed for forcing destructors to still be out-of-line to reduce the binary size impact, but since this suppresses implicit move constructors, that seems likely to result in worse outcomes (see also crbug.com/365953516). So as proposed, this CL does not require out-of-line dtors for aggregate types.

As for binary size impact, I had gemini-cli trawl the codebase for candidates for converting to aggregates and then convert them. https://chromium-review.googlesource.com/c/chromium/src/+/7763599/ isn't perfect, but should be a rough proxy of the binary size impact.

Unsurprisingly, arm32 is not really affected; arm64 increases by almost 60KB. A local official build of Linux demonstrates about a 100KB increase. About 10KB of this was due to increases in RenderWidgetHostImpl::DragTargetDragEnter, while another 10KB or so is due to increases in NetworkContext::MakeURLRequestContext, since `HttpNetworkSessionParams` has a lot of fields.

Requiring out-of-line destructors halfs the binary size impact... but as mentioned previously, suppresses move constructors which is probably a net negative.

@ha...@chromium.org please do the overall review here; I'm also curious if you're worried about the potential effect on compile-time, since this does move some work to anyone that includes these headers.
@agr...@chromium.org do you have any concerns from a binary size perspective here?

And style guide owners, would be interested in hearing any feedback, concerns, or suggestions overall?

Open in Gerrit

Related details

Attention is currently required from:
  • Andrew Grieve
  • David Benjamin
  • Hans Wennborg
  • Jeremy Roman
  • Nico Weber
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: I7a7064bbbafcb560a849fdbdc182b56e4c7fbbd6
Gerrit-Change-Number: 7763597
Gerrit-PatchSet: 2
Gerrit-Owner: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: David Benjamin <davi...@chromium.org>
Gerrit-Reviewer: Hans Wennborg <ha...@chromium.org>
Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Tom Sepez <tse...@chromium.org>
Gerrit-Attention: Hans Wennborg <ha...@chromium.org>
Gerrit-Attention: Nico Weber <tha...@chromium.org>
Gerrit-Attention: Andrew Grieve <agr...@chromium.org>
Gerrit-Attention: Jeremy Roman <jbr...@chromium.org>
Gerrit-Attention: David Benjamin <davi...@chromium.org>
Gerrit-Comment-Date: Fri, 17 Apr 2026 07:15:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrew Grieve (Gerrit)

unread,
Apr 17, 2026, 9:36:22 AM (9 days ago) Apr 17
to Daniel Cheng, Hans Wennborg, Andrew Grieve, Nico Weber, David Benjamin, Jeremy Roman, Tom Sepez, Peter Kasting, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Rijubrata Bhaumik, asvitki...@chromium.org, bartek...@chromium.org, cc-...@chromium.org, chfreme...@chromium.org, chromeos-gfx-...@google.com, chromiumme...@microsoft.com, feature-me...@chromium.org, grt+...@chromium.org, jasonrobe...@google.com, jdeblas...@chromium.org, jophba...@chromium.org, jshin...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, mac-r...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, mfoltz+wa...@chromium.org, net-r...@chromium.org, oshima...@chromium.org, spang...@chromium.org, tracing...@chromium.org, vaapi-...@chromium.org, wfh+...@chromium.org
Attention needed from Daniel Cheng, David Benjamin, Hans Wennborg, Jeremy Roman and Nico Weber

Andrew Grieve added 1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Andrew Grieve . resolved

Neat!

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
  • David Benjamin
  • Hans Wennborg
  • Jeremy Roman
  • Nico Weber
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: I7a7064bbbafcb560a849fdbdc182b56e4c7fbbd6
Gerrit-Change-Number: 7763597
Gerrit-PatchSet: 3
Gerrit-Owner: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: David Benjamin <davi...@chromium.org>
Gerrit-Reviewer: Hans Wennborg <ha...@chromium.org>
Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Peter Kasting <pkas...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Tom Sepez <tse...@chromium.org>
Gerrit-Attention: Hans Wennborg <ha...@chromium.org>
Gerrit-Attention: Nico Weber <tha...@chromium.org>
Gerrit-Attention: Jeremy Roman <jbr...@chromium.org>
Gerrit-Attention: David Benjamin <davi...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Fri, 17 Apr 2026 13:36:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Peter Kasting (Gerrit)

unread,
Apr 17, 2026, 12:59:35 PM (9 days ago) Apr 17
to Daniel Cheng, Hans Wennborg, Andrew Grieve, Nico Weber, David Benjamin, Jeremy Roman, Tom Sepez, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Rijubrata Bhaumik, asvitki...@chromium.org, bartek...@chromium.org, cc-...@chromium.org, chfreme...@chromium.org, chromeos-gfx-...@google.com, chromiumme...@microsoft.com, feature-me...@chromium.org, grt+...@chromium.org, jasonrobe...@google.com, jdeblas...@chromium.org, jophba...@chromium.org, jshin...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, mac-r...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, mfoltz+wa...@chromium.org, net-r...@chromium.org, oshima...@chromium.org, spang...@chromium.org, tracing...@chromium.org, vaapi-...@chromium.org, wfh+...@chromium.org
Attention needed from Daniel Cheng, David Benjamin, Hans Wennborg, Jeremy Roman and Nico Weber

Peter Kasting added 1 comment

Patchset-level comments
Peter Kasting . resolved

༼ つ ◕_◕ ༽つ Take my energy ༼ つ ◕_◕ ༽つ

Gerrit-Comment-Date: Fri, 17 Apr 2026 16:59:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Tom Sepez (Gerrit)

unread,
Apr 17, 2026, 1:02:22 PM (9 days ago) Apr 17
to Daniel Cheng, Hans Wennborg, Andrew Grieve, Nico Weber, David Benjamin, Jeremy Roman, Peter Kasting, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Rijubrata Bhaumik, asvitki...@chromium.org, bartek...@chromium.org, cc-...@chromium.org, chfreme...@chromium.org, chromeos-gfx-...@google.com, chromiumme...@microsoft.com, feature-me...@chromium.org, grt+...@chromium.org, jasonrobe...@google.com, jdeblas...@chromium.org, jophba...@chromium.org, jshin...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, mac-r...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, mfoltz+wa...@chromium.org, net-r...@chromium.org, oshima...@chromium.org, spang...@chromium.org, tracing...@chromium.org, vaapi-...@chromium.org, wfh+...@chromium.org
Attention needed from Daniel Cheng, David Benjamin, Hans Wennborg, Jeremy Roman and Nico Weber

Tom Sepez voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
  • David Benjamin
  • Hans Wennborg
  • Jeremy Roman
  • Nico Weber
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: I7a7064bbbafcb560a849fdbdc182b56e4c7fbbd6
    Gerrit-Change-Number: 7763597
    Gerrit-PatchSet: 3
    Gerrit-Owner: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: David Benjamin <davi...@chromium.org>
    Gerrit-Reviewer: Hans Wennborg <ha...@chromium.org>
    Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
    Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
    Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Peter Kasting <pkas...@chromium.org>
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: Hans Wennborg <ha...@chromium.org>
    Gerrit-Attention: Nico Weber <tha...@chromium.org>
    Gerrit-Attention: Jeremy Roman <jbr...@chromium.org>
    Gerrit-Attention: David Benjamin <davi...@chromium.org>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Comment-Date: Fri, 17 Apr 2026 17:02:07 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Tom Sepez (Gerrit)

    unread,
    Apr 17, 2026, 1:03:06 PM (9 days ago) Apr 17
    to Daniel Cheng, Hans Wennborg, Andrew Grieve, Nico Weber, David Benjamin, Jeremy Roman, Peter Kasting, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Rijubrata Bhaumik, asvitki...@chromium.org, bartek...@chromium.org, cc-...@chromium.org, chfreme...@chromium.org, chromeos-gfx-...@google.com, chromiumme...@microsoft.com, feature-me...@chromium.org, grt+...@chromium.org, jasonrobe...@google.com, jdeblas...@chromium.org, jophba...@chromium.org, jshin...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, mac-r...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, mfoltz+wa...@chromium.org, net-r...@chromium.org, oshima...@chromium.org, spang...@chromium.org, tracing...@chromium.org, vaapi-...@chromium.org, wfh+...@chromium.org
    Attention needed from Daniel Cheng, David Benjamin, Hans Wennborg, Jeremy Roman and Nico Weber

    Tom Sepez added 1 comment

    Patchset-level comments
    Tom Sepez . resolved

    Super, but also get approval from Nico, say, before landing, just to keep us all on the same page.

    Gerrit-Comment-Date: Fri, 17 Apr 2026 17:02:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy

    David Benjamin (Gerrit)

    unread,
    Apr 17, 2026, 3:45:33 PM (9 days ago) Apr 17
    to Daniel Cheng, Tom Sepez, Hans Wennborg, Andrew Grieve, Nico Weber, Jeremy Roman, Peter Kasting, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Rijubrata Bhaumik, asvitki...@chromium.org, bartek...@chromium.org, cc-...@chromium.org, chfreme...@chromium.org, chromeos-gfx-...@google.com, chromiumme...@microsoft.com, feature-me...@chromium.org, grt+...@chromium.org, jasonrobe...@google.com, jdeblas...@chromium.org, jophba...@chromium.org, jshin...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, mac-r...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, mfoltz+wa...@chromium.org, net-r...@chromium.org, oshima...@chromium.org, spang...@chromium.org, tracing...@chromium.org, vaapi-...@chromium.org, wfh+...@chromium.org
    Attention needed from Daniel Cheng, Hans Wennborg, Jeremy Roman and Nico Weber

    David Benjamin voted and added 1 comment

    Votes added by David Benjamin

    Code-Review+1

    1 comment

    Patchset-level comments
    Daniel Cheng . resolved

    Sorry for the wide audience. I finally got around to poking at this a bit after @davi...@chromium.org complained about this (yet again) 9 months ago or so. The original criteria (only public fields and no virtual methods) we had discussed more or less maps to "is a C++ aggregate", so the only extension is to make this aggregate logic apply to base classes as well. https://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html#a179a178d382b17321ff67e39b5641058 says base classes are not allowed, but as of C++23, aggregates may have base classes; however, a non-aggregate base class does not appear to disqualify a derived class from being an aggregate.

    Originally I had also pushed for forcing destructors to still be out-of-line to reduce the binary size impact, but since this suppresses implicit move constructors, that seems likely to result in worse outcomes (see also crbug.com/365953516). So as proposed, this CL does not require out-of-line dtors for aggregate types.

    As for binary size impact, I had gemini-cli trawl the codebase for candidates for converting to aggregates and then convert them. https://chromium-review.googlesource.com/c/chromium/src/+/7763599/ isn't perfect, but should be a rough proxy of the binary size impact.

    Unsurprisingly, arm32 is not really affected; arm64 increases by almost 60KB. A local official build of Linux demonstrates about a 100KB increase. About 10KB of this was due to increases in RenderWidgetHostImpl::DragTargetDragEnter, while another 10KB or so is due to increases in NetworkContext::MakeURLRequestContext, since `HttpNetworkSessionParams` has a lot of fields.

    Requiring out-of-line destructors halfs the binary size impact... but as mentioned previously, suppresses move constructors which is probably a net negative.

    @ha...@chromium.org please do the overall review here; I'm also curious if you're worried about the potential effect on compile-time, since this does move some work to anyone that includes these headers.
    @agr...@chromium.org do you have any concerns from a binary size perspective here?

    And style guide owners, would be interested in hearing any feedback, concerns, or suggestions overall?

    David Benjamin

    I'm not familiar enough with Clang to do a great review of this CL code-wise, but I glanced over it and it seems plausible? As far as C++ practices goes, I wholeheartedly support this change. 😊

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniel Cheng
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Comment-Date: Fri, 17 Apr 2026 19:45:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
    satisfied_requirement
    open
    diffy

    Hans Wennborg (Gerrit)

    unread,
    Apr 20, 2026, 9:15:24 AM (6 days ago) Apr 20
    to Daniel Cheng, David Benjamin, Tom Sepez, Hans Wennborg, Andrew Grieve, Nico Weber, Jeremy Roman, Peter Kasting, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Rijubrata Bhaumik, asvitki...@chromium.org, bartek...@chromium.org, cc-...@chromium.org, chfreme...@chromium.org, chromeos-gfx-...@google.com, chromiumme...@microsoft.com, feature-me...@chromium.org, grt+...@chromium.org, jasonrobe...@google.com, jdeblas...@chromium.org, jophba...@chromium.org, jshin...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, mac-r...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, mfoltz+wa...@chromium.org, net-r...@chromium.org, oshima...@chromium.org, spang...@chromium.org, tracing...@chromium.org, vaapi-...@chromium.org, wfh+...@chromium.org
    Attention needed from Daniel Cheng, Jeremy Roman and Nico Weber

    Hans Wennborg added 3 comments

    Patchset-level comments
    File-level comment, Patchset 3 (Latest):
    Hans Wennborg . resolved

    This seems good to me if it doesn't regress build time/size too much. Do you have any numbers on this?

    Commit Message
    Line 30, Patchset 3 (Latest):prototype and measure the potential future impact on Chrome binary size.
    Hans Wennborg . unresolved

    What were the results of the measurements?

    File tools/clang/plugins/tests/aggregate_ctor.h
    Line 52, Patchset 3 (Latest):// No constructors should be triggered since `DerivedAggregate` is still an
    Hans Wennborg . unresolved

    s/No constructors/No warning/ ?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniel Cheng
    • Jeremy Roman
    • Nico Weber
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement 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: I7a7064bbbafcb560a849fdbdc182b56e4c7fbbd6
      Gerrit-Change-Number: 7763597
      Gerrit-PatchSet: 3
      Gerrit-Owner: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: David Benjamin <davi...@chromium.org>
      Gerrit-Reviewer: Hans Wennborg <ha...@chromium.org>
      Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
      Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
      Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Peter Kasting <pkas...@chromium.org>
      Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
      Gerrit-Attention: Nico Weber <tha...@chromium.org>
      Gerrit-Attention: Jeremy Roman <jbr...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Mon, 20 Apr 2026 13:15:08 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Daniel Cheng (Gerrit)

      unread,
      Apr 20, 2026, 12:05:33 PM (6 days ago) Apr 20
      to Daniel Cheng, David Benjamin, Tom Sepez, Hans Wennborg, Andrew Grieve, Nico Weber, Jeremy Roman, Peter Kasting, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Rijubrata Bhaumik, asvitki...@chromium.org, bartek...@chromium.org, cc-...@chromium.org, chfreme...@chromium.org, chromeos-gfx-...@google.com, chromiumme...@microsoft.com, feature-me...@chromium.org, grt+...@chromium.org, jasonrobe...@google.com, jdeblas...@chromium.org, jophba...@chromium.org, jshin...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, mac-r...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, mfoltz+wa...@chromium.org, net-r...@chromium.org, oshima...@chromium.org, spang...@chromium.org, tracing...@chromium.org, vaapi-...@chromium.org, wfh+...@chromium.org
      Attention needed from Hans Wennborg, Jeremy Roman and Nico Weber

      Daniel Cheng added 1 comment

      Patchset-level comments
      Hans Wennborg . resolved

      This seems good to me if it doesn't regress build time/size too much. Do you have any numbers on this?

      Daniel Cheng

      Yes, see the initial message in https://chromium-review.googlesource.com/c/chromium/src/+/7763597/comments/929e267e_9afa0cc5. I'll mention them in the CL description on my next upload too.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Hans Wennborg
      • Jeremy Roman
      • Nico Weber
      Gerrit-Attention: Hans Wennborg <ha...@chromium.org>
      Gerrit-Attention: Nico Weber <tha...@chromium.org>
      Gerrit-Attention: Jeremy Roman <jbr...@chromium.org>
      Gerrit-Comment-Date: Mon, 20 Apr 2026 16:05:21 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Hans Wennborg <ha...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Jeremy Roman (Gerrit)

      unread,
      Apr 20, 2026, 2:25:00 PM (6 days ago) Apr 20
      to Daniel Cheng, Jeremy Roman, David Benjamin, Tom Sepez, Hans Wennborg, Andrew Grieve, Nico Weber, Peter Kasting, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Rijubrata Bhaumik, asvitki...@chromium.org, bartek...@chromium.org, cc-...@chromium.org, chfreme...@chromium.org, chromeos-gfx-...@google.com, chromiumme...@microsoft.com, feature-me...@chromium.org, grt+...@chromium.org, jasonrobe...@google.com, jdeblas...@chromium.org, jophba...@chromium.org, jshin...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, mac-r...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, mfoltz+wa...@chromium.org, net-r...@chromium.org, oshima...@chromium.org, spang...@chromium.org, tracing...@chromium.org, vaapi-...@chromium.org, wfh+...@chromium.org
      Attention needed from Daniel Cheng, Hans Wennborg and Nico Weber

      Jeremy Roman voted and added 1 comment

      Votes added by Jeremy Roman

      Code-Review+1

      1 comment

      Patchset-level comments
      Jeremy Roman . resolved

      Seems fine to me. I'm a bit worried that there are some large structs where this would be an issue, but while this carveout is a bit arbitrary it's not unreasonable.

      It would be nice if there were a way we could periodically understand which aggregates, if any, are adding a lot of weight to the build, but that doesn't seem blocking.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      • Hans Wennborg
      • Nico Weber
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Mon, 20 Apr 2026 18:24:50 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      David Benjamin (Gerrit)

      unread,
      Apr 20, 2026, 2:38:07 PM (6 days ago) Apr 20
      to Daniel Cheng, Jeremy Roman, Tom Sepez, Hans Wennborg, Andrew Grieve, Nico Weber, Peter Kasting, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Rijubrata Bhaumik, asvitki...@chromium.org, bartek...@chromium.org, cc-...@chromium.org, chfreme...@chromium.org, chromeos-gfx-...@google.com, chromiumme...@microsoft.com, feature-me...@chromium.org, grt+...@chromium.org, jasonrobe...@google.com, jdeblas...@chromium.org, jophba...@chromium.org, jshin...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, mac-r...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, mfoltz+wa...@chromium.org, net-r...@chromium.org, oshima...@chromium.org, spang...@chromium.org, tracing...@chromium.org, vaapi-...@chromium.org, wfh+...@chromium.org
      Attention needed from Daniel Cheng, Hans Wennborg and Nico Weber

      David Benjamin added 1 comment

      Patchset-level comments
      Jeremy Roman . resolved

      Seems fine to me. I'm a bit worried that there are some large structs where this would be an issue, but while this carveout is a bit arbitrary it's not unreasonable.

      It would be nice if there were a way we could periodically understand which aggregates, if any, are adding a lot of weight to the build, but that doesn't seem blocking.

      David Benjamin

      If we find some class of aggregates are impacting binary size, we can also try to improve the compiler's inlining heuristic. IMO it's a bug when giving the compiler more information causes it to generate less code. (Of course, engineering realities mean it's sometimes right for us to work around those bugs instead of fixing the source. But, at least in principle, we *shouldn't* need this for binary size.)

      (Build times are less clear. IMO the principled answer is we should invest some % of our time worrying about build times into getting C++20 modules to work, but that is a dream even more burdened with engineering realities. 😭)

      Gerrit-Comment-Date: Mon, 20 Apr 2026 18:37:59 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Jeremy Roman <jbr...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Daniel Cheng (Gerrit)

      unread,
      Apr 21, 2026, 4:10:10 AM (5 days ago) Apr 21
      to Daniel Cheng, Jeremy Roman, David Benjamin, Tom Sepez, Hans Wennborg, Andrew Grieve, Nico Weber, Peter Kasting, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Rijubrata Bhaumik, asvitki...@chromium.org, bartek...@chromium.org, cc-...@chromium.org, chfreme...@chromium.org, chromeos-gfx-...@google.com, chromiumme...@microsoft.com, feature-me...@chromium.org, grt+...@chromium.org, jasonrobe...@google.com, jdeblas...@chromium.org, jophba...@chromium.org, jshin...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, mac-r...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, mfoltz+wa...@chromium.org, net-r...@chromium.org, oshima...@chromium.org, spang...@chromium.org, tracing...@chromium.org, vaapi-...@chromium.org, wfh+...@chromium.org
      Attention needed from Hans Wennborg and Nico Weber

      Daniel Cheng added 2 comments

      Commit Message
      Line 30, Patchset 3:prototype and measure the potential future impact on Chrome binary size.
      Hans Wennborg . resolved

      What were the results of the measurements?

      Daniel Cheng

      Added a summary of some of the top regressions to the CL description now. The impact is definitely unevenly distributed; `DropDataToMetaData()` (inlined into `RenderWidgetHostImpl::DragTargetDragEnter()`) gets hit disproportionately hard.

      File tools/clang/plugins/tests/aggregate_ctor.h
      Line 52, Patchset 3:// No constructors should be triggered since `DerivedAggregate` is still an
      Hans Wennborg . resolved

      s/No constructors/No warning/ ?

      Daniel Cheng

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Hans Wennborg
      • Nico Weber
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement 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: I7a7064bbbafcb560a849fdbdc182b56e4c7fbbd6
        Gerrit-Change-Number: 7763597
        Gerrit-PatchSet: 4
        Gerrit-Owner: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: David Benjamin <davi...@chromium.org>
        Gerrit-Reviewer: Hans Wennborg <ha...@chromium.org>
        Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
        Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
        Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Peter Kasting <pkas...@chromium.org>
        Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
        Gerrit-Attention: Hans Wennborg <ha...@chromium.org>
        Gerrit-Attention: Nico Weber <tha...@chromium.org>
        Gerrit-Comment-Date: Tue, 21 Apr 2026 08:09:56 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Hans Wennborg <ha...@chromium.org>
        satisfied_requirement
        open
        diffy

        Hans Wennborg (Gerrit)

        unread,
        Apr 21, 2026, 4:18:43 AM (5 days ago) Apr 21
        to Daniel Cheng, Hans Wennborg, Jeremy Roman, David Benjamin, Tom Sepez, Andrew Grieve, Nico Weber, Peter Kasting, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Rijubrata Bhaumik, asvitki...@chromium.org, bartek...@chromium.org, cc-...@chromium.org, chfreme...@chromium.org, chromeos-gfx-...@google.com, chromiumme...@microsoft.com, feature-me...@chromium.org, grt+...@chromium.org, jasonrobe...@google.com, jdeblas...@chromium.org, jophba...@chromium.org, jshin...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, mac-r...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, mfoltz+wa...@chromium.org, net-r...@chromium.org, oshima...@chromium.org, spang...@chromium.org, tracing...@chromium.org, vaapi-...@chromium.org, wfh+...@chromium.org
        Attention needed from Daniel Cheng and Nico Weber

        Hans Wennborg voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Daniel Cheng
        • Nico Weber
        Gerrit-Attention: Nico Weber <tha...@chromium.org>
        Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
        Gerrit-Comment-Date: Tue, 21 Apr 2026 08:18:25 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Daniel Cheng (Gerrit)

        unread,
        Apr 22, 2026, 6:09:18 PM (4 days ago) Apr 22
        to Daniel Cheng, Hans Wennborg, Jeremy Roman, David Benjamin, Tom Sepez, Andrew Grieve, Nico Weber, Peter Kasting, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Rijubrata Bhaumik, asvitki...@chromium.org, bartek...@chromium.org, cc-...@chromium.org, chfreme...@chromium.org, chromeos-gfx-...@google.com, chromiumme...@microsoft.com, feature-me...@chromium.org, grt+...@chromium.org, jasonrobe...@google.com, jdeblas...@chromium.org, jophba...@chromium.org, jshin...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, mac-r...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, mfoltz+wa...@chromium.org, net-r...@chromium.org, oshima...@chromium.org, spang...@chromium.org, tracing...@chromium.org, vaapi-...@chromium.org, wfh+...@chromium.org
        Attention needed from Nico Weber

        Daniel Cheng added 1 comment

        Patchset-level comments
        File-level comment, Patchset 4 (Latest):
        Daniel Cheng . resolved

        I talked to thakis@ offline, who was OK with this if it didn't regress build performance. So I did some build measurements; apparently one of the motivations for the original check was build times on Windows, especially in component builds. thakis@ also pointed at https://blog.llvm.org/2018/11/30-faster-windows-builds-with-clang-cl_14.html which should have helped mitigate the original build time issues.

        Using a only-local dcheck-always-on component release cross-compile for Windows on Linux, with and without https://chromium-review.googlesource.com/c/chromium/src/+/7763599, which converts 61 types to aggregates. I disabled the plugin checks for simplicity, and the cycle counts before and after are fairly comparable and within the likely effect of noise. I repeated the test in two directions as well (building before first, and hten after, and then after and then first to try to eliminate caching/ordering effects).

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Nico Weber
        Gerrit-Comment-Date: Wed, 22 Apr 2026 22:09:08 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        open
        diffy

        Daniel Cheng (Gerrit)

        unread,
        Apr 22, 2026, 6:10:26 PM (4 days ago) Apr 22
        to Daniel Cheng, Hans Wennborg, Jeremy Roman, David Benjamin, Tom Sepez, Andrew Grieve, Nico Weber, Peter Kasting, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Rijubrata Bhaumik, asvitki...@chromium.org, bartek...@chromium.org, cc-...@chromium.org, chfreme...@chromium.org, chromeos-gfx-...@google.com, chromiumme...@microsoft.com, feature-me...@chromium.org, grt+...@chromium.org, jasonrobe...@google.com, jdeblas...@chromium.org, jophba...@chromium.org, jshin...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, mac-r...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, mfoltz+wa...@chromium.org, net-r...@chromium.org, oshima...@chromium.org, spang...@chromium.org, tracing...@chromium.org, vaapi-...@chromium.org, wfh+...@chromium.org
        Attention needed from Nico Weber

        Daniel Cheng voted and added 1 comment

        Votes added by Daniel Cheng

        Commit-Queue+2

        1 comment

        Patchset-level comments
        Jeremy Roman . resolved

        Seems fine to me. I'm a bit worried that there are some large structs where this would be an issue, but while this carveout is a bit arbitrary it's not unreasonable.

        It would be nice if there were a way we could periodically understand which aggregates, if any, are adding a lot of weight to the build, but that doesn't seem blocking.

        David Benjamin

        If we find some class of aggregates are impacting binary size, we can also try to improve the compiler's inlining heuristic. IMO it's a bug when giving the compiler more information causes it to generate less code. (Of course, engineering realities mean it's sometimes right for us to work around those bugs instead of fixing the source. But, at least in principle, we *shouldn't* need this for binary size.)

        (Build times are less clear. IMO the principled answer is we should invest some % of our time worrying about build times into getting C++20 modules to work, but that is a dream even more burdened with engineering realities. 😭)

        Daniel Cheng

        There are definitely some structs where the effect is quite immediately noticeable. I'm going to experiment with some ways to try to find these sorts of more expensive structs. But whatever we can do seems like it will be a workaround to trying to improve the compiler's behavior in this area, and/or encouraging patterns that generate less bloat.

        Gerrit-Comment-Date: Wed, 22 Apr 2026 22:10:17 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        Comment-In-Reply-To: Jeremy Roman <jbr...@chromium.org>
        Comment-In-Reply-To: David Benjamin <davi...@chromium.org>
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        Apr 22, 2026, 6:13:39 PM (4 days ago) Apr 22
        to Daniel Cheng, Hans Wennborg, Jeremy Roman, David Benjamin, Tom Sepez, Andrew Grieve, Nico Weber, Peter Kasting, chromium...@chromium.org, Kentaro Hara, Rijubrata Bhaumik, asvitki...@chromium.org, bartek...@chromium.org, cc-...@chromium.org, chfreme...@chromium.org, chromeos-gfx-...@google.com, chromiumme...@microsoft.com, feature-me...@chromium.org, grt+...@chromium.org, jasonrobe...@google.com, jdeblas...@chromium.org, jophba...@chromium.org, jshin...@chromium.org, lize...@chromium.org, lizeb...@chromium.org, mac-r...@chromium.org, media-cro...@chromium.org, media-wi...@chromium.org, mfoltz+wa...@chromium.org, net-r...@chromium.org, oshima...@chromium.org, spang...@chromium.org, tracing...@chromium.org, vaapi-...@chromium.org, wfh+...@chromium.org

        Chromium LUCI CQ submitted the change

        Change information

        Commit message:
        Add plugin option to skip complex constructor checks for aggregate types

        With this option enabled, the Chrome clang plugin completely skips the
        complex constructor and destructor checks for aggregate types. This
        allows the use of designated initializers, which can be a very
        convenient shorthand.

        While there is some binary size and compile time cost, this carveout is
        limited to classes and structs that meet the C++23 requirements for an
        aggregate. Most importantly, this means no virtual methods and only
        public fields.

        In addition, the C++ style guide also specifically recommends structs
        only when a type does not need to maintain any internal invariants:
        between this guidance and the previous restrictions, this should provide
        an acceptable balance between utility and cost.

        As an aside, the original plan was to require out-of-line destructors
        for aggregates; however, this prevents the compiler from providing an
        implicitly-declared move constructor where appropriate and leads to
        worse overall outcomes.

        Some numbers from converting 61 candidate types to use designated
        initializers:
        - arm32 binary size isn't affected
        - arm64 binary size increases by ~60KB
        - official Linux builds increase by ~100KB. This increase is not evenly
        distributed, e.g.:
        - `RenderWidgetHostImpl::DragTargetDragEnter()` increases in size from
        879 bytes to 10,824 bytes. This is the largest increase; before and
        after, the compiler inlines the body of the `DropDataToMetaData()`
        helper function, which includes multiple calls to `~Metadata()` to
        destroy the temporaries; however, in the after version, clang emits
        the code for the destructor inline, causing significant bloat.
        Rewriting this to use `emplace_back()` to avoid the temporaries
        helps reduce the impact to only 3,938 bytes, but does not eliminate
        it entirely.
        - `NetworkContext::MakeURLRequestContext()` was previously inlined
        into `NetworkContext`; the combined size before is 15,313 bytes,
        while the combined size after is 16,978 bytes. This changer is
        primarily due to `HttpNetworkSessionParams` becoming an aggregate;
        the destructor is large due to various fields that are maps.

        gemini-cli used to develop initial plugin changes and tests, as well as

        prototype and measure the potential future impact on Chrome binary size.
        Bug: 355003174
        Bug: 40264793
        Bug: 40279385
        Change-Id: I7a7064bbbafcb560a849fdbdc182b56e4c7fbbd6
        Reviewed-by: Hans Wennborg <ha...@chromium.org>
        Commit-Queue: Daniel Cheng <dch...@chromium.org>
        Reviewed-by: Tom Sepez <tse...@chromium.org>
        Reviewed-by: David Benjamin <davi...@chromium.org>
        Reviewed-by: Jeremy Roman <jbr...@chromium.org>
        Cr-Commit-Position: refs/heads/main@{#1619124}
        Files:
        • M tools/clang/plugins/FindBadConstructsAction.cpp
        • M tools/clang/plugins/FindBadConstructsConsumer.cpp
        • M tools/clang/plugins/FindBadConstructsConsumer.h
        • M tools/clang/plugins/Options.h
        • A tools/clang/plugins/tests/aggregate_ctor.cpp
        • A tools/clang/plugins/tests/aggregate_ctor.flags
        • A tools/clang/plugins/tests/aggregate_ctor.h
        • A tools/clang/plugins/tests/aggregate_ctor.txt
        • A tools/clang/plugins/tests/inline_copy_ctor.flags
        • A tools/clang/plugins/tests/inline_ctor.flags
        • M tools/clang/plugins/tests/inline_ctor.txt
        • A tools/clang/plugins/tests/missing_ctor.flags
        • M tools/clang/plugins/tests/missing_ctor_dllexport.flags
        • A tools/clang/plugins/tests/missing_ctor_ignored_base.flags
        • A tools/clang/plugins/tests/nested_class_inline_ctor.flags
        Change size: M
        Delta: 15 files changed, 157 insertions(+), 6 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by David Benjamin, +1 by Tom Sepez, +1 by Jeremy Roman, +1 by Hans Wennborg
        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: I7a7064bbbafcb560a849fdbdc182b56e4c7fbbd6
        Gerrit-Change-Number: 7763597
        Gerrit-PatchSet: 5
        Gerrit-Owner: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: David Benjamin <davi...@chromium.org>
        Gerrit-Reviewer: Hans Wennborg <ha...@chromium.org>
        Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
        Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
        Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages