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

Side by Side Diff: third_party/WebKit/Source/bindings/templates/union.h

Issue 1406923009: Rename DISALLOW_ALLOCATION and ALLOW_ONLY_INLINE_ALLOCATION (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 {% include 'copyright_block.txt' %} 1 {% include 'copyright_block.txt' %}
2 #ifndef {{macro_guard}} 2 #ifndef {{macro_guard}}
3 #define {{macro_guard}} 3 #define {{macro_guard}}
4 4
5 {% for filename in header_includes %} 5 {% for filename in header_includes %}
6 #include "{{filename}}" 6 #include "{{filename}}"
7 {% endfor %} 7 {% endfor %}
8 8
9 namespace blink { 9 namespace blink {
10 10
11 {% for decl in header_forward_decls %} 11 {% for decl in header_forward_decls %}
12 class {{decl}}; 12 class {{decl}};
13 {% endfor %} 13 {% endfor %}
14 14
15 {% for container in containers %} 15 {% for container in containers %}
16 class {{exported}}{{container.cpp_class}} final { 16 class {{exported}}{{container.cpp_class}} final {
17 ALLOW_ONLY_INLINE_ALLOCATION(); 17 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
18 public: 18 public:
19 {{container.cpp_class}}(); 19 {{container.cpp_class}}();
20 bool isNull() const { return m_type == SpecificTypeNone; } 20 bool isNull() const { return m_type == SpecificTypeNone; }
21 21
22 {% for member in container.members %} 22 {% for member in container.members %}
23 bool is{{member.type_name}}() const { return m_type == {{member.specific_typ e_enum}}; } 23 bool is{{member.type_name}}() const { return m_type == {{member.specific_typ e_enum}}; }
24 {{member.rvalue_cpp_type}} getAs{{member.type_name}}() const; 24 {{member.rvalue_cpp_type}} getAs{{member.type_name}}() const;
25 void set{{member.type_name}}({{member.rvalue_cpp_type}}); 25 void set{{member.type_name}}({{member.rvalue_cpp_type}});
26 static {{container.cpp_class}} from{{member.type_name}}({{member.rvalue_cpp_ type}}); 26 static {{container.cpp_class}} from{{member.type_name}}({{member.rvalue_cpp_ type}});
27 27
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 // We need to set canInitializeWithMemset=true because HeapVector supports 85 // We need to set canInitializeWithMemset=true because HeapVector supports
86 // items that can initialize with memset or have a vtable. It is safe to 86 // items that can initialize with memset or have a vtable. It is safe to
87 // set canInitializeWithMemset=true for a union type object in practice. 87 // set canInitializeWithMemset=true for a union type object in practice.
88 // See https://codereview.chromium.org/1118993002/#msg5 for more details. 88 // See https://codereview.chromium.org/1118993002/#msg5 for more details.
89 {% for container in containers %} 89 {% for container in containers %}
90 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::{{container.cpp_class}}); 90 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::{{container.cpp_class}});
91 {% endfor %} 91 {% endfor %}
92 92
93 #endif // {{macro_guard}} 93 #endif // {{macro_guard}}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698