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

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

Issue 51983003: Stop using static arrays for *Tags / *Attrs (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month 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 | Source/build/scripts/templates/MakeQualifiedNames.h.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl
diff --git a/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl b/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl
index e6ff66955bfff4326bb67f4bfa05baa0da80727e..877bf329ade69ff746f96d656288a3ffd84f913a 100644
--- a/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl
+++ b/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl
@@ -28,14 +28,13 @@ DEFINE_GLOBAL(QualifiedName, {{tag|symbol}}Tag)
{%- endfor %}
-const WebCore::QualifiedName* const* get{{namespace}}Tags()
+void get{{namespace}}Tags(Vector<const WebCore::QualifiedName*>& tags)
{
- static const WebCore::QualifiedName* const {{namespace}}Tags[] = {
+ tags.clear();
+ tags.reserveCapacity({{namespace}}TagsCount);
{%- for tag in tags|sort %}
- (WebCore::QualifiedName*)&{{tag|symbol}}Tag,
+ tags.uncheckedAppend((WebCore::QualifiedName*)&{{tag|symbol}}Tag);
{%- endfor %}
- };
- return {{namespace}}Tags;
}
{%- endif %}
@@ -45,14 +44,13 @@ const WebCore::QualifiedName* const* get{{namespace}}Tags()
DEFINE_GLOBAL(QualifiedName, {{attr|symbol}}Attr)
{%- endfor %}
-const WebCore::QualifiedName* const* get{{namespace}}Attrs()
+void get{{namespace}}Attrs(Vector<const WebCore::QualifiedName*>& attrs)
{
- static const WebCore::QualifiedName* const {{namespace}}Attrs[] = {
+ attrs.clear();
+ attrs.reserveCapacity({{namespace}}AttrsCount);
{%- for attr in attrs|sort %}
- (WebCore::QualifiedName*)&{{attr|symbol}}Attr,
+ attrs.uncheckedAppend((WebCore::QualifiedName*)&{{attr|symbol}}Attr);
{%- endfor %}
- };
- return {{namespace}}Attrs;
}
void init()
« no previous file with comments | « no previous file | Source/build/scripts/templates/MakeQualifiedNames.h.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698