
With this change, we now have ~1200 CellAllocators across both LibJS and LibWeb in a normal WebContent instance. This gives us a minimum heap size of 4.7 MiB in the scenario where we only have one cell allocated per type. Of course, in practice there will be many more of each type, so the effective overhead is quite a bit smaller than that in practice. I left a few types unconverted to this mechanism because I got tired of doing this. :^)
38 lines
1.2 KiB
C++
38 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibJS/Heap/Cell.h>
|
|
#include <LibWeb/HTML/Scripting/Environments.h>
|
|
|
|
namespace Web::HTML {
|
|
|
|
class WindowEnvironmentSettingsObject final : public EnvironmentSettingsObject {
|
|
JS_CELL(WindowEnvironmentSettingsObject, EnvironmentSettingsObject);
|
|
JS_DECLARE_ALLOCATOR(WindowEnvironmentSettingsObject);
|
|
|
|
public:
|
|
static void setup(AK::URL const& creation_url, NonnullOwnPtr<JS::ExecutionContext>, Optional<Environment>, AK::URL top_level_creation_url, Origin top_level_origin);
|
|
|
|
virtual ~WindowEnvironmentSettingsObject() override;
|
|
|
|
virtual JS::GCPtr<DOM::Document> responsible_document() override;
|
|
virtual DeprecatedString api_url_character_encoding() override;
|
|
virtual AK::URL api_base_url() override;
|
|
virtual Origin origin() override;
|
|
virtual PolicyContainer policy_container() override;
|
|
virtual CanUseCrossOriginIsolatedAPIs cross_origin_isolated_capability() override;
|
|
|
|
private:
|
|
WindowEnvironmentSettingsObject(Window&, NonnullOwnPtr<JS::ExecutionContext>);
|
|
|
|
virtual void visit_edges(JS::Cell::Visitor&) override;
|
|
|
|
JS::GCPtr<Window> m_window;
|
|
};
|
|
|
|
}
|