
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. :^)
36 lines
917 B
C++
36 lines
917 B
C++
/*
|
|
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Bindings/PlatformObject.h>
|
|
|
|
namespace Web::DOMParsing {
|
|
|
|
class XMLSerializer final : public Bindings::PlatformObject {
|
|
WEB_PLATFORM_OBJECT(XMLSerializer, Bindings::PlatformObject);
|
|
JS_DECLARE_ALLOCATOR(XMLSerializer);
|
|
|
|
public:
|
|
static WebIDL::ExceptionOr<JS::NonnullGCPtr<XMLSerializer>> construct_impl(JS::Realm&);
|
|
|
|
virtual ~XMLSerializer() override;
|
|
|
|
WebIDL::ExceptionOr<DeprecatedString> serialize_to_string(JS::NonnullGCPtr<DOM::Node const> root);
|
|
|
|
private:
|
|
explicit XMLSerializer(JS::Realm&);
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
};
|
|
|
|
enum class RequireWellFormed {
|
|
No,
|
|
Yes,
|
|
};
|
|
|
|
WebIDL::ExceptionOr<DeprecatedString> serialize_node_to_xml_string(JS::NonnullGCPtr<DOM::Node const> root, RequireWellFormed require_well_formed);
|
|
}
|