mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
LibGC+Everywhere: Factor out a LibGC from LibJS
Resulting in a massive rename across almost everywhere! Alongside the namespace change, we now have the following names: * JS::NonnullGCPtr -> GC::Ref * JS::GCPtr -> GC::Ptr * JS::HeapFunction -> GC::Function * JS::CellImpl -> GC::Cell * JS::Handle -> GC::Root
This commit is contained in:
parent
ce23efc5f6
commit
f87041bf3a
Notes:
github-actions[bot]
2024-11-15 13:50:17 +00:00
Author: https://github.com/shannonbooth
Commit: f87041bf3a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2345
1722 changed files with 9939 additions and 9906 deletions
|
@ -20,7 +20,7 @@ namespace Web::Streams {
|
|||
struct PendingAbortRequest {
|
||||
// https://streams.spec.whatwg.org/#pending-abort-request-promise
|
||||
// A promise returned from WritableStreamAbort
|
||||
JS::NonnullGCPtr<WebIDL::Promise> promise;
|
||||
GC::Ref<WebIDL::Promise> promise;
|
||||
|
||||
// https://streams.spec.whatwg.org/#pending-abort-request-reason
|
||||
// A JavaScript value that was passed as the abort reason to WritableStreamAbort
|
||||
|
@ -34,7 +34,7 @@ struct PendingAbortRequest {
|
|||
// https://streams.spec.whatwg.org/#writablestream
|
||||
class WritableStream final : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(WritableStream, Bindings::PlatformObject);
|
||||
JS_DECLARE_ALLOCATOR(WritableStream);
|
||||
GC_DECLARE_ALLOCATOR(WritableStream);
|
||||
|
||||
public:
|
||||
enum class State {
|
||||
|
@ -44,31 +44,31 @@ public:
|
|||
Errored,
|
||||
};
|
||||
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<WritableStream>> construct_impl(JS::Realm& realm, Optional<JS::Handle<JS::Object>> const& underlying_sink, QueuingStrategy const& = {});
|
||||
static WebIDL::ExceptionOr<GC::Ref<WritableStream>> construct_impl(JS::Realm& realm, Optional<GC::Root<JS::Object>> const& underlying_sink, QueuingStrategy const& = {});
|
||||
|
||||
virtual ~WritableStream() = default;
|
||||
|
||||
bool locked() const;
|
||||
JS::GCPtr<WebIDL::Promise> abort(JS::Value reason);
|
||||
JS::GCPtr<WebIDL::Promise> close();
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<WritableStreamDefaultWriter>> get_writer();
|
||||
GC::Ptr<WebIDL::Promise> abort(JS::Value reason);
|
||||
GC::Ptr<WebIDL::Promise> close();
|
||||
WebIDL::ExceptionOr<GC::Ref<WritableStreamDefaultWriter>> get_writer();
|
||||
|
||||
bool backpressure() const { return m_backpressure; }
|
||||
void set_backpressure(bool value) { m_backpressure = value; }
|
||||
|
||||
JS::GCPtr<WebIDL::Promise const> close_request() const { return m_close_request; }
|
||||
JS::GCPtr<WebIDL::Promise> close_request() { return m_close_request; }
|
||||
void set_close_request(JS::GCPtr<WebIDL::Promise> value) { m_close_request = value; }
|
||||
GC::Ptr<WebIDL::Promise const> close_request() const { return m_close_request; }
|
||||
GC::Ptr<WebIDL::Promise> close_request() { return m_close_request; }
|
||||
void set_close_request(GC::Ptr<WebIDL::Promise> value) { m_close_request = value; }
|
||||
|
||||
JS::GCPtr<WritableStreamDefaultController const> controller() const { return m_controller; }
|
||||
JS::GCPtr<WritableStreamDefaultController> controller() { return m_controller; }
|
||||
void set_controller(JS::GCPtr<WritableStreamDefaultController> value) { m_controller = value; }
|
||||
GC::Ptr<WritableStreamDefaultController const> controller() const { return m_controller; }
|
||||
GC::Ptr<WritableStreamDefaultController> controller() { return m_controller; }
|
||||
void set_controller(GC::Ptr<WritableStreamDefaultController> value) { m_controller = value; }
|
||||
|
||||
JS::GCPtr<WebIDL::Promise const> in_flight_write_request() const { return m_in_flight_write_request; }
|
||||
void set_in_flight_write_request(JS::GCPtr<WebIDL::Promise> value) { m_in_flight_write_request = value; }
|
||||
GC::Ptr<WebIDL::Promise const> in_flight_write_request() const { return m_in_flight_write_request; }
|
||||
void set_in_flight_write_request(GC::Ptr<WebIDL::Promise> value) { m_in_flight_write_request = value; }
|
||||
|
||||
JS::GCPtr<WebIDL::Promise const> in_flight_close_request() const { return m_in_flight_close_request; }
|
||||
void set_in_flight_close_request(JS::GCPtr<WebIDL::Promise> value) { m_in_flight_close_request = value; }
|
||||
GC::Ptr<WebIDL::Promise const> in_flight_close_request() const { return m_in_flight_close_request; }
|
||||
void set_in_flight_close_request(GC::Ptr<WebIDL::Promise> value) { m_in_flight_close_request = value; }
|
||||
|
||||
Optional<PendingAbortRequest>& pending_abort_request() { return m_pending_abort_request; }
|
||||
void set_pending_abort_request(Optional<PendingAbortRequest>&& value) { m_pending_abort_request = move(value); }
|
||||
|
@ -79,11 +79,11 @@ public:
|
|||
JS::Value stored_error() const { return m_stored_error; }
|
||||
void set_stored_error(JS::Value value) { m_stored_error = value; }
|
||||
|
||||
JS::GCPtr<WritableStreamDefaultWriter const> writer() const { return m_writer; }
|
||||
JS::GCPtr<WritableStreamDefaultWriter> writer() { return m_writer; }
|
||||
void set_writer(JS::GCPtr<WritableStreamDefaultWriter> value) { m_writer = value; }
|
||||
GC::Ptr<WritableStreamDefaultWriter const> writer() const { return m_writer; }
|
||||
GC::Ptr<WritableStreamDefaultWriter> writer() { return m_writer; }
|
||||
void set_writer(GC::Ptr<WritableStreamDefaultWriter> value) { m_writer = value; }
|
||||
|
||||
SinglyLinkedList<JS::NonnullGCPtr<WebIDL::Promise>>& write_requests() { return m_write_requests; }
|
||||
SinglyLinkedList<GC::Ref<WebIDL::Promise>>& write_requests() { return m_write_requests; }
|
||||
|
||||
private:
|
||||
explicit WritableStream(JS::Realm&);
|
||||
|
@ -98,11 +98,11 @@ private:
|
|||
|
||||
// https://streams.spec.whatwg.org/#writablestream-closerequest
|
||||
// The promise returned from the writer’s close() method
|
||||
JS::GCPtr<WebIDL::Promise> m_close_request;
|
||||
GC::Ptr<WebIDL::Promise> m_close_request;
|
||||
|
||||
// https://streams.spec.whatwg.org/#writablestream-controller
|
||||
// A WritableStreamDefaultController created with the ability to control the state and queue of this stream
|
||||
JS::GCPtr<WritableStreamDefaultController> m_controller;
|
||||
GC::Ptr<WritableStreamDefaultController> m_controller;
|
||||
|
||||
// https://streams.spec.whatwg.org/#writablestream-detached
|
||||
// A boolean flag set to true when the stream is transferred
|
||||
|
@ -110,11 +110,11 @@ private:
|
|||
|
||||
// https://streams.spec.whatwg.org/#writablestream-inflightwriterequest
|
||||
// A slot set to the promise for the current in-flight write operation while the underlying sink's write algorithm is executing and has not yet fulfilled, used to prevent reentrant calls
|
||||
JS::GCPtr<WebIDL::Promise> m_in_flight_write_request;
|
||||
GC::Ptr<WebIDL::Promise> m_in_flight_write_request;
|
||||
|
||||
// https://streams.spec.whatwg.org/#writablestream-inflightcloserequest
|
||||
// A slot set to the promise for the current in-flight close operation while the underlying sink's close algorithm is executing and has not yet fulfilled, used to prevent the abort() method from interrupting close
|
||||
JS::GCPtr<WebIDL::Promise> m_in_flight_close_request;
|
||||
GC::Ptr<WebIDL::Promise> m_in_flight_close_request;
|
||||
|
||||
// https://streams.spec.whatwg.org/#writablestream-pendingabortrequest
|
||||
// A pending abort request
|
||||
|
@ -130,11 +130,11 @@ private:
|
|||
|
||||
// https://streams.spec.whatwg.org/#writablestream-writer
|
||||
// A WritableStreamDefaultWriter instance, if the stream is locked to a writer, or undefined if it is not
|
||||
JS::GCPtr<WritableStreamDefaultWriter> m_writer;
|
||||
GC::Ptr<WritableStreamDefaultWriter> m_writer;
|
||||
|
||||
// https://streams.spec.whatwg.org/#writablestream-writerequests
|
||||
// A list of promises representing the stream’s internal queue of write requests not yet processed by the underlying sink
|
||||
SinglyLinkedList<JS::NonnullGCPtr<WebIDL::Promise>> m_write_requests;
|
||||
SinglyLinkedList<GC::Ref<WebIDL::Promise>> m_write_requests;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue