Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl

Issue 2775153002: Document why ComputedStyle constructor and destructor are protected. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {% from 'macros.tmpl' import license, print_if %} 1 {% from 'macros.tmpl' import license, print_if %}
2 {{license()}} 2 {{license()}}
3 3
4 #ifndef ComputedStyleBase_h 4 #ifndef ComputedStyleBase_h
5 #define ComputedStyleBase_h 5 #define ComputedStyleBase_h
6 6
7 #include "core/style/ComputedStyleConstants.h" 7 #include "core/style/ComputedStyleConstants.h"
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 {% for path in include_paths %} 9 {% for path in include_paths %}
10 #include "{{path}}" 10 #include "{{path}}"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // Fields. 72 // Fields.
73 // TODO(sashab): Remove initialFoo() static methods and update callers to 73 // TODO(sashab): Remove initialFoo() static methods and update callers to
74 // use resetFoo(), which can be more efficient. 74 // use resetFoo(), which can be more efficient.
75 75
76 {% for field in fields %} 76 {% for field in fields %}
77 // {{field.property_name}} 77 // {{field.property_name}}
78 {{field_templates[field.field_template].decl_methods(field)|indent(2)}} 78 {{field_templates[field.field_template].decl_methods(field)|indent(2)}}
79 79
80 {% endfor %} 80 {% endfor %}
81 protected: 81 protected:
82 // Constructor and destructor are protected so that only the parent class Comp utedStyle
83 // can instantiate this class.
82 ALWAYS_INLINE ComputedStyleBase() : 84 ALWAYS_INLINE ComputedStyleBase() :
83 {% for field in fields %} 85 {% for field in fields %}
84 {{field.name}}(static_cast<unsigned>({{field.default_value}})){{print_if(n ot loop.last, ',')}} 86 {{field.name}}(static_cast<unsigned>({{field.default_value}})){{print_if(n ot loop.last, ',')}}
85 {% endfor %} 87 {% endfor %}
86 {} 88 {}
87 89
88 ~ComputedStyleBase() = default; 90 ~ComputedStyleBase() = default;
89 91
90 // Storage. 92 // Storage.
91 {% for field in fields %} 93 {% for field in fields %}
92 unsigned {{field.name}} : {{field.size}}; // {{field.type_name}} 94 unsigned {{field.name}} : {{field.size}}; // {{field.type_name}}
93 {% endfor %} 95 {% endfor %}
94 }; 96 };
95 97
96 } // namespace blink 98 } // namespace blink
97 99
98 #endif // ComputedStyleBase_h 100 #endif // ComputedStyleBase_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698