/* * Copyright (c) 2021, Luke Wilde * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include namespace Web::DOM { // https://dom.spec.whatwg.org/#abortcontroller class AbortController final : public RefCounted , public Weakable , public Bindings::Wrappable { public: using WrapperType = Bindings::AbortControllerWrapper; static NonnullRefPtr create() { return adopt_ref(*new AbortController()); } static NonnullRefPtr create_with_global_object(Bindings::WindowObject&) { return AbortController::create(); } virtual ~AbortController() override = default; // https://dom.spec.whatwg.org/#dom-abortcontroller-signal NonnullRefPtr signal() const { return m_signal; } void abort(JS::Value reason); private: AbortController(); // https://dom.spec.whatwg.org/#abortcontroller-signal NonnullRefPtr m_signal; }; }