mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-05 18:02:54 +00:00
LibGC+Everywhere: Factor out a LibGC from LibJS
Resulting in a massive rename across almost everywhere! Alongside the namespace change, we now have the following names: * JS::NonnullGCPtr -> GC::Ref * JS::GCPtr -> GC::Ptr * JS::HeapFunction -> GC::Function * JS::CellImpl -> GC::Cell * JS::Handle -> GC::Root
This commit is contained in:
parent
ce23efc5f6
commit
f87041bf3a
Notes:
github-actions[bot]
2024-11-15 13:50:17 +00:00
Author: https://github.com/shannonbooth
Commit: f87041bf3a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2345
1722 changed files with 9939 additions and 9906 deletions
|
@ -13,9 +13,9 @@
|
|||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/ElapsedTimer.h>
|
||||
#include <LibGC/CellAllocator.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibJS/Heap/CellAllocator.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
||||
namespace JS {
|
||||
|
@ -24,8 +24,8 @@ class ConsoleClient;
|
|||
|
||||
// https://console.spec.whatwg.org
|
||||
class Console : public Cell {
|
||||
JS_CELL(Console, Cell);
|
||||
JS_DECLARE_ALLOCATOR(Console);
|
||||
GC_CELL(Console, Cell);
|
||||
GC_DECLARE_ALLOCATOR(Console);
|
||||
|
||||
public:
|
||||
virtual ~Console() override;
|
||||
|
@ -63,7 +63,7 @@ public:
|
|||
|
||||
Realm& realm() const { return m_realm; }
|
||||
|
||||
MarkedVector<Value> vm_arguments();
|
||||
GC::MarkedVector<Value> vm_arguments();
|
||||
|
||||
HashMap<String, unsigned>& counters() { return m_counters; }
|
||||
HashMap<String, unsigned> const& counters() const { return m_counters; }
|
||||
|
@ -95,11 +95,11 @@ private:
|
|||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
ThrowCompletionOr<String> value_vector_to_string(MarkedVector<Value> const&);
|
||||
ThrowCompletionOr<String> value_vector_to_string(GC::MarkedVector<Value> const&);
|
||||
ThrowCompletionOr<String> format_time_since(Core::ElapsedTimer timer);
|
||||
|
||||
NonnullGCPtr<Realm> m_realm;
|
||||
GCPtr<ConsoleClient> m_client;
|
||||
GC::Ref<Realm> m_realm;
|
||||
GC::Ptr<ConsoleClient> m_client;
|
||||
|
||||
HashMap<String, unsigned> m_counters;
|
||||
HashMap<String, Core::ElapsedTimer> m_timer_table;
|
||||
|
@ -107,14 +107,14 @@ private:
|
|||
};
|
||||
|
||||
class ConsoleClient : public Cell {
|
||||
JS_CELL(ConsoleClient, Cell);
|
||||
JS_DECLARE_ALLOCATOR(ConsoleClient);
|
||||
GC_CELL(ConsoleClient, Cell);
|
||||
GC_DECLARE_ALLOCATOR(ConsoleClient);
|
||||
|
||||
public:
|
||||
using PrinterArguments = Variant<Console::Group, Console::Trace, MarkedVector<Value>>;
|
||||
using PrinterArguments = Variant<Console::Group, Console::Trace, GC::MarkedVector<Value>>;
|
||||
|
||||
ThrowCompletionOr<Value> logger(Console::LogLevel log_level, MarkedVector<Value> const& args);
|
||||
ThrowCompletionOr<MarkedVector<Value>> formatter(MarkedVector<Value> const& args);
|
||||
ThrowCompletionOr<Value> logger(Console::LogLevel log_level, GC::MarkedVector<Value> const& args);
|
||||
ThrowCompletionOr<GC::MarkedVector<Value>> formatter(GC::MarkedVector<Value> const& args);
|
||||
virtual ThrowCompletionOr<Value> printer(Console::LogLevel log_level, PrinterArguments) = 0;
|
||||
|
||||
virtual void add_css_style_to_current_message(StringView) { }
|
||||
|
@ -123,14 +123,14 @@ public:
|
|||
virtual void clear() = 0;
|
||||
virtual void end_group() = 0;
|
||||
|
||||
ThrowCompletionOr<String> generically_format_values(MarkedVector<Value> const&);
|
||||
ThrowCompletionOr<String> generically_format_values(GC::MarkedVector<Value> const&);
|
||||
|
||||
protected:
|
||||
explicit ConsoleClient(Console&);
|
||||
virtual ~ConsoleClient() override;
|
||||
virtual void visit_edges(Visitor& visitor) override;
|
||||
|
||||
NonnullGCPtr<Console> m_console;
|
||||
GC::Ref<Console> m_console;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue