mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +00:00
LibWeb: Validate AudioParam context in AudioNode::connect()
An exception is now thown if an `AudioNode` attempts to connect to an `AudioParam` from a different `BaseAudioContext`.
This commit is contained in:
parent
2edd0812ca
commit
5c57acf140
Notes:
github-actions[bot]
2025-01-09 11:35:50 +00:00
Author: https://github.com/tcl3
Commit: 5c57acf140
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3191
Reviewed-by: https://github.com/shannonbooth ✅
14 changed files with 54 additions and 43 deletions
|
@ -18,10 +18,12 @@ class AudioParam final : public Bindings::PlatformObject {
|
|||
GC_DECLARE_ALLOCATOR(AudioParam);
|
||||
|
||||
public:
|
||||
static GC::Ref<AudioParam> create(JS::Realm&, float default_value, float min_value, float max_value, Bindings::AutomationRate);
|
||||
static GC::Ref<AudioParam> create(JS::Realm&, GC::Ref<BaseAudioContext>, float default_value, float min_value, float max_value, Bindings::AutomationRate);
|
||||
|
||||
virtual ~AudioParam() override;
|
||||
|
||||
GC::Ref<BaseAudioContext> context() const { return m_context; }
|
||||
|
||||
float value() const;
|
||||
void set_value(float);
|
||||
|
||||
|
@ -41,7 +43,9 @@ public:
|
|||
WebIDL::ExceptionOr<GC::Ref<AudioParam>> cancel_and_hold_at_time(double cancel_time);
|
||||
|
||||
private:
|
||||
AudioParam(JS::Realm&, float default_value, float min_value, float max_value, Bindings::AutomationRate);
|
||||
AudioParam(JS::Realm&, GC::Ref<BaseAudioContext>, float default_value, float min_value, float max_value, Bindings::AutomationRate);
|
||||
|
||||
GC::Ref<BaseAudioContext> m_context;
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#dom-audioparam-current-value-slot
|
||||
float m_current_value {}; // [[current value]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue