Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: Source/web/WebNodeList.cpp

Issue 280123002: Oilpan: move LiveNodeList collections to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have NodeRareData clear out NodeListsNodeData instead. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/WebFormElement.cpp ('k') | Source/web/WebPageSerializer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
+ : 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
« no previous file with comments | « Source/web/WebFormElement.cpp ('k') | Source/web/WebPageSerializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698