Title: [125985] trunk/Source/WebCore
Revision
125985
Author
[email protected]
Date
2012-08-19 18:31:23 -0700 (Sun, 19 Aug 2012)

Log Message

Remove RefPtr from HTMLProgressElement::m_value
https://bugs.webkit.org/show_bug.cgi?id=94336

Reviewed by Kent Tamura.

To avoid reference cycles of RefPtr<Node>s, we want to remove
unnecessary RefPtr<Node>s. The rationale is described in bug 94324.

HTMLProgressElement::m_value does not need to be a RefPtr<Node>, because
it is guaranteed to point to a shadow DOM tree of the HTMLProgressElement
node, which is guaranteed to exist in the subtree of the HTMLProgressElement node.

No tests. No change in behavior.

* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::HTMLProgressElement):
(WebCore::HTMLProgressElement::createShadowSubtree):
* html/HTMLProgressElement.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (125984 => 125985)


--- trunk/Source/WebCore/ChangeLog	2012-08-20 01:08:05 UTC (rev 125984)
+++ trunk/Source/WebCore/ChangeLog	2012-08-20 01:31:23 UTC (rev 125985)
@@ -1,5 +1,26 @@
 2012-08-19  Kentaro Hara  <[email protected]>
 
+        Remove RefPtr from HTMLProgressElement::m_value
+        https://bugs.webkit.org/show_bug.cgi?id=94336
+
+        Reviewed by Kent Tamura.
+
+        To avoid reference cycles of RefPtr<Node>s, we want to remove
+        unnecessary RefPtr<Node>s. The rationale is described in bug 94324.
+
+        HTMLProgressElement::m_value does not need to be a RefPtr<Node>, because
+        it is guaranteed to point to a shadow DOM tree of the HTMLProgressElement
+        node, which is guaranteed to exist in the subtree of the HTMLProgressElement node.
+
+        No tests. No change in behavior.
+
+        * html/HTMLProgressElement.cpp:
+        (WebCore::HTMLProgressElement::HTMLProgressElement):
+        (WebCore::HTMLProgressElement::createShadowSubtree):
+        * html/HTMLProgressElement.h:
+
+2012-08-19  Kentaro Hara  <[email protected]>
+
         Remove RefPtr from SearchInputType::m_resultsButton and SearchInputType::m_cancelButton
         https://bugs.webkit.org/show_bug.cgi?id=94339
 

Modified: trunk/Source/WebCore/html/HTMLProgressElement.cpp (125984 => 125985)


--- trunk/Source/WebCore/html/HTMLProgressElement.cpp	2012-08-20 01:08:05 UTC (rev 125984)
+++ trunk/Source/WebCore/html/HTMLProgressElement.cpp	2012-08-20 01:31:23 UTC (rev 125985)
@@ -43,6 +43,7 @@
 
 HTMLProgressElement::HTMLProgressElement(const QualifiedName& tagName, Document* document)
     : LabelableElement(tagName, document)
+    , m_value(0)
     , m_hasAuthorShadowRoot(false)
 {
     ASSERT(hasTagName(progressTag));
@@ -164,6 +165,7 @@
 void HTMLProgressElement::createShadowSubtree()
 {
     ASSERT(!userAgentShadowRoot());
+    ASSERT(!m_value);
            
     RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot, ASSERT_NO_EXCEPTION);
 
@@ -171,7 +173,8 @@
     root->appendChild(inner);
 
     RefPtr<ProgressBarElement> bar = ProgressBarElement::create(document());
-    m_value = ProgressValueElement::create(document());
+    RefPtr<ProgressValueElement> value = ProgressValueElement::create(document());
+    m_value = value.get();
     bar->appendChild(m_value, ASSERT_NO_EXCEPTION);
 
     inner->appendChild(bar, ASSERT_NO_EXCEPTION);

Modified: trunk/Source/WebCore/html/HTMLProgressElement.h (125984 => 125985)


--- trunk/Source/WebCore/html/HTMLProgressElement.h	2012-08-20 01:08:05 UTC (rev 125984)
+++ trunk/Source/WebCore/html/HTMLProgressElement.h	2012-08-20 01:31:23 UTC (rev 125985)
@@ -71,7 +71,7 @@
     void didElementStateChange();
     void createShadowSubtree();
 
-    RefPtr<ProgressValueElement> m_value;
+    ProgressValueElement* m_value;
     bool m_hasAuthorShadowRoot;
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to