2022-02-17 09:31:09 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, Ben Abraham <ben.d.abraham@gmail.com>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2024-03-18 00:22:27 -03:00
|
|
|
#include <LibURL/URL.h>
|
2022-02-17 09:31:09 -03:00
|
|
|
#include <LibWeb/DOM/Document.h>
|
|
|
|
|
#include <LibWeb/Forward.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
|
|
|
|
class WorkerEnvironmentSettingsObject final
|
2022-09-24 18:39:23 -03:00
|
|
|
: public EnvironmentSettingsObject {
|
2024-11-14 12:01:23 -03:00
|
|
|
GC_CELL(WorkerEnvironmentSettingsObject, EnvironmentSettingsObject);
|
|
|
|
|
GC_DECLARE_ALLOCATOR(WorkerEnvironmentSettingsObject);
|
2022-09-24 18:39:23 -03:00
|
|
|
|
2022-02-17 09:31:09 -03:00
|
|
|
public:
|
2024-11-14 12:01:23 -03:00
|
|
|
WorkerEnvironmentSettingsObject(NonnullOwnPtr<JS::ExecutionContext> execution_context, GC::Ref<WorkerGlobalScope> global_scope)
|
2022-08-04 16:30:33 -03:00
|
|
|
: EnvironmentSettingsObject(move(execution_context))
|
2023-11-08 15:47:41 -03:00
|
|
|
, m_global_scope(global_scope)
|
2022-02-17 09:31:09 -03:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
static GC::Ref<WorkerEnvironmentSettingsObject> setup(GC::Ref<Page> page, NonnullOwnPtr<JS::ExecutionContext> execution_context, SerializedEnvironmentSettingsObject const& outside_settings, HighResolutionTime::DOMHighResTimeStamp unsafe_worker_creation_time);
|
2022-02-17 09:31:09 -03:00
|
|
|
|
|
|
|
|
virtual ~WorkerEnvironmentSettingsObject() override = default;
|
|
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
GC::Ptr<DOM::Document> responsible_document() override { return nullptr; }
|
2024-11-23 02:51:03 -03:00
|
|
|
String api_url_character_encoding() const override { return m_api_url_character_encoding; }
|
|
|
|
|
URL::URL api_base_url() const override;
|
|
|
|
|
URL::Origin origin() const override;
|
|
|
|
|
PolicyContainer policy_container() const override;
|
|
|
|
|
CanUseCrossOriginIsolatedAPIs cross_origin_isolated_capability() const override;
|
2022-02-17 09:31:09 -03:00
|
|
|
|
|
|
|
|
private:
|
2023-11-08 15:47:41 -03:00
|
|
|
virtual void visit_edges(JS::Cell::Visitor&) override;
|
|
|
|
|
|
2023-12-23 23:44:50 -03:00
|
|
|
String m_api_url_character_encoding;
|
2024-10-04 23:33:34 -03:00
|
|
|
URL::Origin m_origin;
|
2023-11-08 15:47:41 -03:00
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
GC::Ref<WorkerGlobalScope> m_global_scope;
|
2022-02-17 09:31:09 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|