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

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

Issue 19510005: [oilpan] Completely move HTMLFormControlElement's hierarchy to the managed heap Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Created 7 years, 5 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/HTMLKeygenElement.h ('k') | Source/core/html/HTMLLegendElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLKeygenElement.cpp
diff --git a/Source/core/html/HTMLKeygenElement.cpp b/Source/core/html/HTMLKeygenElement.cpp
index a1ba9662292ca6f099b379f91d460ef0e1de7298..548262c722bbb815831ff001a35553ac28bed892 100644
--- a/Source/core/html/HTMLKeygenElement.cpp
+++ b/Source/core/html/HTMLKeygenElement.cpp
@@ -45,9 +45,14 @@ using namespace HTMLNames;
class KeygenSelectElement : public HTMLSelectElement {
public:
- static PassRefPtr<KeygenSelectElement> create(Document* document)
+ static Result<KeygenSelectElement> create(Document* document)
{
- return adoptRef(new KeygenSelectElement(document));
+ return adoptNode(new KeygenSelectElement(document));
+ }
+
+ void acceptHeapVisitor(Visitor* visitor) const OVERRIDE
+ {
+ HTMLSelectElement::acceptHeapVisitor(visitor);
}
protected:
@@ -61,7 +66,7 @@ protected:
private:
virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren()
{
- return create(document());
+ return create(document()).passRefPtr();
}
};
@@ -75,7 +80,7 @@ inline HTMLKeygenElement::HTMLKeygenElement(const QualifiedName& tagName, Docume
Vector<String> keys;
getSupportedKeySizes(keys);
- RefPtr<HTMLSelectElement> select = KeygenSelectElement::create(document);
+ Handle<HTMLSelectElement> select = KeygenSelectElement::create(document);
for (size_t i = 0; i < keys.size(); ++i) {
RefPtr<HTMLOptionElement> option = HTMLOptionElement::create(document);
select->appendChild(option, IGNORE_EXCEPTION);
@@ -85,9 +90,9 @@ inline HTMLKeygenElement::HTMLKeygenElement(const QualifiedName& tagName, Docume
ensureUserAgentShadowRoot()->appendChild(select, IGNORE_EXCEPTION);
}
-PassRefPtr<HTMLKeygenElement> HTMLKeygenElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
+Result<HTMLKeygenElement> HTMLKeygenElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
{
- return adoptRef(new HTMLKeygenElement(tagName, document, form));
+ return adoptNode(new HTMLKeygenElement(tagName, document, form));
}
void HTMLKeygenElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -120,7 +125,7 @@ const AtomicString& HTMLKeygenElement::formControlType() const
void HTMLKeygenElement::reset()
{
- static_cast<HTMLFormControlElement*>(shadowSelect())->reset();
+ Handle<HTMLFormControlElement>::cast(shadowSelect())->reset();
}
bool HTMLKeygenElement::shouldSaveAndRestoreFormControlState() const
@@ -128,10 +133,15 @@ bool HTMLKeygenElement::shouldSaveAndRestoreFormControlState() const
return false;
}
-HTMLSelectElement* HTMLKeygenElement::shadowSelect() const
+Result<HTMLSelectElement> HTMLKeygenElement::shadowSelect() const
{
ShadowRoot* root = userAgentShadowRoot();
- return root ? toHTMLSelectElement(root->firstChild()) : 0;
+ return root ? toHTMLSelectElement(root->firstChild()) : nullptr;
+}
+
+void HTMLKeygenElement::acceptHeapVisitor(Visitor* visitor) const
+{
+ HTMLFormControlElementWithState::acceptHeapVisitor(visitor);
}
} // namespace
« no previous file with comments | « Source/core/html/HTMLKeygenElement.h ('k') | Source/core/html/HTMLLegendElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698