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

Unified Diff: Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl

Issue 330093002: Add support in generate scripts to handle Conditional (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: sort by alpha Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl
diff --git a/Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl b/Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl
index 71ff72d986a8c121f8e0b5c1c920adb1c049d512..31c614e5b65312b4a3e5818c97989155aa2c8e34 100644
--- a/Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl
+++ b/Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl
@@ -31,6 +31,7 @@ static v8::Handle<v8::Object> create{{namespace}}ElementWrapper({{namespace}}Ele
return v8::Handle<v8::Object>();
}
{% for js_interface, list in tags|sort|selectattr('has_js_interface')|groupby('js_interface') %}
+{% filter enable_conditional(list[0].Conditional) %}
static v8::Handle<v8::Object> create{{js_interface}}Wrapper({{namespace}}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
{% if list[0].contextConditional %}
@@ -43,6 +44,7 @@ static v8::Handle<v8::Object> create{{js_interface}}Wrapper({{namespace}}Element
{% endif %}
return wrap(static_cast<{{js_interface}}*>(element), creationContext, isolate);
}
+{% endfilter %}
{% endfor %}
v8::Handle<v8::Object> createV8{{namespace}}Wrapper({{namespace}}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
@@ -51,7 +53,9 @@ v8::Handle<v8::Object> createV8{{namespace}}Wrapper({{namespace}}Element* elemen
DEFINE_STATIC_LOCAL(FunctionMap, map, ());
if (map.isEmpty()) {
{% for tag in tags|sort %}
+ {% filter enable_conditional(tag.Conditional) %}
map.set({{tag|symbol}}Tag.localName().impl(), create{{tag.js_interface}}Wrapper);
+ {% endfilter %}
{% endfor %}
}
@@ -78,7 +82,9 @@ const WrapperTypeInfo* findWrapperTypeFor{{namespace}}TagName(const AtomicString
// FIXME: This seems wrong. We should list every interface here, not
// just the ones that have specialized JavaScript interfaces.
{% for tag in tags|sort if tag.has_js_interface %}
+ {% filter enable_conditional(tag.Conditional) %}
map.set({{tag|symbol}}Tag.localName().impl(), &V8{{tag.js_interface}}::wrapperTypeInfo);
+ {% endfilter %}
{% endfor %}
}
« no previous file with comments | « Source/build/scripts/templates/ElementTypeHelpers.h.tmpl ('k') | Source/build/scripts/templates/MakeNames.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698