commit | 7eb6d44457143d7fc314b3bb112b3316aceb17d0 | [log] [tgz] |
---|---|---|
author | Fredrik Söderquist <fs@opera.com> | Thu Jan 24 11:17:24 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Jan 24 11:17:24 2019 |
tree | efefdb984eab9549a0f4256749ad1f7429a6246e | |
parent | 143fb793713caf25b14a09fe33695ade6cb2407e [diff] |
Make SameSizeAsComputedStyle model reality better Make a separate SameSizeAsComputedStyleBase struct and inherit from that instead of composing. Make sure the access specifiers match (so that for instance the reference counter will place in the correct spot in the layout). So the layout changes like: *** Dumping AST Record Layout 0 | struct SameSizeAsComputedStyle - 0 | class RefCounted<SameSizeAsComputedStyle> (base) - 0 | uint32_t ref_count_ - 8 | struct SameSizeAsComputedStyle::ComputedStyleBase base_ - 8 | void *[7] data_refs - 64 | unsigned int [4] bitfields_ + 0 | struct SameSizeAsComputedStyleBase (base) + 0 | void *[7] data_refs + 56 | unsigned int [4] bitfields + 72 | class RefCounted<SameSizeAsComputedStyle> (base) + 72 | uint32_t ref_count_ 80 | void *[1] own_ptrs 88 | void * data_ref_svg_style | [sizeof=96, dsize=96, align=8, And to exemplify with the change to field from [1], the change to the SameSize... structs will be: 0 | struct blink::SameSizeAsComputedStyle 0 | struct blink::SameSizeAsComputedStyleBase (base) 0 | void *[7] data_refs - 56 | unsigned int [4] bitfields + 56 | unsigned int [5] bitfields - 72 | class RefCounted<SameSizeAsComputedStyle> (base) - 72 | uint32_t ref_count_ + 76 | class RefCounted<SameSizeAsComputedStyle> (base) + 76 | uint32_t ref_count_ 80 | void *[1] own_ptrs 88 | void * data_ref_svg_style | [sizeof=96, dsize=96, align=8, rather than: 0 | uint32_t ref_count_ 8 | struct SameSizeAsComputedStyle::ComputedStyleBase base_ 8 | void *[7] data_refs - 64 | unsigned int [4] bitfields_ + 64 | unsigned int [5] bitfields_ - 80 | void *[1] own_ptrs + 88 | void *[1] own_ptrs - 88 | void * data_ref_svg_style + 96 | void * data_ref_svg_style - | [sizeof=96, dsize=96, align=8, + | [sizeof=104, dsize=104, align=8, - | nvsize=96, nvalign=8] + | nvsize=104, nvalign=8] Note primarily the layout of |ref_count_| from RefCounted<>. (Layout data courtesy of 'clang++ -fdump-record-layouts', with slight edits for improved readability.) [1] https://chromium-review.googlesource.com/c/chromium/src/+/1421188 Change-Id: I5f34a9bcdf86e3ddb8488bb14e531bba694c919b Reviewed-on: https://chromium-review.googlesource.com/c/1430010 Reviewed-by: Emil A Eklund <eae@chromium.org> Reviewed-by: Javier Fernandez <jfernandez@igalia.com> Commit-Queue: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/master@{#625602}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .