ladybird/Userland/Libraries/LibWeb/DOM/AbortController.cpp
Lenny Maiorani c37820b898 Libraries: Use default constructors/destructors in LibWeb
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-17 17:23:49 +00:00

26 lines
606 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/DOM/AbortController.h>
#include <LibWeb/DOM/AbortSignal.h>
namespace Web::DOM {
// https://dom.spec.whatwg.org/#dom-abortcontroller-abortcontroller
AbortController::AbortController()
: m_signal(AbortSignal::create())
{
}
// https://dom.spec.whatwg.org/#dom-abortcontroller-abort
void AbortController::abort(JS::Value reason)
{
// The abort(reason) method steps are to signal abort on thiss signal with reason if it is given.
m_signal->signal_abort(reason);
}
}