Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / build / scripts / templates / MakeNames.cpp.tmpl
1 {% from "macros.tmpl" import license %}
2 {{ license() }}
3
4 #include "config.h"
5
6 #ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC
7 #define {{namespace|to_macro_style}}_NAMES_HIDE_GLOBALS 1
8 #endif
9
10 #include "{{namespace}}Names.h"
11
12 #include "wtf/StaticConstructors.h"
13
14 namespace WebCore {
15 namespace {{namespace}}Names {
16
17 using namespace WTF;
18
19 {% for entry in entries|sort %}
20 {% if export %}
21 DEFINE_GLOBAL(AtomicString, {{entry|symbol}}Storage)
22 {{export}} const AtomicString& {{entry|symbol}} = *reinterpret_cast<const AtomicString*>(&{{entry|symbol}}Storage);
23 {% else %}
24 DEFINE_GLOBAL(AtomicString, {{entry|symbol}})
25 {% endif %}
26 {% endfor %}
27
28 void init()
29 {
30     {% for entry in entries|sort %}
31     StringImpl* {{entry|symbol}}Impl = StringImpl::createStatic("{{entry|cpp_name}}", {{entry|cpp_name|length}}, {{entry|cpp_name|hash}});
32     {% endfor %}
33
34     {% for entry in entries|sort %}
35     new ((void*)&{{entry|symbol}}) AtomicString({{entry|symbol}}Impl);
36     {% endfor %}
37 }
38
39 } // {{namespace}}
40 } // WebCore