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

Side by Side Diff: Source/core/dom/EventFactory.cpp.tmpl

Issue 14905002: Use jinja2 templating engine for Python code generators (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 7 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
(Empty)
1 {% from "macros.tmpl" import wrap_with_condition -%}
2
3 {{ license }}
4 #include "config.h"
5 #include "EventFactory.h"
6
7 #include "EventHeaders.h"
8 #include "RuntimeEnabledFeatures.h"
9
10 namespace WebCore {
11
12 PassRefPtr<{{namespace}}> {{namespace}}Factory::create(const String& type)
13 {
14 {%- for event in events %}
15 {%- call wrap_with_condition(event.conditional) %}
16 if (type == "{{event.name}}"
17 {{- " && RuntimeEnabledFeatures::" + event.runtimeConditional + "()" if event.runtimeConditional else "" -}}
18 )
19 return {{event.interfaceName}}::create();
20 {%- endcall %}
21 {%- endfor %}
22 return 0;
23 }
24
25 } // namespace WebCore
26
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698