2011-01-25 Dimitri Glazkov <dglazkov@chromium.org>
authordglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Jan 2011 23:26:36 +0000 (23:26 +0000)
committerdglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Jan 2011 23:26:36 +0000 (23:26 +0000)
        Reviewed by Kent Tamura.

        Reduce ref-count churn in shadowPseudoId.
        https://bugs.webkit.org/show_bug.cgi?id=53136

        Refactoring, so no new tests.

        * dom/Element.h:
        (WebCore::Element::shadowPseudoId): Changed signature to use const AtomicString&
        * html/ValidationMessage.cpp:
        (WebCore::ElementWithPseudoId::shadowPseudoId): Ditto.
        * html/shadow/SliderThumbElement.cpp:
        (WebCore::SliderThumbElement::shadowPseudoId): Ditto, plus moved from the header file.
        * html/shadow/SliderThumbElement.h: Ditto.
        * rendering/MediaControlElements.cpp:
        (WebCore::MediaControlMuteButtonElement::shadowPseudoId): Ditto.
        (WebCore::MediaControlVolumeSliderMuteButtonElement::shadowPseudoId): Ditto.
        (WebCore::MediaControlPlayButtonElement::shadowPseudoId): Ditto.
        (WebCore::MediaControlSeekForwardButtonElement::shadowPseudoId): Ditto.
        (WebCore::MediaControlSeekBackButtonElement::shadowPseudoId): Ditto.
        (WebCore::MediaControlRewindButtonElement::shadowPseudoId): Ditto.
        (WebCore::MediaControlReturnToRealtimeButtonElement::shadowPseudoId): Ditto.
        (WebCore::MediaControlToggleClosedCaptionsButtonElement::shadowPseudoId): Ditto.
        (WebCore::MediaControlTimelineElement::shadowPseudoId): Ditto.
        (WebCore::MediaControlVolumeSliderElement::shadowPseudoId): Ditto.
        (WebCore::MediaControlFullscreenButtonElement::shadowPseudoId): Ditto.
        * rendering/MediaControlElements.h: Ditto.

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

Source/WebCore/ChangeLog
Source/WebCore/dom/Element.h
Source/WebCore/html/ValidationMessage.cpp
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/html/shadow/SliderThumbElement.h

index 7a60357..b16e581 100644 (file)
@@ -1,3 +1,33 @@
+2011-01-25  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Kent Tamura.
+
+        Reduce ref-count churn in shadowPseudoId.
+        https://bugs.webkit.org/show_bug.cgi?id=53136
+
+        Refactoring, so no new tests.
+
+        * dom/Element.h:
+        (WebCore::Element::shadowPseudoId): Changed signature to use const AtomicString&
+        * html/ValidationMessage.cpp:
+        (WebCore::ElementWithPseudoId::shadowPseudoId): Ditto.
+        * html/shadow/SliderThumbElement.cpp:
+        (WebCore::SliderThumbElement::shadowPseudoId): Ditto, plus moved from the header file.
+        * html/shadow/SliderThumbElement.h: Ditto.
+        * rendering/MediaControlElements.cpp:
+        (WebCore::MediaControlMuteButtonElement::shadowPseudoId): Ditto.
+        (WebCore::MediaControlVolumeSliderMuteButtonElement::shadowPseudoId): Ditto.
+        (WebCore::MediaControlPlayButtonElement::shadowPseudoId): Ditto.
+        (WebCore::MediaControlSeekForwardButtonElement::shadowPseudoId): Ditto.
+        (WebCore::MediaControlSeekBackButtonElement::shadowPseudoId): Ditto.
+        (WebCore::MediaControlRewindButtonElement::shadowPseudoId): Ditto.
+        (WebCore::MediaControlReturnToRealtimeButtonElement::shadowPseudoId): Ditto.
+        (WebCore::MediaControlToggleClosedCaptionsButtonElement::shadowPseudoId): Ditto.
+        (WebCore::MediaControlTimelineElement::shadowPseudoId): Ditto.
+        (WebCore::MediaControlVolumeSliderElement::shadowPseudoId): Ditto.
+        (WebCore::MediaControlFullscreenButtonElement::shadowPseudoId): Ditto.
+        * rendering/MediaControlElements.h: Ditto.
+
 2011-01-26  Dave Hyatt  <hyatt@apple.com>
 
         Reviewed by Dan Bernstein.
index 4510478..de42a5f 100644 (file)
@@ -232,7 +232,7 @@ public:
 
     Node* shadowRoot();
     void setShadowRoot(PassRefPtr<Node>);
-    virtual AtomicString shadowPseudoId() const;
+    virtual const AtomicString& shadowPseudoId() const;
 
     RenderStyle* computedStyle(PseudoId = NOPSEUDO);
 
@@ -510,9 +510,9 @@ inline void Element::setIdAttribute(const AtomicString& value)
     setAttribute(document()->idAttributeName(), value);
 }
 
-inline AtomicString Element::shadowPseudoId() const
+inline const AtomicString& Element::shadowPseudoId() const
 {
-    return AtomicString();
+    return nullAtom;
 }
 
 } // namespace
index 2c441c7..f772b92 100644 (file)
@@ -105,7 +105,7 @@ protected:
     ElementWithPseudoId(Document* doc, const AtomicString& pseudoName)
         : HTMLElement(divTag, doc)
         , m_pseudoName(pseudoName) { };
-    virtual AtomicString shadowPseudoId() const { return m_pseudoName; }
+    virtual const AtomicString& shadowPseudoId() const { return m_pseudoName; }
 
 private:
     AtomicString m_pseudoName;
index 762edda..83148d0 100644 (file)
@@ -184,5 +184,11 @@ void SliderThumbElement::detach()
     HTMLDivElement::detach();
 }
 
+const AtomicString& SliderThumbElement::shadowPseudoId() const
+{
+    DEFINE_STATIC_LOCAL(AtomicString, sliderThumb, ("-webkit-slider-thumb"));
+    return sliderThumb;
+}
+
 }
 
index 1f1c869..7c4c179 100644 (file)
@@ -53,7 +53,7 @@ public:
     void dragFrom(const IntPoint&);
     virtual void defaultEventHandler(Event*);
     virtual void detach();
-    virtual AtomicString shadowPseudoId() const;
+    virtual const AtomicString& shadowPseudoId() const;
 
 private:
     SliderThumbElement(Document*);
@@ -77,12 +77,6 @@ inline PassRefPtr<SliderThumbElement> SliderThumbElement::create(Document* docum
     return adoptRef(new SliderThumbElement(document));
 }
 
-inline AtomicString SliderThumbElement::shadowPseudoId() const
-{
-    DEFINE_STATIC_LOCAL(AtomicString, sliderThumb, ("-webkit-slider-thumb"));
-    return sliderThumb;
-}
-
 inline SliderThumbElement* toSliderThumbElement(Node* node)
 {
     ASSERT(!node || node->isHTMLElement());