| OLD | NEW |
| 1 {% from "macros.tmpl" import license %} | 1 {% from "macros.tmpl" import license %} |
| 2 {{ license() }} | 2 {{ license() }} |
| 3 | 3 |
| 4 #include "config.h" | 4 #include "config.h" |
| 5 | 5 |
| 6 #include "{{namespace}}Names.h" | 6 #include "{{namespace}}Names.h" |
| 7 | 7 |
| 8 #include "wtf/StaticConstructors.h" | 8 #include "wtf/StaticConstructors.h" |
| 9 | 9 |
| 10 namespace WebCore { | 10 namespace blink { |
| 11 namespace {{namespace}}Names { | 11 namespace {{namespace}}Names { |
| 12 | 12 |
| 13 using namespace WebCore; | 13 using namespace blink; |
| 14 | 14 |
| 15 DEFINE_GLOBAL(AtomicString, {{namespace_prefix}}NamespaceURI) | 15 DEFINE_GLOBAL(AtomicString, {{namespace_prefix}}NamespaceURI) |
| 16 | 16 |
| 17 {% if tags %} | 17 {% if tags %} |
| 18 // Tags | 18 // Tags |
| 19 {% for tag in tags|sort %} | 19 {% for tag in tags|sort %} |
| 20 DEFINE_GLOBAL({{namespace}}QualifiedName, {{tag|symbol}}Tag) | 20 DEFINE_GLOBAL({{namespace}}QualifiedName, {{tag|symbol}}Tag) |
| 21 {% endfor %} | 21 {% endfor %} |
| 22 | 22 |
| 23 | 23 |
| 24 PassOwnPtr<const {{namespace}}QualifiedName*[]> get{{namespace}}Tags() | 24 PassOwnPtr<const {{namespace}}QualifiedName*[]> get{{namespace}}Tags() |
| 25 { | 25 { |
| 26 OwnPtr<const {{namespace}}QualifiedName*[]> tags = adoptArrayPtr(new const {
{namespace}}QualifiedName*[{{namespace}}TagsCount]); | 26 OwnPtr<const {{namespace}}QualifiedName*[]> tags = adoptArrayPtr(new const {
{namespace}}QualifiedName*[{{namespace}}TagsCount]); |
| 27 {% for tag in tags|sort %} | 27 {% for tag in tags|sort %} |
| 28 tags[{{loop.index0}}] = reinterpret_cast<const {{namespace}}QualifiedName*>(
&{{tag|symbol}}Tag); | 28 tags[{{loop.index0}}] = reinterpret_cast<const {{namespace}}QualifiedName*>(
&{{tag|symbol}}Tag); |
| 29 {% endfor %} | 29 {% endfor %} |
| 30 return tags.release(); | 30 return tags.release(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 {% endif %} | 33 {% endif %} |
| 34 // Attributes | 34 // Attributes |
| 35 {% for attr in attrs|sort %} | 35 {% for attr in attrs|sort %} |
| 36 DEFINE_GLOBAL(QualifiedName, {{attr|symbol}}Attr) | 36 DEFINE_GLOBAL(QualifiedName, {{attr|symbol}}Attr) |
| 37 {% endfor %} | 37 {% endfor %} |
| 38 | 38 |
| 39 PassOwnPtr<const QualifiedName*[]> get{{namespace}}Attrs() | 39 PassOwnPtr<const QualifiedName*[]> get{{namespace}}Attrs() |
| 40 { | 40 { |
| 41 OwnPtr<const QualifiedName*[]> attrs = adoptArrayPtr(new const QualifiedName
*[{{namespace}}AttrsCount]); | 41 OwnPtr<const QualifiedName*[]> attrs = adoptArrayPtr(new const QualifiedName
*[{{namespace}}AttrsCount]); |
| 42 {% for attr in attrs|sort %} | 42 {% for attr in attrs|sort %} |
| 43 attrs[{{loop.index0}}] = reinterpret_cast<const WebCore::QualifiedName*>(&{{
attr|symbol}}Attr); | 43 attrs[{{loop.index0}}] = reinterpret_cast<const blink::QualifiedName*>(&{{at
tr|symbol}}Attr); |
| 44 {% endfor %} | 44 {% endfor %} |
| 45 return attrs.release(); | 45 return attrs.release(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void init() | 48 void init() |
| 49 { | 49 { |
| 50 // Use placement new to initialize the globals. | 50 // Use placement new to initialize the globals. |
| 51 AtomicString {{namespace_prefix}}NS("{{namespace_uri}}", AtomicString::Const
ructFromLiteral); | 51 AtomicString {{namespace_prefix}}NS("{{namespace_uri}}", AtomicString::Const
ructFromLiteral); |
| 52 | 52 |
| 53 // Namespace | 53 // Namespace |
| (...skipping 11 matching lines...) Expand all Loading... |
| 65 {% for attr in attrs|sort %} | 65 {% for attr in attrs|sort %} |
| 66 {% if use_namespace_for_attrs %} | 66 {% if use_namespace_for_attrs %} |
| 67 QualifiedName::createStatic((void*)&{{attr|symbol}}Attr, {{attr|symbol}}Impl
, {{namespace_prefix}}NS); | 67 QualifiedName::createStatic((void*)&{{attr|symbol}}Attr, {{attr|symbol}}Impl
, {{namespace_prefix}}NS); |
| 68 {% else %} | 68 {% else %} |
| 69 QualifiedName::createStatic((void*)&{{attr|symbol}}Attr, {{attr|symbol}}Impl
); | 69 QualifiedName::createStatic((void*)&{{attr|symbol}}Attr, {{attr|symbol}}Impl
); |
| 70 {% endif %} | 70 {% endif %} |
| 71 {% endfor %} | 71 {% endfor %} |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // {{namespace}} | 74 } // {{namespace}} |
| 75 } // WebCore | 75 } // namespace blink |
| OLD | NEW |