Chromium Code Reviews| 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) |