1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:37:35 +00:00

AK: Rename RetainPtr => RefPtr and Retained => NonnullRefPtr.

This commit is contained in:
Andreas Kling 2019-06-21 18:37:47 +02:00
parent 77b9fa89dd
commit 90b1354688
188 changed files with 562 additions and 562 deletions

View file

@ -13,5 +13,5 @@ public:
public:
String m_property_name;
RetainPtr<StyleValue> m_value;
RefPtr<StyleValue> m_value;
};

View file

@ -36,7 +36,7 @@ void Document::build_layout_tree()
create_layout_tree_for_node(*this);
}
RetainPtr<LayoutNode> Document::create_layout_node()
RefPtr<LayoutNode> Document::create_layout_node()
{
return adopt(*new LayoutDocument(*this));
}

View file

@ -10,7 +10,7 @@ public:
Document();
virtual ~Document() override;
virtual RetainPtr<LayoutNode> create_layout_node() override;
virtual RefPtr<LayoutNode> create_layout_node() override;
void build_layout_tree();

View file

@ -50,7 +50,7 @@ void Element::set_attributes(Vector<Attribute>&& attributes)
m_attributes = move(attributes);
}
RetainPtr<LayoutNode> Element::create_layout_node()
RefPtr<LayoutNode> Element::create_layout_node()
{
if (m_tag_name == "html")
return adopt(*new LayoutBlock(*this));

View file

@ -40,7 +40,7 @@ public:
callback(attribute.name(), attribute.value());
}
virtual RetainPtr<LayoutNode> create_layout_node() override;
virtual RefPtr<LayoutNode> create_layout_node() override;
private:
Attribute* find_attribute(const String& name);

View file

@ -23,12 +23,12 @@ void Node::deref()
delete this;
}
RetainPtr<LayoutNode> Node::create_layout_node()
RefPtr<LayoutNode> Node::create_layout_node()
{
return nullptr;
}
void Node::set_layout_node(Retained<LayoutNode> layout_node)
void Node::set_layout_node(NonnullRefPtr<LayoutNode> layout_node)
{
m_layout_node = move(layout_node);
}

View file

@ -41,12 +41,12 @@ public:
void set_next_sibling(Node* node) { m_next_sibling = node; }
void set_previous_sibling(Node* node) { m_previous_sibling = node; }
virtual RetainPtr<LayoutNode> create_layout_node();
virtual RefPtr<LayoutNode> create_layout_node();
const LayoutNode* layout_node() const { return m_layout_node; }
LayoutNode* layout_node() { return m_layout_node; }
void set_layout_node(Retained<LayoutNode>);
void set_layout_node(NonnullRefPtr<LayoutNode>);
protected:
explicit Node(NodeType);
@ -56,5 +56,5 @@ protected:
ParentNode* m_parent_node { nullptr };
Node* m_next_sibling { nullptr };
Node* m_previous_sibling { nullptr };
RetainPtr<LayoutNode> m_layout_node;
RefPtr<LayoutNode> m_layout_node;
};

View file

@ -1,6 +1,6 @@
#include <LibHTML/DOM/ParentNode.h>
void ParentNode::append_child(Retained<Node> node)
void ParentNode::append_child(NonnullRefPtr<Node> node)
{
if (m_last_child)
m_last_child->set_next_sibling(node.ptr());

View file

@ -4,7 +4,7 @@
class ParentNode : public Node {
public:
void append_child(Retained<Node>);
void append_child(NonnullRefPtr<Node>);
Node* first_child() { return m_first_child; }
Node* last_child() { return m_last_child; }

View file

@ -11,7 +11,7 @@ Text::~Text()
{
}
RetainPtr<LayoutNode> Text::create_layout_node()
RefPtr<LayoutNode> Text::create_layout_node()
{
return adopt(*new LayoutText(*this));
}

View file

@ -10,7 +10,7 @@ public:
const String& data() const { return m_data; }
virtual RetainPtr<LayoutNode> create_layout_node() override;
virtual RefPtr<LayoutNode> create_layout_node() override;
private:
String m_data;

View file

@ -16,6 +16,6 @@ public:
void layout();
private:
RetainPtr<Document> m_document;
RefPtr<Document> m_document;
Size m_size;
};

View file

@ -22,7 +22,7 @@ void LayoutNode::deref()
delete this;
}
void LayoutNode::append_child(Retained<LayoutNode> node)
void LayoutNode::append_child(NonnullRefPtr<LayoutNode> node)
{
if (m_last_child)
m_last_child->set_next_sibling(node.ptr());

View file

@ -38,7 +38,7 @@ public:
bool has_children() const { return m_first_child; }
void append_child(Retained<LayoutNode>);
void append_child(NonnullRefPtr<LayoutNode>);
void set_next_sibling(LayoutNode* node) { m_next_sibling = node; }
void set_previous_sibling(LayoutNode* node) { m_previous_sibling = node; }

View file

@ -4,7 +4,7 @@
#include <ctype.h>
#include <stdio.h>
static Retained<Element> create_element(const String& tag_name)
static NonnullRefPtr<Element> create_element(const String& tag_name)
{
return adopt(*new Element(tag_name));
}
@ -32,9 +32,9 @@ static bool is_self_closing_tag(const String& tag_name)
|| tag_name == "wbr";
}
Retained<Document> parse(const String& html)
NonnullRefPtr<Document> parse(const String& html)
{
Vector<Retained<ParentNode>> node_stack;
Vector<NonnullRefPtr<ParentNode>> node_stack;
auto doc = adopt(*new Document);
node_stack.append(doc);

View file

@ -3,5 +3,5 @@
#include <AK/Retained.h>
#include <LibHTML/DOM/Document.h>
Retained<Document> parse(const String& html);
NonnullRefPtr<Document> parse(const String& html);