Changeset 204061 in webkit
- Timestamp:
- Aug 2, 2016 7:20:40 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r204009 r204061 1 2016-08-02 Benjamin Poulain <bpoulain@apple.com> 2 3 Clean up some useless AtomicString atoms 4 https://bugs.webkit.org/show_bug.cgi?id=160471 5 6 Reviewed by Geoffrey Garen. 7 8 * wtf/text/AtomicString.h: 9 * wtf/text/StringStatics.cpp: 10 (WTF::AtomicString::init): Deleted. 11 1 12 2016-08-01 Benjamin Poulain <bpoulain@apple.com> 2 13 -
trunk/Source/WTF/wtf/text/AtomicString.h
r203147 r204061 307 307 extern const WTF_EXPORTDATA AtomicString nullAtom; 308 308 extern const WTF_EXPORTDATA AtomicString emptyAtom; 309 extern const WTF_EXPORTDATA AtomicString textAtom;310 extern const WTF_EXPORTDATA AtomicString commentAtom;311 309 extern const WTF_EXPORTDATA AtomicString starAtom; 312 310 extern const WTF_EXPORTDATA AtomicString xmlAtom; 313 311 extern const WTF_EXPORTDATA AtomicString xmlnsAtom; 314 extern const WTF_EXPORTDATA AtomicString xlinkAtom;315 312 316 313 inline AtomicString AtomicString::fromUTF8(const char* characters, size_t length) … … 370 367 using WTF::nullAtom; 371 368 using WTF::emptyAtom; 372 using WTF::textAtom;373 using WTF::commentAtom;374 369 using WTF::starAtom; 375 370 using WTF::xmlAtom; 376 371 using WTF::xmlnsAtom; 377 using WTF::xlinkAtom;378 372 #endif 379 373 -
trunk/Source/WTF/wtf/text/StringStatics.cpp
r198168 r204061 70 70 WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, nullAtom) 71 71 WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, emptyAtom) 72 WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, textAtom)73 WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, commentAtom)74 72 WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, starAtom) 75 73 WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, xmlAtom) 76 74 WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, xmlnsAtom) 77 WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, xlinkAtom)78 75 79 76 NEVER_INLINE unsigned StringImpl::hashSlowCase() const … … 96 93 new (NotNull, (void*)&nullAtom) AtomicString; 97 94 new (NotNull, (void*)&emptyAtom) AtomicString(""); 98 new (NotNull, (void*)&textAtom) AtomicString("#text", AtomicString::ConstructFromLiteral);99 new (NotNull, (void*)&commentAtom) AtomicString("#comment", AtomicString::ConstructFromLiteral);100 95 new (NotNull, (void*)&starAtom) AtomicString("*", AtomicString::ConstructFromLiteral); 101 96 new (NotNull, (void*)&xmlAtom) AtomicString("xml", AtomicString::ConstructFromLiteral); 102 97 new (NotNull, (void*)&xmlnsAtom) AtomicString("xmlns", AtomicString::ConstructFromLiteral); 103 new (NotNull, (void*)&xlinkAtom) AtomicString("xlink", AtomicString::ConstructFromLiteral);104 98 105 99 initialized = true; -
trunk/Source/WebCore/ChangeLog
r204054 r204061 1 2016-08-02 Benjamin Poulain <bpoulain@apple.com> 2 3 Clean up some useless AtomicString atoms 4 https://bugs.webkit.org/show_bug.cgi?id=160471 5 6 Reviewed by Geoffrey Garen. 7 8 The only uses of "commentAtom" and "textAtom" where for their 9 respective overload of Node::nodeName(). 10 Those methods return a string, we should not keep them in the atomic 11 string table just to hold a small String alive. They were also the only 12 two nodes to behave that way. 13 14 The atom xlinkAtom was only used by createForeignAttributesMap(), which 15 is itself only invoked once. There is no need for the symbol xlinkAtom. 16 17 * dom/CDATASection.cpp: 18 (WebCore::CDATASection::nodeName): 19 * dom/Comment.cpp: 20 (WebCore::Comment::nodeName): 21 * dom/Document.cpp: 22 (WebCore::Document::nodeName): 23 * dom/Text.cpp: 24 (WebCore::Text::nodeName): 25 * html/parser/HTMLTreeBuilder.cpp: 26 (WebCore::createForeignAttributesMap): 27 1 28 2016-08-02 Anders Carlsson <andersca@apple.com> 2 29 -
trunk/Source/WebCore/dom/CDATASection.cpp
r189576 r204061 39 39 String CDATASection::nodeName() const 40 40 { 41 return "#cdata-section";41 return ASCIILiteral("#cdata-section"); 42 42 } 43 43 -
trunk/Source/WebCore/dom/Comment.cpp
r189576 r204061 39 39 String Comment::nodeName() const 40 40 { 41 return commentAtom.string();41 return ASCIILiteral("#comment"); 42 42 } 43 43 -
trunk/Source/WebCore/dom/Document.cpp
r203971 r204061 1750 1750 String Document::nodeName() const 1751 1751 { 1752 return "#document";1752 return ASCIILiteral("#document"); 1753 1753 } 1754 1754 -
trunk/Source/WebCore/dom/Text.cpp
r200696 r204061 161 161 String Text::nodeName() const 162 162 { 163 return textAtom.string();163 return ASCIILiteral("#text"); 164 164 } 165 165 -
trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp
r203302 r204061 576 576 HashMap<AtomicString, QualifiedName> map; 577 577 578 addNamesWithPrefix(map, xlinkAtom, XLinkNames::getXLinkAttrs(), XLinkNames::XLinkAttrsCount); 578 AtomicString xlinkName("xlink", AtomicString::ConstructFromLiteral); 579 addNamesWithPrefix(map, xlinkName, XLinkNames::getXLinkAttrs(), XLinkNames::XLinkAttrsCount); 579 580 addNamesWithPrefix(map, xmlAtom, XMLNames::getXMLAttrs(), XMLNames::XMLAttrsCount); 580 581 581 582 map.add(WTF::xmlnsAtom, XMLNSNames::xmlnsAttr); 582 map.add("xmlns:xlink", QualifiedName(xmlnsAtom, xlink Atom, XMLNSNames::xmlnsNamespaceURI));583 map.add("xmlns:xlink", QualifiedName(xmlnsAtom, xlinkName, XMLNSNames::xmlnsNamespaceURI)); 583 584 584 585 return map;
Note: See TracChangeset
for help on using the changeset viewer.