Commit 112faee5 authored by keishi@chromium.org's avatar keishi@chromium.org

Oilpan: Prepare to move form control ua shadow elements to Oilpan heap.

BUG=357163

Review URL: https://codereview.chromium.org/267283007

git-svn-id: svn://svn.chromium.org/blink/trunk@173628 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d682152f
...@@ -85,7 +85,7 @@ void PasswordInputType::createShadowSubtree() ...@@ -85,7 +85,7 @@ void PasswordInputType::createShadowSubtree()
BaseTextInputType::createShadowSubtree(); BaseTextInputType::createShadowSubtree();
if (!isPasswordGenerationEnabled()) if (!isPasswordGenerationEnabled())
return; return;
RefPtr<PasswordGeneratorButtonElement> generatorButton = PasswordGeneratorButtonElement::create(element().document()); RefPtrWillBeRawPtr<PasswordGeneratorButtonElement> generatorButton = PasswordGeneratorButtonElement::create(element().document());
if (!isPasswordGenerationDecorationEnabled()) if (!isPasswordGenerationDecorationEnabled())
generatorButton->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone); generatorButton->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone);
containerElement()->appendChild(generatorButton.release()); containerElement()->appendChild(generatorButton.release());
......
...@@ -250,7 +250,7 @@ void RangeInputType::createShadowSubtree() ...@@ -250,7 +250,7 @@ void RangeInputType::createShadowSubtree()
track->setShadowPseudoId(AtomicString("-webkit-slider-runnable-track", AtomicString::ConstructFromLiteral)); track->setShadowPseudoId(AtomicString("-webkit-slider-runnable-track", AtomicString::ConstructFromLiteral));
track->setAttribute(idAttr, ShadowElementNames::sliderTrack()); track->setAttribute(idAttr, ShadowElementNames::sliderTrack());
track->appendChild(SliderThumbElement::create(document)); track->appendChild(SliderThumbElement::create(document));
RefPtr<HTMLElement> container = SliderContainerElement::create(document); RefPtrWillBeRawPtr<HTMLElement> container = SliderContainerElement::create(document);
container->appendChild(track.release()); container->appendChild(track.release());
element().userAgentShadowRoot()->appendChild(container.release()); element().userAgentShadowRoot()->appendChild(container.release());
} }
......
...@@ -98,9 +98,9 @@ private: ...@@ -98,9 +98,9 @@ private:
} }
public: public:
static PassRefPtr<DataListIndicatorElement> create(Document& document) static PassRefPtrWillBeRawPtr<DataListIndicatorElement> create(Document& document)
{ {
RefPtr<DataListIndicatorElement> element = adoptRef(new DataListIndicatorElement(document)); RefPtrWillBeRawPtr<DataListIndicatorElement> element = adoptRefWillBeRefCountedGarbageCollected(new DataListIndicatorElement(document));
element->setShadowPseudoId(AtomicString("-webkit-calendar-picker-indicator", AtomicString::ConstructFromLiteral)); element->setShadowPseudoId(AtomicString("-webkit-calendar-picker-indicator", AtomicString::ConstructFromLiteral));
element->setAttribute(idAttr, ShadowElementNames::pickerIndicator()); element->setAttribute(idAttr, ShadowElementNames::pickerIndicator());
return element.release(); return element.release();
......
...@@ -41,6 +41,7 @@ class FormDataList; ...@@ -41,6 +41,7 @@ class FormDataList;
// The class represents types of which UI contain text fields. // The class represents types of which UI contain text fields.
// It supports not only the types for BaseTextInputType but also type=number. // It supports not only the types for BaseTextInputType but also type=number.
class TextFieldInputType : public InputType, protected SpinButtonElement::SpinButtonOwner { class TextFieldInputType : public InputType, protected SpinButtonElement::SpinButtonOwner {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(TextFieldInputType);
protected: protected:
TextFieldInputType(HTMLInputElement&); TextFieldInputType(HTMLInputElement&);
virtual ~TextFieldInputType(); virtual ~TextFieldInputType();
......
...@@ -43,9 +43,9 @@ inline ClearButtonElement::ClearButtonElement(Document& document, ClearButtonOwn ...@@ -43,9 +43,9 @@ inline ClearButtonElement::ClearButtonElement(Document& document, ClearButtonOwn
{ {
} }
PassRefPtr<ClearButtonElement> ClearButtonElement::create(Document& document, ClearButtonOwner& clearButtonOwner) PassRefPtrWillBeRawPtr<ClearButtonElement> ClearButtonElement::create(Document& document, ClearButtonOwner& clearButtonOwner)
{ {
RefPtr<ClearButtonElement> element = adoptRef(new ClearButtonElement(document, clearButtonOwner)); RefPtrWillBeRawPtr<ClearButtonElement> element = adoptRefWillBeRefCountedGarbageCollected(new ClearButtonElement(document, clearButtonOwner));
element->setShadowPseudoId(AtomicString("-webkit-clear-button", AtomicString::ConstructFromLiteral)); element->setShadowPseudoId(AtomicString("-webkit-clear-button", AtomicString::ConstructFromLiteral));
element->setAttribute(idAttr, ShadowElementNames::clearButton()); element->setAttribute(idAttr, ShadowElementNames::clearButton());
return element.release(); return element.release();
...@@ -117,4 +117,10 @@ bool ClearButtonElement::isClearButtonElement() const ...@@ -117,4 +117,10 @@ bool ClearButtonElement::isClearButtonElement() const
return true; return true;
} }
void ClearButtonElement::trace(Visitor* visitor)
{
visitor->trace(m_clearButtonOwner);
HTMLDivElement::trace(visitor);
}
} }
...@@ -33,7 +33,7 @@ namespace WebCore { ...@@ -33,7 +33,7 @@ namespace WebCore {
class ClearButtonElement FINAL : public HTMLDivElement { class ClearButtonElement FINAL : public HTMLDivElement {
public: public:
class ClearButtonOwner { class ClearButtonOwner : public WillBeGarbageCollectedMixin {
public: public:
virtual ~ClearButtonOwner() { } virtual ~ClearButtonOwner() { }
virtual void focusAndSelectClearButtonOwner() = 0; virtual void focusAndSelectClearButtonOwner() = 0;
...@@ -41,9 +41,11 @@ public: ...@@ -41,9 +41,11 @@ public:
virtual void clearValue() = 0; virtual void clearValue() = 0;
}; };
static PassRefPtr<ClearButtonElement> create(Document&, ClearButtonOwner&); static PassRefPtrWillBeRawPtr<ClearButtonElement> create(Document&, ClearButtonOwner&);
void releaseCapture(); void releaseCapture();
void removeClearButtonOwner() { m_clearButtonOwner = 0; } void removeClearButtonOwner() { m_clearButtonOwner = nullptr; }
virtual void trace(Visitor*) OVERRIDE;
private: private:
ClearButtonElement(Document&, ClearButtonOwner&); ClearButtonElement(Document&, ClearButtonOwner&);
...@@ -52,7 +54,7 @@ private: ...@@ -52,7 +54,7 @@ private:
virtual void defaultEventHandler(Event*) OVERRIDE; virtual void defaultEventHandler(Event*) OVERRIDE;
virtual bool isClearButtonElement() const OVERRIDE; virtual bool isClearButtonElement() const OVERRIDE;
ClearButtonOwner* m_clearButtonOwner; RawPtrWillBeMember<ClearButtonOwner> m_clearButtonOwner;
bool m_capturing; bool m_capturing;
}; };
......
...@@ -53,9 +53,9 @@ PasswordGeneratorButtonElement::PasswordGeneratorButtonElement(Document& documen ...@@ -53,9 +53,9 @@ PasswordGeneratorButtonElement::PasswordGeneratorButtonElement(Document& documen
setHasCustomStyleCallbacks(); setHasCustomStyleCallbacks();
} }
PassRefPtr<PasswordGeneratorButtonElement> PasswordGeneratorButtonElement::create(Document& document) PassRefPtrWillBeRawPtr<PasswordGeneratorButtonElement> PasswordGeneratorButtonElement::create(Document& document)
{ {
RefPtr<PasswordGeneratorButtonElement> element = adoptRef(new PasswordGeneratorButtonElement(document)); RefPtrWillBeRawPtr<PasswordGeneratorButtonElement> element = adoptRefWillBeRefCountedGarbageCollected(new PasswordGeneratorButtonElement(document));
element->setAttribute(idAttr, ShadowElementNames::passwordGenerator()); element->setAttribute(idAttr, ShadowElementNames::passwordGenerator());
return element.release(); return element.release();
} }
......
...@@ -42,7 +42,7 @@ class ShadowRoot; ...@@ -42,7 +42,7 @@ class ShadowRoot;
class PasswordGeneratorButtonElement FINAL : public HTMLDivElement { class PasswordGeneratorButtonElement FINAL : public HTMLDivElement {
public: public:
static PassRefPtr<PasswordGeneratorButtonElement> create(Document&); static PassRefPtrWillBeRawPtr<PasswordGeneratorButtonElement> create(Document&);
void decorate(HTMLInputElement*); void decorate(HTMLInputElement*);
......
...@@ -205,9 +205,9 @@ inline SliderThumbElement::SliderThumbElement(Document& document) ...@@ -205,9 +205,9 @@ inline SliderThumbElement::SliderThumbElement(Document& document)
{ {
} }
PassRefPtr<SliderThumbElement> SliderThumbElement::create(Document& document) PassRefPtrWillBeRawPtr<SliderThumbElement> SliderThumbElement::create(Document& document)
{ {
RefPtr<SliderThumbElement> element = adoptRef(new SliderThumbElement(document)); RefPtrWillBeRawPtr<SliderThumbElement> element = adoptRefWillBeRefCountedGarbageCollected(new SliderThumbElement(document));
element->setAttribute(idAttr, ShadowElementNames::sliderThumb()); element->setAttribute(idAttr, ShadowElementNames::sliderThumb());
return element.release(); return element.release();
} }
...@@ -444,9 +444,9 @@ inline SliderContainerElement::SliderContainerElement(Document& document) ...@@ -444,9 +444,9 @@ inline SliderContainerElement::SliderContainerElement(Document& document)
{ {
} }
PassRefPtr<SliderContainerElement> SliderContainerElement::create(Document& document) PassRefPtrWillBeRawPtr<SliderContainerElement> SliderContainerElement::create(Document& document)
{ {
return adoptRef(new SliderContainerElement(document)); return adoptRefWillBeRefCountedGarbageCollected(new SliderContainerElement(document));
} }
RenderObject* SliderContainerElement::createRenderer(RenderStyle*) RenderObject* SliderContainerElement::createRenderer(RenderStyle*)
......
...@@ -46,7 +46,7 @@ class FloatPoint; ...@@ -46,7 +46,7 @@ class FloatPoint;
class SliderThumbElement FINAL : public HTMLDivElement { class SliderThumbElement FINAL : public HTMLDivElement {
public: public:
static PassRefPtr<SliderThumbElement> create(Document&); static PassRefPtrWillBeRawPtr<SliderThumbElement> create(Document&);
void setPositionFromValue(); void setPositionFromValue();
...@@ -96,7 +96,7 @@ private: ...@@ -96,7 +96,7 @@ private:
class SliderContainerElement FINAL : public HTMLDivElement { class SliderContainerElement FINAL : public HTMLDivElement {
public: public:
static PassRefPtr<SliderContainerElement> create(Document&); static PassRefPtrWillBeRawPtr<SliderContainerElement> create(Document&);
private: private:
SliderContainerElement(Document&); SliderContainerElement(Document&);
......
...@@ -257,4 +257,10 @@ bool SpinButtonElement::shouldRespondToMouseEvents() ...@@ -257,4 +257,10 @@ bool SpinButtonElement::shouldRespondToMouseEvents()
return !m_spinButtonOwner || m_spinButtonOwner->shouldSpinButtonRespondToMouseEvents(); return !m_spinButtonOwner || m_spinButtonOwner->shouldSpinButtonRespondToMouseEvents();
} }
void SpinButtonElement::trace(Visitor* visitor)
{
visitor->trace(m_spinButtonOwner);
HTMLDivElement::trace(visitor);
}
} }
...@@ -44,7 +44,7 @@ public: ...@@ -44,7 +44,7 @@ public:
EventDispatchAllowed, EventDispatchAllowed,
EventDispatchDisallowed, EventDispatchDisallowed,
}; };
class SpinButtonOwner { class SpinButtonOwner : public WillBeGarbageCollectedMixin {
public: public:
virtual ~SpinButtonOwner() { } virtual ~SpinButtonOwner() { }
virtual void focusAndSelectSpinButtonOwner() = 0; virtual void focusAndSelectSpinButtonOwner() = 0;
...@@ -61,7 +61,7 @@ public: ...@@ -61,7 +61,7 @@ public:
static PassRefPtr<SpinButtonElement> create(Document&, SpinButtonOwner&); static PassRefPtr<SpinButtonElement> create(Document&, SpinButtonOwner&);
UpDownState upDownState() const { return m_upDownState; } UpDownState upDownState() const { return m_upDownState; }
void releaseCapture(EventDispatch = EventDispatchAllowed); void releaseCapture(EventDispatch = EventDispatchAllowed);
void removeSpinButtonOwner() { m_spinButtonOwner = 0; } void removeSpinButtonOwner() { m_spinButtonOwner = nullptr; }
void step(int amount); void step(int amount);
...@@ -70,6 +70,8 @@ public: ...@@ -70,6 +70,8 @@ public:
void forwardEvent(Event*); void forwardEvent(Event*);
virtual void trace(Visitor*) OVERRIDE;
private: private:
SpinButtonElement(Document&, SpinButtonOwner&); SpinButtonElement(Document&, SpinButtonOwner&);
...@@ -88,7 +90,7 @@ private: ...@@ -88,7 +90,7 @@ private:
bool shouldRespondToMouseEvents(); bool shouldRespondToMouseEvents();
virtual bool isMouseFocusable() const OVERRIDE { return false; } virtual bool isMouseFocusable() const OVERRIDE { return false; }
SpinButtonOwner* m_spinButtonOwner; RawPtrWillBeMember<SpinButtonOwner> m_spinButtonOwner;
bool m_capturing; bool m_capturing;
UpDownState m_upDownState; UpDownState m_upDownState;
UpDownState m_pressStartingState; UpDownState m_pressStartingState;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment