Chromium Code Reviews| 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..e652c464c9ec772094204726ce3680d5cb44b0bb 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() |
| +PassOwnPtr<const QualifiedName*[]> get{{namespace}}Tags() |
| { |
| - static const WebCore::QualifiedName* const {{namespace}}Tags[] = { |
| + const QualifiedName** tags = new const QualifiedName*[{{namespace}}TagsCount]; |
|
Inactive
2014/01/16 14:37:47
We usually adopt as soon as we allocate.
|
| {%- for tag in tags|sort %} |
| - (WebCore::QualifiedName*)&{{tag|symbol}}Tag, |
| + tags[{{loop.index0}}] = (WebCore::QualifiedName*)&{{tag|symbol}}Tag; |
| {%- endfor %} |
| - }; |
| - return {{namespace}}Tags; |
| + return adoptArrayPtr(tags); |
|
Inactive
2014/01/16 14:37:47
Then release() when returning.
|
| } |
| {%- 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() |
| +PassOwnPtr<const QualifiedName*[]> get{{namespace}}Attrs() |
| { |
| - static const WebCore::QualifiedName* const {{namespace}}Attrs[] = { |
| + const QualifiedName** attrs = new const QualifiedName*[{{namespace}}AttrsCount]; |
|
Inactive
2014/01/16 14:37:47
Ditto.
|
| {%- for attr in attrs|sort %} |
| - (WebCore::QualifiedName*)&{{attr|symbol}}Attr, |
| + attrs[{{loop.index0}}] = (WebCore::QualifiedName*)&{{attr|symbol}}Attr; |
| {%- endfor %} |
| - }; |
| - return {{namespace}}Attrs; |
| + return adoptArrayPtr(attrs); |
| } |
| void init() |