mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 17:40:27 +00:00
LibWeb: Make factory method of XHR::ProgressEvent fallible
This commit is contained in:
parent
35622606c1
commit
84c7af4dcb
Notes:
sideshowbarker
2024-07-17 06:28:38 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/84c7af4dcb Pull-request: https://github.com/SerenityOS/serenity/pull/17491 Reviewed-by: https://github.com/linusg ✅
3 changed files with 6 additions and 6 deletions
|
@ -9,12 +9,12 @@
|
|||
|
||||
namespace Web::XHR {
|
||||
|
||||
ProgressEvent* ProgressEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, ProgressEventInit const& event_init)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<ProgressEvent>> ProgressEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, ProgressEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<ProgressEvent>(realm, realm, event_name, event_init).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
return MUST_OR_THROW_OOM(realm.heap().allocate<ProgressEvent>(realm, realm, event_name, event_init));
|
||||
}
|
||||
|
||||
ProgressEvent* ProgressEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, ProgressEventInit const& event_init)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<ProgressEvent>> ProgressEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, ProgressEventInit const& event_init)
|
||||
{
|
||||
return create(realm, event_name, event_init);
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@ class ProgressEvent final : public DOM::Event {
|
|||
WEB_PLATFORM_OBJECT(ProgressEvent, DOM::Event);
|
||||
|
||||
public:
|
||||
static ProgressEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, ProgressEventInit const& event_init);
|
||||
static ProgressEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, ProgressEventInit const& event_init);
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<ProgressEvent>> create(JS::Realm&, DeprecatedFlyString const& event_name, ProgressEventInit const& event_init);
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<ProgressEvent>> construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, ProgressEventInit const& event_init);
|
||||
|
||||
virtual ~ProgressEvent() override;
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ void XMLHttpRequest::fire_progress_event(DeprecatedString const& event_name, u64
|
|||
event_init.length_computable = true;
|
||||
event_init.loaded = transmitted;
|
||||
event_init.total = length;
|
||||
dispatch_event(*ProgressEvent::create(realm(), event_name, event_init));
|
||||
dispatch_event(*ProgressEvent::create(realm(), event_name, event_init).release_value_but_fixme_should_propagate_errors());
|
||||
}
|
||||
|
||||
// https://xhr.spec.whatwg.org/#dom-xmlhttprequest-responsetext
|
||||
|
|
Loading…
Reference in a new issue