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

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

Issue 270823004: Oilpan: Prepare to move FormAssociatedElement to Oilpan heap, part 2. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/core/html/FormAssociatedElement.h ('k') | Source/core/html/HTMLFieldSetElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/FormAssociatedElement.cpp
diff --git a/Source/core/html/FormAssociatedElement.cpp b/Source/core/html/FormAssociatedElement.cpp
index 8e49a61d269d52d2bea2e5eefa612ca6cd54cbfb..6a809afb50a7567c789f3638adfe350edbdea576 100644
--- a/Source/core/html/FormAssociatedElement.cpp
+++ b/Source/core/html/FormAssociatedElement.cpp
@@ -36,16 +36,18 @@ namespace WebCore {
using namespace HTMLNames;
-class FormAttributeTargetObserver : public IdTargetObserver {
- WTF_MAKE_FAST_ALLOCATED;
+// FIXME: Oilpan: IdTargetObserver should be on-heap.
haraken 2014/05/09 05:02:03 Yes, this will allow us to remove the complexity i
Mads Ager (chromium) 2014/05/09 05:46:30 Maybe, but only if the notification can wait until
+class FormAttributeTargetObserver : public NoBaseWillBeGarbageCollectedFinalized<FormAttributeTargetObserver>, public IdTargetObserver {
+ WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
public:
- static PassOwnPtr<FormAttributeTargetObserver> create(const AtomicString& id, FormAssociatedElement*);
+ static PassOwnPtrWillBeRawPtr<FormAttributeTargetObserver> create(const AtomicString& id, FormAssociatedElement*);
+ void trace(Visitor* visitor) { visitor->trace(m_element); }
virtual void idTargetChanged() OVERRIDE;
private:
FormAttributeTargetObserver(const AtomicString& id, FormAssociatedElement*);
- FormAssociatedElement* m_element;
+ RawPtrWillBeMember<FormAssociatedElement> m_element;
};
FormAssociatedElement::FormAssociatedElement()
@@ -60,6 +62,7 @@ FormAssociatedElement::~FormAssociatedElement()
void FormAssociatedElement::trace(Visitor* visitor)
{
+ visitor->trace(m_formAttributeTargetObserver);
visitor->trace(m_form);
visitor->trace(m_validityState);
}
@@ -267,7 +270,7 @@ void FormAssociatedElement::setCustomValidity(const String& error)
m_customValidationMessage = error;
}
-void FormAssociatedElement::setFormAttributeTargetObserver(PassOwnPtr<FormAttributeTargetObserver> newObserver)
+void FormAssociatedElement::setFormAttributeTargetObserver(PassOwnPtrWillBeRawPtr<FormAttributeTargetObserver> newObserver)
{
if (m_formAttributeTargetObserver)
m_formAttributeTargetObserver->unregister();
@@ -324,9 +327,9 @@ HTMLElement& toHTMLElement(FormAssociatedElement& associatedElement)
return const_cast<HTMLElement&>(toHTMLElement(static_cast<const FormAssociatedElement&>(associatedElement)));
}
-PassOwnPtr<FormAttributeTargetObserver> FormAttributeTargetObserver::create(const AtomicString& id, FormAssociatedElement* element)
+PassOwnPtrWillBeRawPtr<FormAttributeTargetObserver> FormAttributeTargetObserver::create(const AtomicString& id, FormAssociatedElement* element)
{
- return adoptPtr(new FormAttributeTargetObserver(id, element));
+ return adoptPtrWillBeNoop(new FormAttributeTargetObserver(id, element));
}
FormAttributeTargetObserver::FormAttributeTargetObserver(const AtomicString& id, FormAssociatedElement* element)
« no previous file with comments | « Source/core/html/FormAssociatedElement.h ('k') | Source/core/html/HTMLFieldSetElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698