OLD | NEW |
1 {% from 'macros.tmpl' import license %} | 1 {% from 'macros.tmpl' import license %} |
2 {{license()}} | 2 {{license()}} |
3 | 3 |
4 {% if suffix == 'Modules' %} | 4 {% if suffix == 'Modules' %} |
5 #include "modules/{{namespace}}{{suffix}}Factory.h" | 5 #include "modules/{{namespace}}{{suffix}}Factory.h" |
6 {% else %} | 6 {% else %} |
7 #include "core/events/{{namespace}}Factory.h" | 7 #include "core/events/{{namespace}}Factory.h" |
8 {% endif %} | 8 {% endif %} |
9 | 9 |
10 #include "{{namespace}}{{suffix}}Headers.h" | 10 #include "{{namespace}}{{suffix}}Headers.h" |
11 #include "core/frame/Deprecation.h" | 11 #include "core/frame/Deprecation.h" |
12 #include "platform/RuntimeEnabledFeatures.h" | 12 #include "platform/RuntimeEnabledFeatures.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 {{namespace}}* {{namespace}}{{suffix}}Factory::create(ExecutionContext* executio
nContext, const String& type) | 16 {{namespace}}* {{namespace}}{{suffix}}Factory::create(ExecutionContext* executio
nContext, const String& type) |
17 { | 17 { |
18 {% for event in events %} | 18 {% for event in events if event|script_name|create_event_whitelist or event|
script_name|create_event_legacy_whitelist %} |
19 {% if event|script_name|create_event_whitelist %} | 19 {% if event|script_name|create_event_whitelist %} |
20 if (equalIgnoringCase(type, "{{event|script_name}}"){% if event.RuntimeEnabl
ed %} && RuntimeEnabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif
%}) { | 20 if (equalIgnoringCase(type, "{{event|script_name}}"){% if event.RuntimeEnabl
ed %} && RuntimeEnabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif
%}) { |
21 {% else %} | 21 {% else %} |
22 if (type == "{{event|script_name}}"{% if event.RuntimeEnabled %} && RuntimeE
nabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif %}) { | 22 if (type == "{{event|script_name}}"{% if event.RuntimeEnabled %} && RuntimeE
nabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif %}) { |
23 {% endif %} | 23 {% endif %} |
24 {% if not event|script_name|create_event_whitelist %} | 24 {% if not event|script_name|create_event_whitelist %} |
25 UseCounter::count(executionContext, UseCounter::{{event|script_name|meas
ure_name}}); | 25 UseCounter::count(executionContext, UseCounter::{{event|script_name|meas
ure_name}}); |
26 {% endif %} | 26 {% endif %} |
27 return {{event|cpp_name}}::create(); | 27 return {{event|cpp_name}}::create(); |
28 } | 28 } |
29 {% endfor %} | 29 {% endfor %} |
30 return nullptr; | 30 return nullptr; |
31 } | 31 } |
32 | 32 |
33 } // namespace blink | 33 } // namespace blink |
OLD | NEW |