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

Unified Diff: Source/core/html/HTMLFormControlsCollection.cpp

Issue 280123002: Oilpan: move LiveNodeList collections to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Pre-emptively GC a long runnning test 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
Index: Source/core/html/HTMLFormControlsCollection.cpp
diff --git a/Source/core/html/HTMLFormControlsCollection.cpp b/Source/core/html/HTMLFormControlsCollection.cpp
index 19c5961f7045f5695f7a75a02e8fc8a505bd66ab..c1884025de45b45dce6beb132ba6d02732afbcfc 100644
--- a/Source/core/html/HTMLFormControlsCollection.cpp
+++ b/Source/core/html/HTMLFormControlsCollection.cpp
@@ -47,9 +47,9 @@ HTMLFormControlsCollection::HTMLFormControlsCollection(ContainerNode& ownerNode)
ScriptWrappable::init(this);
}
-PassRefPtr<HTMLFormControlsCollection> HTMLFormControlsCollection::create(ContainerNode& ownerNode, CollectionType)
+PassRefPtrWillBeRawPtr<HTMLFormControlsCollection> HTMLFormControlsCollection::create(ContainerNode& ownerNode, CollectionType)
{
- return adoptRef(new HTMLFormControlsCollection(ownerNode));
+ return adoptRefWillBeNoop(new HTMLFormControlsCollection(ownerNode));
}
HTMLFormControlsCollection::~HTMLFormControlsCollection()
@@ -153,7 +153,7 @@ void HTMLFormControlsCollection::updateIdNameCache() const
if (hasValidIdNameCache())
return;
- OwnPtr<NamedItemCache> cache = NamedItemCache::create();
+ OwnPtrWillBeRawPtr<NamedItemCache> cache = NamedItemCache::create();
HashSet<StringImpl*> foundInputElements;
const FormAssociatedElement::List& elementsArray = formControlElements();
@@ -192,9 +192,9 @@ void HTMLFormControlsCollection::updateIdNameCache() const
setNamedItemCache(cache.release());
}
-void HTMLFormControlsCollection::namedGetter(const AtomicString& name, bool& radioNodeListEnabled, RefPtr<RadioNodeList>& radioNodeList, bool& elementEnabled, RefPtr<Element>& element)
+void HTMLFormControlsCollection::namedGetter(const AtomicString& name, bool& radioNodeListEnabled, RefPtrWillBeRawPtr<RadioNodeList>& radioNodeList, bool& elementEnabled, RefPtr<Element>& element)
{
- Vector<RefPtr<Element> > namedItems;
+ WillBeHeapVector<RefPtrWillBeMember<Element> > namedItems;
this->namedItems(name, namedItems);
if (namedItems.isEmpty())
@@ -202,7 +202,12 @@ void HTMLFormControlsCollection::namedGetter(const AtomicString& name, bool& rad
if (namedItems.size() == 1) {
elementEnabled = true;
+#if ENABLE(OILPAN)
+ // FIXME: Oilpan: remove once Element becomes [GarbageCollected].
+ element = PassRefPtr<Element>(namedItems.first().get());
+#else
element = namedItems.first();
+#endif
return;
}

Powered by Google App Engine
This is Rietveld 408576698