
This commit un-deprecates DeprecatedString, and repurposes it as a byte string. As the null state has already been removed, there are no other particularly hairy blockers in repurposing this type as a byte string (what it _really_ is). This commit is auto-generated: $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \ Meta Ports Ladybird Tests Kernel) $ perl -pie 's/\bDeprecatedString\b/ByteString/g; s/deprecated_string/byte_string/g' $xs $ clang-format --style=file -i \ $(git diff --name-only | grep \.cpp\|\.h) $ gn format $(git ls-files '*.gn' '*.gni')
49 lines
1.8 KiB
C++
49 lines
1.8 KiB
C++
/*
|
|
* Copyright (c) 2022, Ben Abraham <ben.d.abraham@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/URL.h>
|
|
#include <LibWeb/DOM/Document.h>
|
|
#include <LibWeb/Forward.h>
|
|
|
|
namespace Web::HTML {
|
|
|
|
class WorkerEnvironmentSettingsObject final
|
|
: public EnvironmentSettingsObject {
|
|
JS_CELL(WindowEnvironmentSettingsObject, EnvironmentSettingsObject);
|
|
JS_DECLARE_ALLOCATOR(WorkerEnvironmentSettingsObject);
|
|
|
|
public:
|
|
WorkerEnvironmentSettingsObject(NonnullOwnPtr<JS::ExecutionContext> execution_context, JS::NonnullGCPtr<WorkerGlobalScope> global_scope)
|
|
: EnvironmentSettingsObject(move(execution_context))
|
|
, m_global_scope(global_scope)
|
|
{
|
|
}
|
|
|
|
static JS::NonnullGCPtr<WorkerEnvironmentSettingsObject> setup(JS::NonnullGCPtr<Page> page, NonnullOwnPtr<JS::ExecutionContext> execution_context /* FIXME: null or an environment reservedEnvironment, a URL topLevelCreationURL, and an origin topLevelOrigin */);
|
|
|
|
virtual ~WorkerEnvironmentSettingsObject() override = default;
|
|
|
|
JS::GCPtr<DOM::Document> responsible_document() override { return nullptr; }
|
|
ByteString api_url_character_encoding() override { return m_api_url_character_encoding; }
|
|
AK::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:
|
|
virtual void visit_edges(JS::Cell::Visitor&) override;
|
|
|
|
ByteString m_api_url_character_encoding;
|
|
AK::URL m_url;
|
|
HTML::Origin m_origin;
|
|
HTML::PolicyContainer m_policy_container;
|
|
|
|
JS::NonnullGCPtr<WorkerGlobalScope> m_global_scope;
|
|
};
|
|
|
|
}
|