OLD | NEW |
1 {% from "macros.tmpl" import license %} | 1 {% from "macros.tmpl" import license %} |
2 {{ license() }} | 2 {{ license() }} |
3 | 3 |
4 #include "{{namespace}}ElementFactory.h" | 4 #include "{{namespace}}ElementFactory.h" |
5 | 5 |
6 #include "{{namespace}}Names.h" | 6 #include "{{namespace}}Names.h" |
7 {% for tag in tags|groupby('interface') %} | 7 {% for tag in tags|groupby('interface') %} |
8 #include "core/{{namespace|lower}}/{{tag[0]}}.h" | 8 #include "core/{{namespace|lower}}/{{tag[0]}}.h" |
9 {% endfor %} | 9 {% endfor %} |
10 {% if fallback_interface %} | 10 {% if fallback_interface %} |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 ); | 47 ); |
48 } | 48 } |
49 {% endfor %} | 49 {% endfor %} |
50 | 50 |
51 struct Create{{namespace}}FunctionMapData { | 51 struct Create{{namespace}}FunctionMapData { |
52 const QualifiedName& tag; | 52 const QualifiedName& tag; |
53 ConstructorFunction func; | 53 ConstructorFunction func; |
54 }; | 54 }; |
55 | 55 |
56 static void create{{namespace}}FunctionMap() { | 56 static void create{{namespace}}FunctionMap() { |
57 ASSERT(!g_constructors); | 57 DCHECK(!g_constructors); |
58 g_constructors = new FunctionMap; | 58 g_constructors = new FunctionMap; |
59 // Empty array initializer lists are illegal [dcl.init.aggr] and will not | 59 // Empty array initializer lists are illegal [dcl.init.aggr] and will not |
60 // compile in MSVC. If tags list is empty, add check to skip this. | 60 // compile in MSVC. If tags list is empty, add check to skip this. |
61 static const Create{{namespace}}FunctionMapData data[] = { | 61 static const Create{{namespace}}FunctionMapData data[] = { |
62 {% for tag in tags|sort if not tag.noConstructor %} | 62 {% for tag in tags|sort if not tag.noConstructor %} |
63 { {{tag|symbol}}Tag, {{tag|symbol}}Constructor }, | 63 { {{tag|symbol}}Tag, {{tag|symbol}}Constructor }, |
64 {% endfor %} | 64 {% endfor %} |
65 }; | 65 }; |
66 for (size_t i = 0; i < WTF_ARRAY_LENGTH(data); i++) | 66 for (size_t i = 0; i < WTF_ARRAY_LENGTH(data); i++) |
67 g_constructors->Set(data[i].tag.LocalName(), data[i].func); | 67 g_constructors->Set(data[i].tag.LocalName(), data[i].func); |
(...skipping 27 matching lines...) Expand all Loading... |
95 Element* element = document.RegistrationContext()->CreateCustomTagElement( | 95 Element* element = document.RegistrationContext()->CreateCustomTagElement( |
96 document, QualifiedName(g_null_atom, localName, {{namespace_prefix}}Name
spaceURI)); | 96 document, QualifiedName(g_null_atom, localName, {{namespace_prefix}}Name
spaceURI)); |
97 SECURITY_DCHECK(element->Is{{namespace}}Element()); | 97 SECURITY_DCHECK(element->Is{{namespace}}Element()); |
98 return To{{namespace}}Element(element); | 98 return To{{namespace}}Element(element); |
99 } | 99 } |
100 | 100 |
101 return {{fallback_interface}}::Create(QualifiedName(g_null_atom, localName, {{
namespace_prefix}}NamespaceURI), document); | 101 return {{fallback_interface}}::Create(QualifiedName(g_null_atom, localName, {{
namespace_prefix}}NamespaceURI), document); |
102 } | 102 } |
103 | 103 |
104 } // namespace blink | 104 } // namespace blink |
OLD | NEW |