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}
2 files changed