mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:57:34 +00:00
LibWeb: Add spec comments and links to XHR members
This commit is contained in:
parent
04eaff3bb4
commit
338ada66fa
1 changed files with 69 additions and 11 deletions
|
@ -83,34 +83,92 @@ private:
|
||||||
|
|
||||||
explicit XMLHttpRequest(HTML::Window&);
|
explicit XMLHttpRequest(HTML::Window&);
|
||||||
|
|
||||||
|
// Non-standard
|
||||||
JS::NonnullGCPtr<HTML::Window> m_window;
|
JS::NonnullGCPtr<HTML::Window> m_window;
|
||||||
|
|
||||||
State m_state { State::Unsent };
|
|
||||||
Fetch::Infrastructure::Status m_status { 0 };
|
Fetch::Infrastructure::Status m_status { 0 };
|
||||||
bool m_send { false };
|
|
||||||
u32 m_timeout { 0 };
|
|
||||||
|
|
||||||
String m_method;
|
|
||||||
AK::URL m_url;
|
|
||||||
|
|
||||||
Bindings::XMLHttpRequestResponseType m_response_type;
|
|
||||||
|
|
||||||
HashMap<String, String, CaseInsensitiveStringTraits> m_request_headers;
|
|
||||||
HashMap<String, String, CaseInsensitiveStringTraits> m_response_headers;
|
HashMap<String, String, CaseInsensitiveStringTraits> m_response_headers;
|
||||||
|
|
||||||
|
// https://xhr.spec.whatwg.org/#concept-xmlhttprequest-state
|
||||||
|
// state
|
||||||
|
// One of unsent, opened, headers received, loading, and done; initially unsent.
|
||||||
|
State m_state { State::Unsent };
|
||||||
|
|
||||||
|
// https://xhr.spec.whatwg.org/#send-flag
|
||||||
|
// send() flag
|
||||||
|
// A flag, initially unset.
|
||||||
|
bool m_send { false };
|
||||||
|
|
||||||
|
// https://xhr.spec.whatwg.org/#timeout
|
||||||
|
// timeout
|
||||||
|
// An unsigned integer, initially 0.
|
||||||
|
u32 m_timeout { 0 };
|
||||||
|
|
||||||
|
// FIXME: https://xhr.spec.whatwg.org/#cross-origin-credentials
|
||||||
|
|
||||||
|
// https://xhr.spec.whatwg.org/#request-method
|
||||||
|
// request method
|
||||||
|
// A method.
|
||||||
|
String m_method;
|
||||||
|
|
||||||
|
// https://xhr.spec.whatwg.org/#request-url
|
||||||
|
// request URL
|
||||||
|
// A URL.
|
||||||
|
AK::URL m_url;
|
||||||
|
|
||||||
|
// https://xhr.spec.whatwg.org/#author-request-headers
|
||||||
|
// author request headers
|
||||||
|
// A header list, initially empty.
|
||||||
|
HashMap<String, String, CaseInsensitiveStringTraits> m_request_headers;
|
||||||
|
|
||||||
|
// FIXME: https://xhr.spec.whatwg.org/#request-body
|
||||||
|
|
||||||
|
// https://xhr.spec.whatwg.org/#synchronous-flag
|
||||||
|
// synchronous flag
|
||||||
|
// A flag, initially unset.
|
||||||
bool m_synchronous { false };
|
bool m_synchronous { false };
|
||||||
|
|
||||||
|
// https://xhr.spec.whatwg.org/#upload-complete-flag
|
||||||
|
// upload complete flag
|
||||||
|
// A flag, initially unset.
|
||||||
bool m_upload_complete { false };
|
bool m_upload_complete { false };
|
||||||
|
|
||||||
|
// https://xhr.spec.whatwg.org/#upload-listener-flag
|
||||||
|
// upload listener flag
|
||||||
|
// A flag, initially unset.
|
||||||
bool m_upload_listener { false };
|
bool m_upload_listener { false };
|
||||||
|
|
||||||
|
// https://xhr.spec.whatwg.org/#timed-out-flag
|
||||||
|
// timed out flag
|
||||||
|
// A flag, initially unset.
|
||||||
bool m_timed_out { false };
|
bool m_timed_out { false };
|
||||||
|
|
||||||
|
// FIXME: https://xhr.spec.whatwg.org/#response
|
||||||
|
|
||||||
|
// https://xhr.spec.whatwg.org/#received-bytes
|
||||||
|
// received bytes
|
||||||
|
// A byte sequence, initially the empty byte sequence.
|
||||||
ByteBuffer m_received_bytes;
|
ByteBuffer m_received_bytes;
|
||||||
|
|
||||||
|
// https://xhr.spec.whatwg.org/#response-type
|
||||||
|
// response type
|
||||||
|
// One of the empty string, "arraybuffer", "blob", "document", "json", and "text"; initially the empty string.
|
||||||
|
Bindings::XMLHttpRequestResponseType m_response_type;
|
||||||
|
|
||||||
enum class Failure {
|
enum class Failure {
|
||||||
/// ????
|
/// ????
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// https://xhr.spec.whatwg.org/#response-object
|
||||||
|
// response object
|
||||||
|
// An object, failure, or null, initially null.
|
||||||
Variant<JS::Value, Failure, Empty> m_response_object;
|
Variant<JS::Value, Failure, Empty> m_response_object;
|
||||||
|
|
||||||
|
// FIXME: https://xhr.spec.whatwg.org/#xmlhttprequest-fetch-controller
|
||||||
|
|
||||||
// https://xhr.spec.whatwg.org/#override-mime-type
|
// https://xhr.spec.whatwg.org/#override-mime-type
|
||||||
|
// override MIME type
|
||||||
|
// A MIME type or null, initially null.
|
||||||
|
// NOTE: Can get a value when overrideMimeType() is invoked.
|
||||||
Optional<MimeSniff::MimeType> m_override_mime_type;
|
Optional<MimeSniff::MimeType> m_override_mime_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue