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

Side by Side Diff: Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl

Issue 552733002: bindings: Cleans up V8{HTML,SVG}ElementWrapperFactory. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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
(Empty)
1 {% from "macros.tmpl" import license %}
2 {{ license() }}
3
4 #include "config.h"
5 #include "V8{{namespace}}ElementWrapperFactory.h"
6
7 #include "{{namespace}}Names.h"
8 {% for tag in tags|sort if tag.has_js_interface %}
9 #include "bindings/core/v8/V8{{tag.interface}}.h"
10 {% endfor %}
11 {% for tag in tags|sort if tag.has_js_interface %}
12 #include "core/{{namespace|lower}}/{{tag.js_interface}}.h"
13 {% endfor %}
14 #include "core/{{namespace|lower}}/{{fallback_js_interface}}.h"
15 #include "core/dom/Document.h"
16 #include "core/frame/Settings.h"
17 #include "platform/RuntimeEnabledFeatures.h"
18 #include "wtf/StdLibExtras.h"
19
20 namespace blink {
21
22 using namespace {{namespace}}Names;
23
24 const WrapperTypeInfo* findWrapperTypeFor{{namespace}}TagName(const AtomicString & name)
25 {
26 typedef HashMap<StringImpl*, const WrapperTypeInfo*> NameTypeMap;
27 DEFINE_STATIC_LOCAL(NameTypeMap, map, ());
28 if (map.isEmpty()) {
29 // FIXME: This seems wrong. We should list every interface here, not
30 // just the ones that have specialized JavaScript interfaces.
31 {% for tag in tags|sort if tag.has_js_interface %}
32 {% filter enable_conditional(tag.Conditional) %}
33 map.set({{tag|symbol}}Tag.localName().impl(), &V8{{tag.js_interface}}::w rapperTypeInfo);
34 {% endfilter %}
35 {% endfor %}
36 }
37
38 if (const WrapperTypeInfo* result = map.get(name.impl()))
39 return result;
40
41 return &V8{{fallback_js_interface}}::wrapperTypeInfo;
42 }
43
44 } // namespace blink
OLDNEW
« no previous file with comments | « Source/build/scripts/scripts.gypi ('k') | Source/build/scripts/templates/ElementWrapperFactory.h.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698