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

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

Issue 297103002: Move modules-dependent Event code out of core. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaseline Created 6 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
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 {% if suffix == "Modules" %}
Nils Barth (inactive) 2014/05/27 06:01:27 Style: single quotes in Python code.
c.shu 2014/05/27 15:28:02 Done.
6 #include "modules/{{namespace}}{{suffix}}Factory.h"
Nils Barth (inactive) 2014/05/27 06:01:27 Should we have modules/events/{{namespace}}{{suffi
c.shu 2014/05/27 15:28:02 Sounds good, Nils. Is it Ok I move all event relat
Nils Barth (inactive) 2014/05/28 00:58:07 Yup, that's fine!
7 {% else %}
5 #include "core/events/{{namespace}}Factory.h" 8 #include "core/events/{{namespace}}Factory.h"
9 {% endif %}
6 10
7 #include "{{namespace}}{{suffix}}Headers.h" 11 #include "{{namespace}}{{suffix}}Headers.h"
8 #include "RuntimeEnabledFeatures.h" 12 #include "RuntimeEnabledFeatures.h"
9 13
10 namespace WebCore { 14 namespace WebCore {
11 15
12 PassRefPtrWillBeRawPtr<{{namespace}}> {{namespace}}{{suffix}}Factory::create(con st String& type) 16 PassRefPtrWillBeRawPtr<{{namespace}}> {{namespace}}{{suffix}}Factory::create(con st String& type)
13 { 17 {
14 {% for event in events %} 18 {% for event in events %}
15 {% filter enable_conditional(event.Conditional) %} 19 {% filter enable_conditional(event.Conditional) %}
16 {% if event|script_name|case_insensitive_matching %} 20 {% if event|script_name|case_insensitive_matching %}
17 if (equalIgnoringCase(type, "{{event|script_name}}"){% if event.RuntimeEnabl ed %} && RuntimeEnabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif %}) 21 if (equalIgnoringCase(type, "{{event|script_name}}"){% if event.RuntimeEnabl ed %} && RuntimeEnabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif %})
18 {% else %} 22 {% else %}
19 if (type == "{{event|script_name}}"{% if event.RuntimeEnabled %} && RuntimeE nabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif %}) 23 if (type == "{{event|script_name}}"{% if event.RuntimeEnabled %} && RuntimeE nabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif %})
20 {% endif %} 24 {% endif %}
21 return {{event|cpp_name}}::create(); 25 return {{event|cpp_name}}::create();
22 {% endfilter %} 26 {% endfilter %}
23 {% endfor %} 27 {% endfor %}
24 return nullptr; 28 return nullptr;
25 } 29 }
26 30
27 } // namespace WebCore 31 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698