mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +00:00
LibWeb: Stub AudioContext constructor
This is enough to make Discord not throw up "Well this is awkward" on login.
This commit is contained in:
parent
78db4e683f
commit
a5936864d9
11 changed files with 144 additions and 0 deletions
34
Userland/Libraries/LibWeb/WebAudio/AudioContext.cpp
Normal file
34
Userland/Libraries/LibWeb/WebAudio/AudioContext.cpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Luke Wilde <lukew@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/WebAudio/AudioContext.h>
|
||||
|
||||
namespace Web::WebAudio {
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#dom-audiocontext-audiocontext
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<AudioContext>> AudioContext::construct_impl(JS::Realm& realm)
|
||||
{
|
||||
dbgln("(STUBBED) new AudioContext()");
|
||||
return MUST_OR_THROW_OOM(realm.heap().allocate<AudioContext>(realm, realm));
|
||||
}
|
||||
|
||||
AudioContext::AudioContext(JS::Realm& realm)
|
||||
: BaseAudioContext(realm)
|
||||
{
|
||||
}
|
||||
|
||||
AudioContext::~AudioContext() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> AudioContext::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::AudioContextPrototype>(realm, "AudioContext"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue