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

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

Issue 40433002: Make wrapperTypeInfo static member const in bindings classes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 2 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
OLDNEW
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 #include "V8{{namespace}}ElementWrapperFactory.h" 5 #include "V8{{namespace}}ElementWrapperFactory.h"
6 6
7 #include "RuntimeEnabledFeatures.h" 7 #include "RuntimeEnabledFeatures.h"
8 #include "{{namespace}}Names.h" 8 #include "{{namespace}}Names.h"
9 #include "bindings/v8/CustomElementWrapper.h" 9 #include "bindings/v8/CustomElementWrapper.h"
10 {%- for tag in tags|sort if tag.has_js_interface %} 10 {%- for tag in tags|sort if tag.has_js_interface %}
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 if (createWrapperFunction) 66 if (createWrapperFunction)
67 return createWrapperFunction(element, creationContext, isolate); 67 return createWrapperFunction(element, creationContext, isolate);
68 {%- if fallback_js_interface == namespace + "Element" %} 68 {%- if fallback_js_interface == namespace + "Element" %}
69 return V8{{fallback_js_interface}}::createWrapper(element, creationContext, isolate); 69 return V8{{fallback_js_interface}}::createWrapper(element, creationContext, isolate);
70 {%- else %} 70 {%- else %}
71 return wrap(to{{fallback_js_interface}}(element), creationContext, isolate); 71 return wrap(to{{fallback_js_interface}}(element), creationContext, isolate);
72 {%- endif %} 72 {%- endif %}
73 } 73 }
74 74
75 WrapperTypeInfo* findWrapperTypeFor{{namespace}}TagName(const AtomicString& name ) 75 const WrapperTypeInfo* findWrapperTypeFor{{namespace}}TagName(const AtomicString & name)
76 { 76 {
77 typedef HashMap<StringImpl*, WrapperTypeInfo*> NameTypeMap; 77 typedef HashMap<StringImpl*, const WrapperTypeInfo*> NameTypeMap;
78 DEFINE_STATIC_LOCAL(NameTypeMap, map, ()); 78 DEFINE_STATIC_LOCAL(NameTypeMap, map, ());
79 if (map.isEmpty()) { 79 if (map.isEmpty()) {
80 // FIXME: This seems wrong. We should list every interface here, not 80 // FIXME: This seems wrong. We should list every interface here, not
81 // just the ones that have specialized JavaScript interfaces. 81 // just the ones that have specialized JavaScript interfaces.
82 {%- for tag in tags|sort if tag.has_js_interface %} 82 {%- for tag in tags|sort if tag.has_js_interface %}
83 map.set({{tag|symbol}}Tag.localName().impl(), WrapperTypeTraits<{{tag.js _interface}}>::wrapperTypeInfo()); 83 map.set({{tag|symbol}}Tag.localName().impl(), WrapperTypeTraits<{{tag.js _interface}}>::wrapperTypeInfo());
84 {%- endfor %} 84 {%- endfor %}
85 } 85 }
86 86
87 if (WrapperTypeInfo* result = map.get(name.impl())) 87 if (const WrapperTypeInfo* result = map.get(name.impl()))
88 return result; 88 return result;
89 89
90 return WrapperTypeTraits<{{fallback_js_interface}}>::wrapperTypeInfo(); 90 return WrapperTypeTraits<{{fallback_js_interface}}>::wrapperTypeInfo();
91 } 91 }
92 92
93 } 93 }
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8TypedArrayCustom.h ('k') | Source/build/scripts/templates/ElementWrapperFactory.h.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698