DescriptionMake ComputedStyleBase use DataCopy when copying pointer fields.
ComputedStyleBase has a constructor that copies every field using the
default copy behaviour. However, when we generate RareNonInheritedData,
some of the pointer fields require special copying behaviour (e.g.
those stored in a std::unique_ptr). To inject custom copying behaviour,
we copy pointer fields with a new function called MemberCopy. MemberCopy
is a function that takes a variable of some type and returns a copy of
it. It can be overloaded to have custom copying behaviour for some type.
Since ComputedStyleBase currently has no special copying behaviour,
we simply overload MemberCopy with RefPtr and Persistent to use the
default copying behaviour.
When we generate RareNonInheritedData, we will need to introduce
overloads for std::unique_ptr and DataPersistent.
This patch does not introduce changes in behaviour.
Diff of generated files:
https://gist.github.com/7a2b410da029e4ed71af5509c511cba2/revisions
BUG=628043
Review-Url: https://codereview.chromium.org/2921543002
Cr-Commit-Position: refs/heads/master@{#477206}
Committed: https://chromium.googlesource.com/chromium/src/+/ba2889de7991c1f5162cd12dd6cc6e4de3bc3ac0
Patch Set 1 #Patch Set 2 : Address comments #Patch Set 3 : Rebase #
Dependent Patchsets: Messages
Total messages: 28 (20 generated)
|