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

Unified Diff: Source/web/WebElementCollection.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/WebDocument.cpp ('k') | Source/web/WebFormElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebElementCollection.cpp
diff --git a/Source/web/WebElementCollection.cpp b/Source/web/WebElementCollection.cpp
index 784b25e9358358cf19b20d29dbb475066260d5b3..4ca5730e5bfda911161cbe41b5931402ef6e770a 100644
--- a/Source/web/WebElementCollection.cpp
+++ b/Source/web/WebElementCollection.cpp
@@ -43,28 +43,23 @@ namespace blink {
void WebElementCollection::reset()
{
- assign(0);
+ m_private.reset();
}
void WebElementCollection::assign(const WebElementCollection& other)
{
- HTMLCollection* p = const_cast<HTMLCollection*>(other.m_private);
- if (p)
- p->ref();
- assign(p);
+ m_private = other.m_private;
}
-WebElementCollection::WebElementCollection(const PassRefPtr<HTMLCollection>& col)
- : m_private(static_cast<HTMLCollection*>(col.leakRef()))
+WebElementCollection::WebElementCollection(const PassRefPtrWillBeRawPtr<HTMLCollection>& col)
+ : m_private(col)
{
}
-void WebElementCollection::assign(HTMLCollection* p)
+WebElementCollection& WebElementCollection::operator=(const PassRefPtrWillBeRawPtr<HTMLCollection>& col)
{
- // p is already ref'd for us by the caller
- if (m_private)
- m_private->deref();
- m_private = p;
+ m_private = col;
+ return *this;
}
unsigned WebElementCollection::length() const
« no previous file with comments | « Source/web/WebDocument.cpp ('k') | Source/web/WebFormElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698