mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 06:32:26 +02:00
LibJS+LibWeb: Make Console, ConsoleClient & subclasses GC-allocated
These objects had confusing ownership semantics. Let's just throw them all on the GC heap and stop worrying about it.
This commit is contained in:
@@ -16,16 +16,18 @@ namespace Web::HTML {
|
||||
|
||||
class WorkerDebugConsoleClient final
|
||||
: public JS::ConsoleClient
|
||||
, public RefCounted<WorkerDebugConsoleClient>
|
||||
, public Weakable<WorkerDebugConsoleClient> {
|
||||
public:
|
||||
WorkerDebugConsoleClient(JS::Console& console);
|
||||
JS_CELL(WorkerDebugConsoleClient, JS::ConsoleClient);
|
||||
JS_DECLARE_ALLOCATOR(WorkerDebugConsoleClient);
|
||||
|
||||
public:
|
||||
virtual void clear() override;
|
||||
virtual void end_group() override;
|
||||
virtual JS::ThrowCompletionOr<JS::Value> printer(JS::Console::LogLevel log_level, PrinterArguments arguments) override;
|
||||
|
||||
private:
|
||||
WorkerDebugConsoleClient(JS::Console& console);
|
||||
|
||||
int m_group_stack_depth { 0 };
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user