mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-25 14:05:15 +00:00
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. :^)
42 lines
957 B
C++
42 lines
957 B
C++
/*
|
|
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/String.h>
|
|
#include <LibJS/Forward.h>
|
|
#include <LibWeb/Bindings/PlatformObject.h>
|
|
|
|
namespace Web::HTML {
|
|
|
|
class MediaError final : public Bindings::PlatformObject {
|
|
WEB_PLATFORM_OBJECT(MediaError, Bindings::PlatformObject);
|
|
JS_DECLARE_ALLOCATOR(MediaError);
|
|
|
|
public:
|
|
enum class Code : u16 {
|
|
Aborted = 1,
|
|
Network = 2,
|
|
Decode = 3,
|
|
SrcNotSupported = 4,
|
|
};
|
|
|
|
Code code() const { return m_code; }
|
|
String const& message() const { return m_message; }
|
|
|
|
private:
|
|
MediaError(JS::Realm&, Code code, String message);
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
// https://html.spec.whatwg.org/multipage/media.html#dom-mediaerror-code
|
|
Code m_code;
|
|
|
|
// https://html.spec.whatwg.org/multipage/media.html#dom-mediaerror-message
|
|
String m_message;
|
|
};
|
|
|
|
}
|