mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibDevTools+LibWebView+WebContent: Report exceptions to DevTools
This commit is contained in:
parent
5d0fbc85e5
commit
9eca5febd1
Notes:
github-actions[bot]
2025-03-27 14:15:04 +00:00
Author: https://github.com/trflynn89
Commit: 9eca5febd1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4117
Reviewed-by: https://github.com/gmta ✅
4 changed files with 232 additions and 45 deletions
|
@ -7,23 +7,61 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/JsonValue.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Time.h>
|
||||
#include <AK/Variant.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibIPC/Forward.h>
|
||||
#include <LibJS/Console.h>
|
||||
|
||||
namespace WebView {
|
||||
|
||||
struct ConsoleOutput {
|
||||
struct ConsoleLog {
|
||||
JS::Console::LogLevel level;
|
||||
UnixDateTime timestamp;
|
||||
Vector<JsonValue> arguments;
|
||||
};
|
||||
|
||||
struct StackFrame {
|
||||
Optional<String> function;
|
||||
Optional<String> file;
|
||||
Optional<size_t> line;
|
||||
Optional<size_t> column;
|
||||
};
|
||||
|
||||
struct ConsoleError {
|
||||
String name;
|
||||
String message;
|
||||
Vector<StackFrame> trace;
|
||||
bool inside_promise { false };
|
||||
};
|
||||
|
||||
struct ConsoleOutput {
|
||||
UnixDateTime timestamp;
|
||||
Variant<ConsoleLog, ConsoleError> output;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace IPC {
|
||||
|
||||
template<>
|
||||
ErrorOr<void> encode(Encoder&, WebView::ConsoleLog const&);
|
||||
|
||||
template<>
|
||||
ErrorOr<WebView::ConsoleLog> decode(Decoder&);
|
||||
|
||||
template<>
|
||||
ErrorOr<void> encode(Encoder&, WebView::StackFrame const&);
|
||||
|
||||
template<>
|
||||
ErrorOr<WebView::StackFrame> decode(Decoder&);
|
||||
|
||||
template<>
|
||||
ErrorOr<void> encode(Encoder&, WebView::ConsoleError const&);
|
||||
|
||||
template<>
|
||||
ErrorOr<WebView::ConsoleError> decode(Decoder&);
|
||||
|
||||
template<>
|
||||
ErrorOr<void> encode(Encoder&, WebView::ConsoleOutput const&);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue