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

Unified Diff: Source/core/html/HTMLFormElement.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/HTMLFormElement.cpp
diff --git a/Source/core/html/HTMLFormElement.cpp b/Source/core/html/HTMLFormElement.cpp
index f8bf106daec85b2ace0562fb5f59bda6c2f2cbeb..78b5af241cef7b425a1ca6dd4b3f14053da98641 100644
--- a/Source/core/html/HTMLFormElement.cpp
+++ b/Source/core/html/HTMLFormElement.cpp
@@ -540,7 +540,7 @@ void HTMLFormElement::didAssociateByParser()
UseCounter::count(document(), UseCounter::FormAssociationByParser);
}
-PassRefPtr<HTMLCollection> HTMLFormElement::elements()
+PassRefPtrWillBeRawPtr<HTMLCollection> HTMLFormElement::elements()
{
return ensureCachedHTMLCollection(FormControls);
}
@@ -717,7 +717,7 @@ void HTMLFormElement::removeFromPastNamesMap(HTMLElement& element)
}
}
-void HTMLFormElement::getNamedElements(const AtomicString& name, Vector<RefPtr<Element> >& namedItems)
+void HTMLFormElement::getNamedElements(const AtomicString& name, WillBeHeapVector<RefPtrWillBeMember<Element> >& namedItems)
{
// http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#dom-form-nameditem
elements()->namedItems(name, namedItems);
@@ -749,13 +749,13 @@ void HTMLFormElement::copyNonAttributePropertiesFromElement(const Element& sourc
HTMLElement::copyNonAttributePropertiesFromElement(source);
}
-void HTMLFormElement::anonymousNamedGetter(const AtomicString& name, bool& returnValue0Enabled, RefPtr<RadioNodeList>& returnValue0, bool& returnValue1Enabled, RefPtr<Element>& returnValue1)
+void HTMLFormElement::anonymousNamedGetter(const AtomicString& name, bool& returnValue0Enabled, RefPtrWillBeRawPtr<RadioNodeList>& returnValue0, bool& returnValue1Enabled, RefPtr<Element>& returnValue1)
{
// Call getNamedElements twice, first time check if it has a value
// and let HTMLFormElement update its cache.
// See issue: 867404
{
- Vector<RefPtr<Element> > elements;
+ WillBeHeapVector<RefPtrWillBeMember<Element> > elements;
getNamedElements(name, elements);
if (elements.isEmpty())
return;
@@ -763,13 +763,18 @@ void HTMLFormElement::anonymousNamedGetter(const AtomicString& name, bool& retur
// Second call may return different results from the first call,
// but if the first the size cannot be zero.
- Vector<RefPtr<Element> > elements;
+ WillBeHeapVector<RefPtrWillBeMember<Element> > elements;
getNamedElements(name, elements);
ASSERT(!elements.isEmpty());
if (elements.size() == 1) {
returnValue1Enabled = true;
+#if ENABLE(OILPAN)
+ // FIXME: Oilpan: remove once Element becomes [GarbageCollected].
+ returnValue1 = PassRefPtr<Element>(elements.at(0).get());
+#else
returnValue1 = elements.at(0);
+#endif
return;
}

Powered by Google App Engine
This is Rietveld 408576698