mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
The idea originally was that the WebContentConsoleClient would perform some amount of console handling that both InspectorConsoleClient and DevToolsConsoleClient needed. But in implementing the DevTools console, it's become clear that these implementations will not overlap at all. So this patch moves the existing Inspector functionality away from WebContentConsoleClient.
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2025, Tim Flynn <trflynn89@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibJS/Console.h>
|
|
#include <LibJS/Forward.h>
|
|
#include <LibWeb/Forward.h>
|
|
#include <WebContent/Forward.h>
|
|
#include <WebContent/WebContentConsoleClient.h>
|
|
|
|
namespace WebContent {
|
|
|
|
class DevToolsConsoleClient final : public WebContentConsoleClient {
|
|
GC_CELL(DevToolsConsoleClient, WebContentConsoleClient);
|
|
GC_DECLARE_ALLOCATOR(DevToolsConsoleClient);
|
|
|
|
public:
|
|
static GC::Ref<DevToolsConsoleClient> create(JS::Realm&, JS::Console&, PageClient&);
|
|
virtual ~DevToolsConsoleClient() override;
|
|
|
|
private:
|
|
DevToolsConsoleClient(JS::Realm&, JS::Console&, PageClient&, ConsoleGlobalEnvironmentExtensions&);
|
|
|
|
virtual void handle_result(JS::Value) override;
|
|
virtual void report_exception(JS::Error const&, bool) override;
|
|
virtual void end_group() override { }
|
|
virtual void clear() override { }
|
|
|
|
virtual void send_messages(i32 start_index) override;
|
|
virtual JS::ThrowCompletionOr<JS::Value> printer(JS::Console::LogLevel, PrinterArguments) override;
|
|
};
|
|
|
|
}
|