/src/serenity/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2022, Andreas Kling <kling@serenityos.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #include <LibWeb/Bindings/Intrinsics.h> |
8 | | #include <LibWeb/Bindings/ProgressEventPrototype.h> |
9 | | #include <LibWeb/XHR/ProgressEvent.h> |
10 | | |
11 | | namespace Web::XHR { |
12 | | |
13 | | JS_DEFINE_ALLOCATOR(ProgressEvent); |
14 | | |
15 | | JS::NonnullGCPtr<ProgressEvent> ProgressEvent::create(JS::Realm& realm, FlyString const& event_name, ProgressEventInit const& event_init) |
16 | 0 | { |
17 | 0 | return realm.heap().allocate<ProgressEvent>(realm, realm, event_name, event_init); |
18 | 0 | } |
19 | | |
20 | | WebIDL::ExceptionOr<JS::NonnullGCPtr<ProgressEvent>> ProgressEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, ProgressEventInit const& event_init) |
21 | 0 | { |
22 | 0 | return create(realm, event_name, event_init); |
23 | 0 | } |
24 | | |
25 | | ProgressEvent::ProgressEvent(JS::Realm& realm, FlyString const& event_name, ProgressEventInit const& event_init) |
26 | 0 | : Event(realm, event_name, event_init) |
27 | 0 | , m_length_computable(event_init.length_computable) |
28 | 0 | , m_loaded(event_init.loaded) |
29 | 0 | , m_total(event_init.total) |
30 | 0 | { |
31 | 0 | } |
32 | | |
33 | 0 | ProgressEvent::~ProgressEvent() = default; |
34 | | |
35 | | void ProgressEvent::initialize(JS::Realm& realm) |
36 | 0 | { |
37 | 0 | Base::initialize(realm); |
38 | 0 | WEB_SET_PROTOTYPE_FOR_INTERFACE(ProgressEvent); |
39 | 0 | } |
40 | | |
41 | | } |