mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Wire up XHR::ontimeout event
This commit is contained in:
parent
92a3803066
commit
445c3050d4
Notes:
sideshowbarker
2024-07-18 02:47:59 +09:00
Author: https://github.com/kennethmyhra
Commit: 445c3050d4
Pull-request: https://github.com/SerenityOS/serenity/pull/14460
Reviewed-by: https://github.com/linusg ✅
1 changed files with 8 additions and 1 deletions
|
@ -638,7 +638,14 @@ DOM::ExceptionOr<void> XMLHttpRequest::send(String body)
|
||||||
xhr.set_status(status_code.value_or(0));
|
xhr.set_status(status_code.value_or(0));
|
||||||
xhr.dispatch_event(DOM::Event::create(HTML::EventNames::error));
|
xhr.dispatch_event(DOM::Event::create(HTML::EventNames::error));
|
||||||
},
|
},
|
||||||
m_timeout);
|
m_timeout,
|
||||||
|
[weak_this = make_weak_ptr()] {
|
||||||
|
auto strong_this = weak_this.strong_ref();
|
||||||
|
if (!strong_this)
|
||||||
|
return;
|
||||||
|
auto& xhr = const_cast<XMLHttpRequest&>(*strong_this);
|
||||||
|
xhr.dispatch_event(DOM::Event::create(EventNames::timeout));
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
TODO();
|
TODO();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue