ladybird/Libraries/LibWeb/IndexedDB/IDBVersionChangeEvent.h
Shannon Booth f87041bf3a LibGC+Everywhere: Factor out a LibGC from LibJS
Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:

 * JS::NonnullGCPtr -> GC::Ref
 * JS::GCPtr -> GC::Ptr
 * JS::HeapFunction -> GC::Function
 * JS::CellImpl -> GC::Cell
 * JS::Handle -> GC::Root
2024-11-15 14:49:20 +01:00

43 lines
1.1 KiB
C++

/*
* Copyright (c) 2024, stelar7 <dudedbz@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibGC/Ptr.h>
#include <LibWeb/DOM/Event.h>
#include <LibWeb/Forward.h>
namespace Web::IndexedDB {
struct IDBVersionChangeEventInit : public DOM::EventInit {
u64 old_version { 0 };
Optional<u64> new_version;
};
// https://w3c.github.io/IndexedDB/#events
class IDBVersionChangeEvent : public DOM::Event {
WEB_PLATFORM_OBJECT(IDBVersionChangeEvent, DOM::Event);
GC_DECLARE_ALLOCATOR(IDBVersionChangeEvent);
public:
virtual ~IDBVersionChangeEvent() override;
static GC::Ref<IDBVersionChangeEvent> create(JS::Realm&, FlyString const&, IDBVersionChangeEventInit const&);
u64 old_version() const { return m_old_version; }
Optional<u64> new_version() const { return m_new_version; }
protected:
explicit IDBVersionChangeEvent(JS::Realm&, FlyString const& event_name, IDBVersionChangeEventInit const& event_init);
virtual void initialize(JS::Realm&) override;
private:
u64 m_old_version { 0 };
Optional<u64> m_new_version;
};
}