mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
LibWeb: Wire up XHR::ontimeout event
This commit is contained in:
parent
92a3803066
commit
445c3050d4
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.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 {
|
||||
TODO();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue