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

Unified Diff: Source/core/html/parser/HTMLIdentifier.cpp

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 | « Source/core/html/parser/HTMLIdentifier.h ('k') | Source/core/html/parser/HTMLTreeBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLIdentifier.cpp
diff --git a/Source/core/html/parser/HTMLIdentifier.cpp b/Source/core/html/parser/HTMLIdentifier.cpp
index 9b91cfc276723168b5271ea677a92bed365baee5..4656afacc697518deb05c278940998da8acd1855 100644
--- a/Source/core/html/parser/HTMLIdentifier.cpp
+++ b/Source/core/html/parser/HTMLIdentifier.cpp
@@ -87,10 +87,11 @@ const StringImpl* HTMLIdentifier::asStringImpl() const
return m_string.impl();
}
-void HTMLIdentifier::addNames(const QualifiedName* const* names, unsigned namesCount)
+void HTMLIdentifier::addNames(const Vector<const QualifiedName*>& names)
{
IdentifierTable& table = identifierTable();
- for (unsigned i = 0; i < namesCount; ++i) {
+ size_t namesCount = names.size();
+ for (size_t i = 0; i < namesCount; ++i) {
StringImpl* name = names[i]->localName().impl();
unsigned hash = name->hash();
IdentifierTable::AddResult addResult = table.add(hash, name);
@@ -114,8 +115,12 @@ void HTMLIdentifier::init()
isInitialized = true;
// FIXME: We should atomize small whitespace (\n, \n\n, etc.)
- addNames(getHTMLTags(), HTMLTagsCount);
- addNames(getHTMLAttrs(), HTMLAttrsCount);
+ Vector<const QualifiedName*> HTMLTags;
+ getHTMLTags(HTMLTags);
+ addNames(HTMLTags);
+ Vector<const QualifiedName*> HTMLAttrs;
+ getHTMLAttrs(HTMLAttrs);
+ addNames(HTMLAttrs);
}
}
« no previous file with comments | « Source/core/html/parser/HTMLIdentifier.h ('k') | Source/core/html/parser/HTMLTreeBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698