mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
LibWeb: Pass optional status code to ResourceLoader callbacks
This is needed for XMLHttpRequest, and will certainly be useful for other things, too.
This commit is contained in:
parent
975b209b9b
commit
000ef96613
Notes:
sideshowbarker
2024-07-18 20:52:01 +09:00
Author: https://github.com/linusg
Commit: 000ef96613
Pull-request: https://github.com/SerenityOS/serenity/pull/6090
8 changed files with 42 additions and 39 deletions
|
@ -228,7 +228,7 @@ DOM::ExceptionOr<void> XMLHttpRequest::send()
|
|||
// we need to make ResourceLoader give us more detailed updates than just "done" and "error".
|
||||
ResourceLoader::the().load(
|
||||
request,
|
||||
[weak_this = make_weak_ptr()](auto data, auto&) {
|
||||
[weak_this = make_weak_ptr()](auto data, auto&, auto) {
|
||||
if (!weak_this)
|
||||
return;
|
||||
auto& xhr = const_cast<XMLHttpRequest&>(*weak_this);
|
||||
|
@ -248,7 +248,7 @@ DOM::ExceptionOr<void> XMLHttpRequest::send()
|
|||
xhr.fire_progress_event(EventNames::load, transmitted, length);
|
||||
xhr.fire_progress_event(EventNames::loadend, transmitted, length);
|
||||
},
|
||||
[weak_this = make_weak_ptr()](auto& error) {
|
||||
[weak_this = make_weak_ptr()](auto& error, auto) {
|
||||
if (!weak_this)
|
||||
return;
|
||||
dbgln("XHR failed to load: {}", error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue