Files
ladybird/Libraries/LibWeb/EncryptedMediaExtensions/MediaKeySystemAccess.h
Shannon Booth 5adfd1c43a LibWeb/Bindings: Generate struct definitions from IDL dictionaries
Previously we were inconsistent by generating code for enum definitions
but not generating code for dictionaries. With future changes to the
IDL generator to expose helpers to convert to and from IDL values
this produced circular depdendencies. To solve this problem, also
generate the dictionary definitions in bindings headers.
2026-05-09 10:49:49 +02:00

41 lines
1.3 KiB
C++

/*
* Copyright (c) 2025, stelar7 <dudedbz@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/RefPtr.h>
#include <LibGC/Heap.h>
#include <LibWeb/Bindings/PlatformObject.h>
#include <LibWeb/EncryptedMediaExtensions/EncryptedMediaExtensions.h>
#include <LibWeb/EncryptedMediaExtensions/KeySystem.h>
namespace Web::EncryptedMediaExtensions {
// https://w3c.github.io/encrypted-media/#dom-mediakeysystemaccess
class MediaKeySystemAccess : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(MediaKeySystemAccess, Bindings::PlatformObject);
GC_DECLARE_ALLOCATOR(MediaKeySystemAccess);
public:
virtual ~MediaKeySystemAccess() override;
[[nodiscard]] static GC::Ref<MediaKeySystemAccess> create(JS::Realm&, Utf16String const&, Bindings::MediaKeySystemConfiguration, NonnullOwnPtr<KeySystem>);
[[nodiscard]] Utf16String key_system() const { return m_key_system; }
[[nodiscard]] Bindings::MediaKeySystemConfiguration get_configuration() const { return m_configuration; }
protected:
explicit MediaKeySystemAccess(JS::Realm&, Utf16String const&, Bindings::MediaKeySystemConfiguration, NonnullOwnPtr<KeySystem>);
virtual void initialize(JS::Realm&) override;
private:
Utf16String m_key_system;
Bindings::MediaKeySystemConfiguration m_configuration;
NonnullOwnPtr<KeySystem> m_cdm_implementation;
};
}