mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Add FetchContext as HostDefined JS::GraphLoadingState field
This patch adds FetchContext as the type to be used in the HostDefined slot of JS::GraphLoadingState in web script fetching.
This commit is contained in:
parent
c3b02ae65a
commit
5b1d0d4d1b
Notes:
sideshowbarker
2024-07-17 07:48:42 +09:00
Author: https://github.com/networkException
Commit: 5b1d0d4d1b
Pull-request: https://github.com/SerenityOS/serenity/pull/21700
Issue: https://github.com/SerenityOS/serenity/issues/21009
Reviewed-by: https://github.com/awesomekling
1 changed files with 15 additions and 0 deletions
|
@ -46,6 +46,21 @@ struct ScriptFetchOptions {
|
|||
// https://html.spec.whatwg.org/multipage/webappapis.html#default-classic-script-fetch-options
|
||||
ScriptFetchOptions default_classic_script_fetch_options();
|
||||
|
||||
struct FetchContext : JS::GraphLoadingState::HostDefined {
|
||||
FetchContext(JS::GCPtr<JS::Value> parse_error, Fetch::Infrastructure::Request::Destination destination, JS::GCPtr<JS::Promise> perform_fetch, EnvironmentSettingsObject& fetch_client)
|
||||
: parse_error(parse_error)
|
||||
, destination(destination)
|
||||
, perform_fetch(perform_fetch)
|
||||
, fetch_client(fetch_client)
|
||||
{
|
||||
}
|
||||
|
||||
JS::GCPtr<JS::Value> parse_error; // [[ParseError]]
|
||||
Fetch::Infrastructure::Request::Destination destination; // [[Destination]]
|
||||
JS::GCPtr<JS::Promise> perform_fetch; // [[PerformFetch]]
|
||||
EnvironmentSettingsObject& fetch_client; // [[FetchClient]]
|
||||
};
|
||||
|
||||
DeprecatedString module_type_from_module_request(JS::ModuleRequest const&);
|
||||
WebIDL::ExceptionOr<AK::URL> resolve_module_specifier(Optional<Script&> referring_script, DeprecatedString const& specifier);
|
||||
WebIDL::ExceptionOr<Optional<AK::URL>> resolve_imports_match(DeprecatedString const& normalized_specifier, Optional<AK::URL> as_url, ModuleSpecifierMap const&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue