mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02:00
LibWeb: Serialize and pass to the WebWorker the current ESO
This allows the initial fetch() in the run a worker AO to use the proper values from the outside settings.
This commit is contained in:
committed by
Andreas Kling
parent
4d22358e05
commit
b5acc5f2df
Notes:
sideshowbarker
2024-07-17 06:39:26 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/b5acc5f2df Pull-request: https://github.com/SerenityOS/serenity/pull/23476
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/HTML/PolicyContainers.h>
|
||||
#include <LibWeb/HTML/Scripting/Environments.h>
|
||||
#include <LibWeb/HTML/Scripting/SerializedEnvironmentSettingsObject.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
class EnvironmentSettingsSnapshot final
|
||||
: public EnvironmentSettingsObject {
|
||||
JS_CELL(EnvironmentSettingsSnapshot, EnvironmentSettingsObject);
|
||||
JS_DECLARE_ALLOCATOR(EnvironmentSettingsSnapshot);
|
||||
|
||||
public:
|
||||
EnvironmentSettingsSnapshot(NonnullOwnPtr<JS::ExecutionContext>, SerializedEnvironmentSettingsObject const&);
|
||||
|
||||
virtual ~EnvironmentSettingsSnapshot() override;
|
||||
|
||||
JS::GCPtr<DOM::Document> responsible_document() override { return nullptr; }
|
||||
String api_url_character_encoding() override { return m_api_url_character_encoding; }
|
||||
URL api_base_url() override { return m_url; }
|
||||
Origin origin() override { return m_origin; }
|
||||
PolicyContainer policy_container() override { return m_policy_container; }
|
||||
CanUseCrossOriginIsolatedAPIs cross_origin_isolated_capability() override { return CanUseCrossOriginIsolatedAPIs::No; }
|
||||
|
||||
private:
|
||||
String m_api_url_character_encoding;
|
||||
URL m_url;
|
||||
HTML::Origin m_origin;
|
||||
HTML::PolicyContainer m_policy_container;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user