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: Source/build/scripts/templates/ElementTypeHelpers.h.tmpl

Issue 424983002: Stop using WebCore namespace in generated code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
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/ContextFeatures.h" 7 #include "core/dom/ContextFeatures.h"
8 #include "core/dom/Element.h" 8 #include "core/dom/Element.h"
9 #include "{{namespace}}Names.h" 9 #include "{{namespace}}Names.h"
10 #include "platform/RuntimeEnabledFeatures.h" 10 #include "platform/RuntimeEnabledFeatures.h"
11 11
12 namespace WebCore { 12 namespace blink {
13 // Type checking. 13 // Type checking.
14 {% for tag in tags|sort if not tag.multipleTagNames and not tag.noTypeHelpers %} 14 {% for tag in tags|sort if not tag.multipleTagNames and not tag.noTypeHelpers %}
15 {% filter enable_conditional(tag.Conditional) %} 15 {% filter enable_conditional(tag.Conditional) %}
16 class {{tag.interface}}; 16 class {{tag.interface}};
17 void is{{tag.interface}}(const {{tag.interface}}&); // Catch unnecessary runtime check of type known at compile time. 17 void is{{tag.interface}}(const {{tag.interface}}&); // Catch unnecessary runtime check of type known at compile time.
18 void is{{tag.interface}}(const {{tag.interface}}*); // Catch unnecessary runtime check of type known at compile time. 18 void is{{tag.interface}}(const {{tag.interface}}*); // Catch unnecessary runtime check of type known at compile time.
19 19
20 inline bool is{{tag.interface}}(const {{namespace}}Element& element) { 20 inline bool is{{tag.interface}}(const {{namespace}}Element& element) {
21 {% if tag.contextConditional %} 21 {% if tag.contextConditional %}
22 if (!ContextFeatures::{{tag.contextConditional}}Enabled(&element.document()) ) 22 if (!ContextFeatures::{{tag.contextConditional}}Enabled(&element.document()) )
(...skipping 13 matching lines...) Expand all
36 template <> inline bool isElementOfType<const {{tag.interface}}>(const Node& nod e) { return is{{tag.interface}}(node); } 36 template <> inline bool isElementOfType<const {{tag.interface}}>(const Node& nod e) { return is{{tag.interface}}(node); }
37 template <> inline bool isElementOfType<const {{tag.interface}}>(const {{namespa ce}}Element& element) { return is{{tag.interface}}(element); } 37 template <> inline bool isElementOfType<const {{tag.interface}}>(const {{namespa ce}}Element& element) { return is{{tag.interface}}(element); }
38 {% endfilter %} 38 {% endfilter %}
39 39
40 {% endfor %} 40 {% endfor %}
41 // Using macros because the types are forward-declared and we don't want to use reinterpret_cast in the 41 // Using macros because the types are forward-declared and we don't want to use reinterpret_cast in the
42 // casting functions above. reinterpret_cast would be unsafe due to multiple inh eritence. 42 // casting functions above. reinterpret_cast would be unsafe due to multiple inh eritence.
43 43
44 {% for tag in tags|sort if not tag.multipleTagNames and not tag.noTypeHelpers %} 44 {% for tag in tags|sort if not tag.multipleTagNames and not tag.noTypeHelpers %}
45 {% filter enable_conditional(tag.Conditional) %} 45 {% filter enable_conditional(tag.Conditional) %}
46 #define to{{tag.interface}}(x) WebCore::toElement<WebCore::{{tag.interface}}>(x) 46 #define to{{tag.interface}}(x) blink::toElement<blink::{{tag.interface}}>(x)
47 {% endfilter %} 47 {% endfilter %}
48 {% endfor %} 48 {% endfor %}
49 } // WebCore 49 } // namespace blink
50 50
51 #endif 51 #endif
OLDNEW
« no previous file with comments | « Source/build/scripts/templates/ElementLookupTrie.h.tmpl ('k') | Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698