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

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

Issue 2201633002: Remove unused function template overloads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 %} 1 {% from "macros.tmpl" import license %}
2 {{ license() }} 2 {{ license() }}
3 3
4 #ifndef {{namespace}}ElementTypeHelpers_h 4 #ifndef {{namespace}}ElementTypeHelpers_h
5 #define {{namespace}}ElementTypeHelpers_h 5 #define {{namespace}}ElementTypeHelpers_h
6 6
7 #include "core/dom/Element.h" 7 #include "core/dom/Element.h"
8 #include "{{namespace}}Names.h" 8 #include "{{namespace}}Names.h"
9 #include "platform/RuntimeEnabledFeatures.h" 9 #include "platform/RuntimeEnabledFeatures.h"
10 10
11 namespace blink { 11 namespace blink {
12 // Type checking. 12 // Type checking.
13 {% for tag in tags|sort if not tag.multipleTagNames and not tag.noTypeHelpers %} 13 {% for tag in tags|sort if not tag.multipleTagNames and not tag.noTypeHelpers %}
14 class {{tag.interface}}; 14 class {{tag.interface}};
15 void is{{tag.interface}}(const {{tag.interface}}&); // Catch unnecessary runtime check of type known at compile time. 15 void is{{tag.interface}}(const {{tag.interface}}&); // Catch unnecessary runtime check of type known at compile time.
16 void is{{tag.interface}}(const {{tag.interface}}*); // Catch unnecessary runtime check of type known at compile time. 16 void is{{tag.interface}}(const {{tag.interface}}*); // Catch unnecessary runtime check of type known at compile time.
17 17
18 inline bool is{{tag.interface}}(const {{namespace}}Element& element) { 18 inline bool is{{tag.interface}}(const {{namespace}}Element& element) {
19 {% if tag.runtimeEnabled %} 19 {% if tag.runtimeEnabled %}
20 if (!RuntimeEnabledFeatures::{{tag.runtimeEnabled}}Enabled()) 20 if (!RuntimeEnabledFeatures::{{tag.runtimeEnabled}}Enabled())
21 return false; 21 return false;
22 {% endif %} 22 {% endif %}
23 return element.hasTagName({{namespace}}Names::{{tag|symbol}}Tag); 23 return element.hasTagName({{namespace}}Names::{{tag|symbol}}Tag);
24 } 24 }
25 inline bool is{{tag.interface}}(const {{namespace}}Element* element) { return el ement && is{{tag.interface}}(*element); } 25 inline bool is{{tag.interface}}(const {{namespace}}Element* element) { return el ement && is{{tag.interface}}(*element); }
26 template<typename T> inline bool is{{tag.interface}}(const PassRefPtr<T>& node) { return is{{tag.interface}}(node.get()); }
27 template<typename T> inline bool is{{tag.interface}}(const RefPtr<T>& node) { re turn is{{tag.interface}}(node.get()); }
28 inline bool is{{tag.interface}}(const Node& node) { return node.is{{namespace}}E lement() && is{{tag.interface}}(to{{namespace}}Element(node)); } 26 inline bool is{{tag.interface}}(const Node& node) { return node.is{{namespace}}E lement() && is{{tag.interface}}(to{{namespace}}Element(node)); }
29 inline bool is{{tag.interface}}(const Node* node) { return node && is{{tag.inter face}}(*node); } 27 inline bool is{{tag.interface}}(const Node* node) { return node && is{{tag.inter face}}(*node); }
30 template <> inline bool isElementOfType<const {{tag.interface}}>(const Node& nod e) { return is{{tag.interface}}(node); } 28 template <> inline bool isElementOfType<const {{tag.interface}}>(const Node& nod e) { return is{{tag.interface}}(node); }
31 template <> inline bool isElementOfType<const {{tag.interface}}>(const {{namespa ce}}Element& element) { return is{{tag.interface}}(element); } 29 template <> inline bool isElementOfType<const {{tag.interface}}>(const {{namespa ce}}Element& element) { return is{{tag.interface}}(element); }
32 30
33 {% endfor %} 31 {% endfor %}
34 // Using macros because the types are forward-declared and we don't want to use reinterpret_cast in the 32 // Using macros because the types are forward-declared and we don't want to use reinterpret_cast in the
35 // casting functions above. reinterpret_cast would be unsafe due to multiple inh eritence. 33 // casting functions above. reinterpret_cast would be unsafe due to multiple inh eritence.
36 34
37 {% for tag in tags|sort if not tag.multipleTagNames and not tag.noTypeHelpers %} 35 {% for tag in tags|sort if not tag.multipleTagNames and not tag.noTypeHelpers %}
38 #define to{{tag.interface}}(x) blink::toElement<blink::{{tag.interface}}>(x) 36 #define to{{tag.interface}}(x) blink::toElement<blink::{{tag.interface}}>(x)
39 {% endfor %} 37 {% endfor %}
40 } // namespace blink 38 } // namespace blink
41 39
42 #endif 40 #endif
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