mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 02:03:06 -05:00
f87041bf3a
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
43 lines
1.1 KiB
C++
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;
|
|
};
|
|
|
|
}
|