/* * Copyright (c) 2025, Psychpsyo * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include namespace Web::Internals { GC_DEFINE_ALLOCATOR(FakeXRDevice); GC::Ref FakeXRDevice::create(JS::Realm& realm) { return realm.create(realm); } FakeXRDevice::FakeXRDevice(JS::Realm& realm) : InternalsBase(realm) { } FakeXRDevice::~FakeXRDevice() = default; void FakeXRDevice::initialize(JS::Realm& realm) { WEB_SET_PROTOTYPE_FOR_INTERFACE(FakeXRDevice); Base::initialize(realm); } GC::Ref FakeXRDevice::disconnect() const { // behaves as if device was disconnected // FIXME: Implement this once we have actual devices that can disconnect. auto& realm = HTML::relevant_realm(*this); auto promise = WebIDL::create_promise(realm); WebIDL::resolve_promise(realm, promise); return promise; } }