ladybird/Services/WebContent/WebContentConsoleClient.h
Tim Ledbetter 568531f06a
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Everywhere: Mark GC::Cell derived classes as Weakable explicitly
Previously, all `GC::Cell` derived classes were Weakable. Marking only
those classes that require this functionality as Weakable allows us to
reduce the memory footprint of some frequently used classes.
2025-03-29 17:36:33 -05:00

42 lines
1.2 KiB
C++

/*
* Copyright (c) 2021, Brandon Scott <xeon.productions@gmail.com>
* Copyright (c) 2020, Hunter Salyer <thefalsehonesty@gmail.com>
* Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibJS/Console.h>
#include <LibJS/Forward.h>
#include <LibJS/Runtime/Value.h>
#include <LibWeb/Forward.h>
#include <WebContent/Forward.h>
namespace WebContent {
class WebContentConsoleClient : public JS::ConsoleClient
, public Weakable<WebContentConsoleClient> {
GC_CELL(WebContentConsoleClient, JS::ConsoleClient);
GC_DECLARE_ALLOCATOR(WebContentConsoleClient);
public:
virtual ~WebContentConsoleClient() override;
void handle_input(StringView js_source);
virtual void handle_result(JS::Value) = 0;
virtual void send_messages(i32 start_index) = 0;
protected:
WebContentConsoleClient(JS::Realm&, JS::Console&, PageClient&, ConsoleGlobalEnvironmentExtensions&);
virtual void visit_edges(JS::Cell::Visitor&) override;
GC::Ref<JS::Realm> m_realm;
GC::Ref<PageClient> m_client;
GC::Ref<ConsoleGlobalEnvironmentExtensions> m_console_global_environment_extensions;
};
}