/* * 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(Document& document) { return adopt_ref(*new AbortController(document)); } static NonnullRefPtr create_with_global_object(Bindings::WindowObject& window_object) { return AbortController::create(window_object.impl().associated_document()); } virtual ~AbortController() override; // https://dom.spec.whatwg.org/#dom-abortcontroller-signal NonnullRefPtr signal() const { return m_signal; } void abort(); private: AbortController(Document& document); // https://dom.spec.whatwg.org/#abortcontroller-signal NonnullRefPtr m_signal; }; }