mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:08:13 +00:00
AK: Rename adopt() to adopt_ref()
This makes it more symmetrical with adopt_own() (which is used to create a NonnullOwnPtr from the result of a naked new.)
This commit is contained in:
parent
b3db01e20e
commit
b91c49364d
228 changed files with 461 additions and 461 deletions
|
@ -354,7 +354,7 @@ NonnullRefPtr<Node> Node::clone_node(Document* document, bool clone_children) co
|
|||
if (is<Element>(this)) {
|
||||
auto& element = *downcast<Element>(this);
|
||||
auto qualified_name = QualifiedName(element.local_name(), element.prefix(), element.namespace_());
|
||||
auto element_copy = adopt(*new Element(*document, move(qualified_name)));
|
||||
auto element_copy = adopt_ref(*new Element(*document, move(qualified_name)));
|
||||
element.for_each_attribute([&](auto& name, auto& value) {
|
||||
element_copy->set_attribute(name, value);
|
||||
});
|
||||
|
@ -370,22 +370,22 @@ NonnullRefPtr<Node> Node::clone_node(Document* document, bool clone_children) co
|
|||
copy = move(document_copy);
|
||||
} else if (is<DocumentType>(this)) {
|
||||
auto document_type = downcast<DocumentType>(this);
|
||||
auto document_type_copy = adopt(*new DocumentType(*document));
|
||||
auto document_type_copy = adopt_ref(*new DocumentType(*document));
|
||||
document_type_copy->set_name(document_type->name());
|
||||
document_type_copy->set_public_id(document_type->public_id());
|
||||
document_type_copy->set_system_id(document_type->system_id());
|
||||
copy = move(document_type_copy);
|
||||
} else if (is<Text>(this)) {
|
||||
auto text = downcast<Text>(this);
|
||||
auto text_copy = adopt(*new Text(*document, text->data()));
|
||||
auto text_copy = adopt_ref(*new Text(*document, text->data()));
|
||||
copy = move(text_copy);
|
||||
} else if (is<Comment>(this)) {
|
||||
auto comment = downcast<Comment>(this);
|
||||
auto comment_copy = adopt(*new Comment(*document, comment->data()));
|
||||
auto comment_copy = adopt_ref(*new Comment(*document, comment->data()));
|
||||
copy = move(comment_copy);
|
||||
} else if (is<ProcessingInstruction>(this)) {
|
||||
auto processing_instruction = downcast<ProcessingInstruction>(this);
|
||||
auto processing_instruction_copy = adopt(*new ProcessingInstruction(*document, processing_instruction->data(), processing_instruction->target()));
|
||||
auto processing_instruction_copy = adopt_ref(*new ProcessingInstruction(*document, processing_instruction->data(), processing_instruction->target()));
|
||||
copy = move(processing_instruction_copy);
|
||||
} else {
|
||||
dbgln("clone_node() not implemented for NodeType {}", (u16)m_type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue