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

Unified Diff: sky/engine/build/scripts/templates/ElementFactory.cpp.tmpl

Issue 1215103007: Remove remaining HTML elements (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | sky/engine/core/Init.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/build/scripts/templates/ElementFactory.cpp.tmpl
diff --git a/sky/engine/build/scripts/templates/ElementFactory.cpp.tmpl b/sky/engine/build/scripts/templates/ElementFactory.cpp.tmpl
index 2bf274ca58708bb96af5f5ae3aa47216ccd87207..849cef0978e8c67bdb2278896f321c49132431eb 100644
--- a/sky/engine/build/scripts/templates/ElementFactory.cpp.tmpl
+++ b/sky/engine/build/scripts/templates/ElementFactory.cpp.tmpl
@@ -26,8 +26,6 @@ typedef PassRefPtr<{{namespace}}Element> (*ConstructorFunction)(
typedef HashMap<AtomicString, ConstructorFunction> FunctionMap;
-static FunctionMap* g_constructors = 0;
-
{% for tag in tags|sort if not tag.noConstructor %}
{% filter enable_conditional(tag.Conditional) %}
static PassRefPtr<{{namespace}}Element> {{tag|symbol}}Constructor(
@@ -52,32 +50,11 @@ struct Create{{namespace}}FunctionMapData {
ConstructorFunction func;
};
-static void create{{namespace}}FunctionMap()
-{
- ASSERT(!g_constructors);
- g_constructors = new FunctionMap;
- // Empty array initializer lists are illegal [dcl.init.aggr] and will not
- // compile in MSVC. If tags list is empty, add check to skip this.
- static const Create{{namespace}}FunctionMapData data[] = {
- {% for tag in tags|sort if not tag.noConstructor %}
- {% filter enable_conditional(tag.Conditional) %}
- { {{tag|symbol}}Tag, {{tag|symbol}}Constructor },
- {% endfilter %}
- {% endfor %}
- };
- for (size_t i = 0; i < WTF_ARRAY_LENGTH(data); i++)
- g_constructors->set(data[i].tag.localName(), data[i].func);
-}
-
PassRefPtr<Element> {{namespace}}ElementFactory::createElement(
const AtomicString& localName,
Document& document,
bool createdByParser)
{
- if (!g_constructors)
- create{{namespace}}FunctionMap();
- if (ConstructorFunction function = g_constructors->get(localName))
- return function(document, createdByParser);
return document.elementRegistry().CreateElement(document, localName);
}
« no previous file with comments | « no previous file | sky/engine/core/Init.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698