mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-23 17:33:12 +00:00
LibWeb/Streams: Put algorithm definitions in a separate header file
To solve a future cyclic dependency problem.
This commit is contained in:
parent
f110edebd1
commit
c6d0f87bb7
Notes:
github-actions[bot]
2024-12-11 14:12:50 +00:00
Author: https://github.com/shannonbooth
Commit: c6d0f87bb7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2831
Reviewed-by: https://github.com/kennethmyhra ✅
Reviewed-by: https://github.com/trflynn89
2 changed files with 27 additions and 10 deletions
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
#include <LibGC/Ptr.h>
|
#include <LibGC/Ptr.h>
|
||||||
#include <LibWeb/Forward.h>
|
#include <LibWeb/Forward.h>
|
||||||
|
#include <LibWeb/Streams/Algorithms.h>
|
||||||
#include <LibWeb/Streams/ReadableStream.h>
|
#include <LibWeb/Streams/ReadableStream.h>
|
||||||
#include <LibWeb/WebIDL/CallbackType.h>
|
#include <LibWeb/WebIDL/CallbackType.h>
|
||||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||||
|
@ -19,16 +20,6 @@
|
||||||
|
|
||||||
namespace Web::Streams {
|
namespace Web::Streams {
|
||||||
|
|
||||||
using SizeAlgorithm = GC::Function<JS::Completion(JS::Value)>;
|
|
||||||
using PullAlgorithm = GC::Function<GC::Ref<WebIDL::Promise>()>;
|
|
||||||
using CancelAlgorithm = GC::Function<GC::Ref<WebIDL::Promise>(JS::Value)>;
|
|
||||||
using StartAlgorithm = GC::Function<WebIDL::ExceptionOr<JS::Value>()>;
|
|
||||||
using AbortAlgorithm = GC::Function<GC::Ref<WebIDL::Promise>(JS::Value)>;
|
|
||||||
using CloseAlgorithm = GC::Function<GC::Ref<WebIDL::Promise>()>;
|
|
||||||
using WriteAlgorithm = GC::Function<GC::Ref<WebIDL::Promise>(JS::Value)>;
|
|
||||||
using FlushAlgorithm = GC::Function<GC::Ref<WebIDL::Promise>()>;
|
|
||||||
using TransformAlgorithm = GC::Function<GC::Ref<WebIDL::Promise>(JS::Value)>;
|
|
||||||
|
|
||||||
WebIDL::ExceptionOr<GC::Ref<ReadableStreamDefaultReader>> acquire_readable_stream_default_reader(ReadableStream&);
|
WebIDL::ExceptionOr<GC::Ref<ReadableStreamDefaultReader>> acquire_readable_stream_default_reader(ReadableStream&);
|
||||||
WebIDL::ExceptionOr<GC::Ref<ReadableStreamBYOBReader>> acquire_readable_stream_byob_reader(ReadableStream&);
|
WebIDL::ExceptionOr<GC::Ref<ReadableStreamBYOBReader>> acquire_readable_stream_byob_reader(ReadableStream&);
|
||||||
bool is_readable_stream_locked(ReadableStream const&);
|
bool is_readable_stream_locked(ReadableStream const&);
|
||||||
|
|
26
Libraries/LibWeb/Streams/Algorithms.h
Normal file
26
Libraries/LibWeb/Streams/Algorithms.h
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2024, Shannon Booth <shannon@serenityos.org>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <LibGC/Function.h>
|
||||||
|
#include <LibGC/Ptr.h>
|
||||||
|
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||||
|
#include <LibWeb/WebIDL/Promise.h>
|
||||||
|
|
||||||
|
namespace Web::Streams {
|
||||||
|
|
||||||
|
using SizeAlgorithm = GC::Function<JS::Completion(JS::Value)>;
|
||||||
|
using PullAlgorithm = GC::Function<GC::Ref<WebIDL::Promise>()>;
|
||||||
|
using CancelAlgorithm = GC::Function<GC::Ref<WebIDL::Promise>(JS::Value)>;
|
||||||
|
using StartAlgorithm = GC::Function<WebIDL::ExceptionOr<JS::Value>()>;
|
||||||
|
using AbortAlgorithm = GC::Function<GC::Ref<WebIDL::Promise>(JS::Value)>;
|
||||||
|
using CloseAlgorithm = GC::Function<GC::Ref<WebIDL::Promise>()>;
|
||||||
|
using WriteAlgorithm = GC::Function<GC::Ref<WebIDL::Promise>(JS::Value)>;
|
||||||
|
using FlushAlgorithm = GC::Function<GC::Ref<WebIDL::Promise>()>;
|
||||||
|
using TransformAlgorithm = GC::Function<GC::Ref<WebIDL::Promise>(JS::Value)>;
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue