Parser: Avoid unnecessary ref count churn in token constructors.
authorkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 May 2012 18:57:16 +0000 (18:57 +0000)
committerkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 May 2012 18:57:16 +0000 (18:57 +0000)
<http://webkit.org/b/86667>

Reviewed by Antti Koivisto.

Pass AtomicString by const reference to avoid useless ref count churn
in AtomicHTMLToken() and AtomicXMLToken().

* html/parser/HTMLToken.h:
(WebCore::AtomicHTMLToken::AtomicHTMLToken):
* xml/parser/MarkupTokenBase.h:
(WebCore::AtomicMarkupTokenBase::AtomicMarkupTokenBase):
* xml/parser/XMLToken.h:
(WebCore::AtomicXMLToken::AtomicXMLToken):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117473 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/parser/HTMLToken.h
Source/WebCore/xml/parser/MarkupTokenBase.h
Source/WebCore/xml/parser/XMLToken.h

index d2eaf8b..d440d10 100644 (file)
@@ -1,3 +1,20 @@
+2012-05-17  Andreas Kling  <kling@webkit.org>
+
+        Parser: Avoid unnecessary ref count churn in token constructors.
+        <http://webkit.org/b/86667>
+
+        Reviewed by Antti Koivisto.
+
+        Pass AtomicString by const reference to avoid useless ref count churn
+        in AtomicHTMLToken() and AtomicXMLToken().
+
+        * html/parser/HTMLToken.h:
+        (WebCore::AtomicHTMLToken::AtomicHTMLToken):
+        * xml/parser/MarkupTokenBase.h:
+        (WebCore::AtomicMarkupTokenBase::AtomicMarkupTokenBase):
+        * xml/parser/XMLToken.h:
+        (WebCore::AtomicXMLToken::AtomicXMLToken):
+
 2012-05-16  Andreas Kling  <kling@webkit.org>
 
         Make PluginInfoStore properly thread-safe.
index 4acfec9..3a87e22 100644 (file)
@@ -86,7 +86,7 @@ class AtomicHTMLToken : public AtomicMarkupTokenBase<HTMLToken> {
 public:
     AtomicHTMLToken(HTMLToken& token) : AtomicMarkupTokenBase<HTMLToken>(&token) { }
 
-    AtomicHTMLToken(HTMLTokenTypes::Type type, AtomicString name, const Vector<Attribute>& attributes = Vector<Attribute>())
+    AtomicHTMLToken(HTMLTokenTypes::Type type, const AtomicString& name, const Vector<Attribute>& attributes = Vector<Attribute>())
         : AtomicMarkupTokenBase<HTMLToken>(type, name, attributes)
     {
     }
index c962a6a..acb5d73 100644 (file)
@@ -409,7 +409,7 @@ public:
         }
     }
 
-    AtomicMarkupTokenBase(typename Token::Type::Type type, AtomicString name, const Vector<Attribute>& attributes = Vector<Attribute>())
+    AtomicMarkupTokenBase(typename Token::Type::Type type, const AtomicString& name, const Vector<Attribute>& attributes = Vector<Attribute>())
         : m_type(type)
         , m_name(name)
         , m_externalCharacters(0)
index ecf12b1..73b9b01 100644 (file)
@@ -431,7 +431,7 @@ public:
         }
     }
 
-    AtomicXMLToken(XMLTokenTypes::Type type, AtomicString name, const Vector<Attribute>& attributes = Vector<Attribute>())
+    AtomicXMLToken(XMLTokenTypes::Type type, const AtomicString& name, const Vector<Attribute>& attributes = Vector<Attribute>())
         : AtomicMarkupTokenBase<XMLToken>(type, name, attributes)
     {
     }