1
0
Fork 0
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:
Linus Groh 2021-04-03 15:11:36 +02:00 committed by Andreas Kling
parent 975b209b9b
commit 000ef96613
Notes: sideshowbarker 2024-07-18 20:52:01 +09:00
8 changed files with 42 additions and 39 deletions

View file

@ -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);