mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibWeb: Begin serializing global object as part of serialized ESO
Instead of passing through window's associated document's URL as an extra argument to starting up a worker. This will allow for improving the representation of 'outside settings' when setting up a Worker.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
513830532b
commit
665654a1c4
Notes:
github-actions[bot]
2026-02-23 10:43:27 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/665654a1c4f Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8070 Reviewed-by: https://github.com/gmta ✅
@@ -20,6 +20,19 @@ enum class CanUseCrossOriginIsolatedAPIs : u8 {
|
||||
Yes,
|
||||
};
|
||||
|
||||
struct SerializedDocument {
|
||||
URL::URL url;
|
||||
};
|
||||
|
||||
struct SerializedWindow {
|
||||
SerializedDocument associated_document;
|
||||
};
|
||||
|
||||
struct SerializedWorkerGlobalScope {
|
||||
};
|
||||
|
||||
using SerializedGlobal = Variant<SerializedWindow, SerializedWorkerGlobalScope>;
|
||||
|
||||
struct SerializedEnvironmentSettingsObject {
|
||||
String id;
|
||||
URL::URL creation_url;
|
||||
@@ -32,12 +45,25 @@ struct SerializedEnvironmentSettingsObject {
|
||||
SerializedPolicyContainer policy_container;
|
||||
CanUseCrossOriginIsolatedAPIs cross_origin_isolated_capability;
|
||||
double time_origin;
|
||||
SerializedGlobal global;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace IPC {
|
||||
|
||||
template<>
|
||||
WEB_API ErrorOr<void> encode(Encoder&, Web::HTML::SerializedWindow const&);
|
||||
|
||||
template<>
|
||||
WEB_API ErrorOr<Web::HTML::SerializedWindow> decode(Decoder&);
|
||||
|
||||
template<>
|
||||
WEB_API ErrorOr<void> encode(Encoder&, Web::HTML::SerializedWorkerGlobalScope const&);
|
||||
|
||||
template<>
|
||||
WEB_API ErrorOr<Web::HTML::SerializedWorkerGlobalScope> decode(Decoder&);
|
||||
|
||||
template<>
|
||||
WEB_API ErrorOr<void> encode(Encoder&, Web::HTML::SerializedEnvironmentSettingsObject const&);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user