Chromium Code Reviews| Index: Source/web/WebNodeList.cpp |
| diff --git a/Source/web/WebNodeList.cpp b/Source/web/WebNodeList.cpp |
| index 8d3de62052b33e1694626b5a6065ed3f08839613..7c36677bd796f8c3ef3878bd61a1e4a3593c57db 100644 |
| --- a/Source/web/WebNodeList.cpp |
| +++ b/Source/web/WebNodeList.cpp |
| @@ -42,28 +42,23 @@ namespace blink { |
| void WebNodeList::reset() |
| { |
| - assign(0); |
| + m_private.reset(); |
| } |
| void WebNodeList::assign(const WebNodeList& other) |
| { |
| - NodeList* p = const_cast<NodeList*>(other.m_private); |
| - if (p) |
| - p->ref(); |
| - assign(p); |
| + m_private = other.m_private; |
| } |
| -WebNodeList::WebNodeList(const PassRefPtr<NodeList>& col) |
| - : m_private(static_cast<NodeList*>(col.leakRef())) |
| +WebNodeList::WebNodeList(const PassRefPtrWillBeRawPtr<NodeList>& list) |
|
Erik Corry
2014/05/19 21:45:00
Passing a reference to a pointer. Should this not
sof
2014/05/20 06:23:59
Passing a const reference to a wrapped pointer. Ot
|
| + : m_private(list) |
| { |
| } |
| -void WebNodeList::assign(NodeList* p) |
| +WebNodeList& WebNodeList::operator=(const PassRefPtrWillBeRawPtr<NodeList>& list) |
| { |
| - // p is already ref'd for us by the caller |
| - if (m_private) |
| - m_private->deref(); |
| - m_private = p; |
| + m_private = list; |
| + return *this; |
| } |
| unsigned WebNodeList::length() const |