[Webkit-unassigned] [Bug 56770] Speed up HitTestResult

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 21 16:37:48 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=56770





--- Comment #9 from Darin Adler <darin at apple.com>  2011-03-21 16:37:47 PST ---
(From update of attachment 86372)
View in context: https://bugs.webkit.org/attachment.cgi?id=86372&action=review

> Source/WebCore/rendering/HitTestResult.cpp:108
> +    m_rectBasedTestResult.set(other.m_rectBasedTestResult ? new NodeSet(*other.m_rectBasedTestResult) : 0);

Please use adoptPtr rather than the obsolete set.

> Source/WebCore/rendering/HitTestResult.cpp:134
> +    m_rectBasedTestResult.set(other.m_rectBasedTestResult ? new NodeSet(*other.m_rectBasedTestResult) : 0);

Please use adoptPtr rather than the obsolete set.

> Source/WebCore/rendering/HitTestResult.cpp:562
> -    m_rectBasedTestResult.add(node);
> +    getOrCreateNodeSet().add(node);

I think the function could just be named nodeSet(). But also, before it was named based on its purpose and now you named it based on its data type.

> Source/WebCore/rendering/HitTestResult.cpp:602
> +        m_rectBasedTestResult.set(new NodeSet());

Please use adoptPtr instead of set. No need for the parentheses after NodeSet.

> Source/WebCore/rendering/HitTestResult.h:123
> +    const NodeSet& rectBasedTestResult() { return getOrCreateNodeSet(); }

The old function was const, but your new function is not. But it should be.

> Source/WebCore/rendering/HitTestResult.h:127
> +    NodeSet& getOrCreateNodeSet();

This should be const.

> Source/WebCore/rendering/HitTestResult.h:146
> +    OwnPtr<NodeSet> m_rectBasedTestResult;

This should be mutable.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list