|
@@ -47,7 +47,7 @@ public:
|
|
[[nodiscard]] static NonnullOwnPtr<Response> aborted_network_error();
|
|
[[nodiscard]] static NonnullOwnPtr<Response> aborted_network_error();
|
|
[[nodiscard]] static NonnullOwnPtr<Response> network_error();
|
|
[[nodiscard]] static NonnullOwnPtr<Response> network_error();
|
|
|
|
|
|
- Response() = default;
|
|
|
|
|
|
+ Response();
|
|
virtual ~Response() = default;
|
|
virtual ~Response() = default;
|
|
|
|
|
|
[[nodiscard]] virtual Type type() const { return m_type; }
|
|
[[nodiscard]] virtual Type type() const { return m_type; }
|
|
@@ -66,9 +66,9 @@ public:
|
|
[[nodiscard]] virtual ReadonlyBytes status_message() const { return m_status_message; }
|
|
[[nodiscard]] virtual ReadonlyBytes status_message() const { return m_status_message; }
|
|
void set_status_message(ByteBuffer status_message) { m_status_message = move(status_message); }
|
|
void set_status_message(ByteBuffer status_message) { m_status_message = move(status_message); }
|
|
|
|
|
|
- [[nodiscard]] virtual HeaderList const& header_list() const { return m_header_list; }
|
|
|
|
- [[nodiscard]] HeaderList& header_list() { return m_header_list; }
|
|
|
|
- void set_header_list(HeaderList header_list) { m_header_list = move(header_list); }
|
|
|
|
|
|
+ [[nodiscard]] virtual NonnullRefPtr<HeaderList> const& header_list() const { return m_header_list; }
|
|
|
|
+ [[nodiscard]] NonnullRefPtr<HeaderList>& header_list() { return m_header_list; }
|
|
|
|
+ void set_header_list(NonnullRefPtr<HeaderList> header_list) { m_header_list = move(header_list); }
|
|
|
|
|
|
[[nodiscard]] virtual Optional<Body> const& body() const { return m_body; }
|
|
[[nodiscard]] virtual Optional<Body> const& body() const { return m_body; }
|
|
[[nodiscard]] Optional<Body>& body() { return m_body; }
|
|
[[nodiscard]] Optional<Body>& body() { return m_body; }
|
|
@@ -124,7 +124,7 @@ private:
|
|
|
|
|
|
// https://fetch.spec.whatwg.org/#concept-response-header-list
|
|
// https://fetch.spec.whatwg.org/#concept-response-header-list
|
|
// A response has an associated header list (a header list). Unless stated otherwise it is empty.
|
|
// A response has an associated header list (a header list). Unless stated otherwise it is empty.
|
|
- HeaderList m_header_list;
|
|
|
|
|
|
+ NonnullRefPtr<HeaderList> m_header_list;
|
|
|
|
|
|
// https://fetch.spec.whatwg.org/#concept-response-body
|
|
// https://fetch.spec.whatwg.org/#concept-response-body
|
|
// A response has an associated body (null or a body). Unless stated otherwise it is null.
|
|
// A response has an associated body (null or a body). Unless stated otherwise it is null.
|
|
@@ -169,7 +169,7 @@ public:
|
|
[[nodiscard]] virtual Vector<AK::URL> const& url_list() const override { return m_internal_response.url_list(); }
|
|
[[nodiscard]] virtual Vector<AK::URL> const& url_list() const override { return m_internal_response.url_list(); }
|
|
[[nodiscard]] virtual Status status() const override { return m_internal_response.status(); }
|
|
[[nodiscard]] virtual Status status() const override { return m_internal_response.status(); }
|
|
[[nodiscard]] virtual ReadonlyBytes status_message() const override { return m_internal_response.status_message(); }
|
|
[[nodiscard]] virtual ReadonlyBytes status_message() const override { return m_internal_response.status_message(); }
|
|
- [[nodiscard]] virtual HeaderList const& header_list() const override { return m_internal_response.header_list(); }
|
|
|
|
|
|
+ [[nodiscard]] virtual NonnullRefPtr<HeaderList> const& header_list() const override { return m_internal_response.header_list(); }
|
|
[[nodiscard]] virtual Optional<Body> const& body() const override { return m_internal_response.body(); }
|
|
[[nodiscard]] virtual Optional<Body> const& body() const override { return m_internal_response.body(); }
|
|
[[nodiscard]] virtual Optional<CacheState> const& cache_state() const override { return m_internal_response.cache_state(); }
|
|
[[nodiscard]] virtual Optional<CacheState> const& cache_state() const override { return m_internal_response.cache_state(); }
|
|
[[nodiscard]] virtual Vector<ByteBuffer> const& cors_exposed_header_name_list() const override { return m_internal_response.cors_exposed_header_name_list(); }
|
|
[[nodiscard]] virtual Vector<ByteBuffer> const& cors_exposed_header_name_list() const override { return m_internal_response.cors_exposed_header_name_list(); }
|
|
@@ -192,12 +192,12 @@ public:
|
|
static ErrorOr<NonnullOwnPtr<BasicFilteredResponse>> create(Response&);
|
|
static ErrorOr<NonnullOwnPtr<BasicFilteredResponse>> create(Response&);
|
|
|
|
|
|
[[nodiscard]] virtual Type type() const override { return Type::Basic; }
|
|
[[nodiscard]] virtual Type type() const override { return Type::Basic; }
|
|
- [[nodiscard]] virtual HeaderList const& header_list() const override { return m_header_list; }
|
|
|
|
|
|
+ [[nodiscard]] virtual NonnullRefPtr<HeaderList> const& header_list() const override { return m_header_list; }
|
|
|
|
|
|
private:
|
|
private:
|
|
- BasicFilteredResponse(Response&, HeaderList);
|
|
|
|
|
|
+ BasicFilteredResponse(Response&, NonnullRefPtr<HeaderList>);
|
|
|
|
|
|
- HeaderList m_header_list;
|
|
|
|
|
|
+ NonnullRefPtr<HeaderList> m_header_list;
|
|
};
|
|
};
|
|
|
|
|
|
// https://fetch.spec.whatwg.org/#concept-filtered-response-cors
|
|
// https://fetch.spec.whatwg.org/#concept-filtered-response-cors
|
|
@@ -206,12 +206,12 @@ public:
|
|
static ErrorOr<NonnullOwnPtr<CORSFilteredResponse>> create(Response&);
|
|
static ErrorOr<NonnullOwnPtr<CORSFilteredResponse>> create(Response&);
|
|
|
|
|
|
[[nodiscard]] virtual Type type() const override { return Type::CORS; }
|
|
[[nodiscard]] virtual Type type() const override { return Type::CORS; }
|
|
- [[nodiscard]] virtual HeaderList const& header_list() const override { return m_header_list; }
|
|
|
|
|
|
+ [[nodiscard]] virtual NonnullRefPtr<HeaderList> const& header_list() const override { return m_header_list; }
|
|
|
|
|
|
private:
|
|
private:
|
|
- CORSFilteredResponse(Response&, HeaderList);
|
|
|
|
|
|
+ CORSFilteredResponse(Response&, NonnullRefPtr<HeaderList>);
|
|
|
|
|
|
- HeaderList m_header_list;
|
|
|
|
|
|
+ NonnullRefPtr<HeaderList> m_header_list;
|
|
};
|
|
};
|
|
|
|
|
|
// https://fetch.spec.whatwg.org/#concept-filtered-response-opaque
|
|
// https://fetch.spec.whatwg.org/#concept-filtered-response-opaque
|
|
@@ -223,14 +223,14 @@ public:
|
|
[[nodiscard]] virtual Vector<AK::URL> const& url_list() const override { return m_url_list; }
|
|
[[nodiscard]] virtual Vector<AK::URL> const& url_list() const override { return m_url_list; }
|
|
[[nodiscard]] virtual Status status() const override { return 0; }
|
|
[[nodiscard]] virtual Status status() const override { return 0; }
|
|
[[nodiscard]] virtual ReadonlyBytes status_message() const override { return {}; }
|
|
[[nodiscard]] virtual ReadonlyBytes status_message() const override { return {}; }
|
|
- [[nodiscard]] virtual HeaderList const& header_list() const override { return m_header_list; }
|
|
|
|
|
|
+ [[nodiscard]] virtual NonnullRefPtr<HeaderList> const& header_list() const override { return m_header_list; }
|
|
[[nodiscard]] virtual Optional<Body> const& body() const override { return m_body; }
|
|
[[nodiscard]] virtual Optional<Body> const& body() const override { return m_body; }
|
|
|
|
|
|
private:
|
|
private:
|
|
explicit OpaqueFilteredResponse(Response&);
|
|
explicit OpaqueFilteredResponse(Response&);
|
|
|
|
|
|
Vector<AK::URL> m_url_list;
|
|
Vector<AK::URL> m_url_list;
|
|
- HeaderList m_header_list;
|
|
|
|
|
|
+ NonnullRefPtr<HeaderList> m_header_list;
|
|
Optional<Body> m_body;
|
|
Optional<Body> m_body;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -242,13 +242,13 @@ public:
|
|
[[nodiscard]] virtual Type type() const override { return Type::OpaqueRedirect; }
|
|
[[nodiscard]] virtual Type type() const override { return Type::OpaqueRedirect; }
|
|
[[nodiscard]] virtual Status status() const override { return 0; }
|
|
[[nodiscard]] virtual Status status() const override { return 0; }
|
|
[[nodiscard]] virtual ReadonlyBytes status_message() const override { return {}; }
|
|
[[nodiscard]] virtual ReadonlyBytes status_message() const override { return {}; }
|
|
- [[nodiscard]] virtual HeaderList const& header_list() const override { return m_header_list; }
|
|
|
|
|
|
+ [[nodiscard]] virtual NonnullRefPtr<HeaderList> const& header_list() const override { return m_header_list; }
|
|
[[nodiscard]] virtual Optional<Body> const& body() const override { return m_body; }
|
|
[[nodiscard]] virtual Optional<Body> const& body() const override { return m_body; }
|
|
|
|
|
|
private:
|
|
private:
|
|
explicit OpaqueRedirectFilteredResponse(Response&);
|
|
explicit OpaqueRedirectFilteredResponse(Response&);
|
|
|
|
|
|
- HeaderList m_header_list;
|
|
|
|
|
|
+ NonnullRefPtr<HeaderList> m_header_list;
|
|
Optional<Body> m_body;
|
|
Optional<Body> m_body;
|
|
};
|
|
};
|
|
|
|
|