#ifndef IDBVersionChangeEvent_h
#define IDBVersionChangeEvent_h
#include "bindings/v8/Nullable.h"
#include "bindings/v8/SerializedScriptValue.h"
#include "core/events/Event.h"
#include "modules/indexeddb/IDBAny.h"
#include "modules/indexeddb/IDBRequest.h"
#include "public/platform/WebIDBTypes.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefPtr.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
struct IDBVersionChangeEventInit : public EventInit {
IDBVersionChangeEventInit();
unsigned long long oldVersion;
Nullable<unsigned long long> newVersion;
};
class IDBVersionChangeEvent FINAL : public Event {
public:
static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create()
{
return adoptRefWillBeNoop(new IDBVersionChangeEvent());
}
static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create(const AtomicString& eventType, unsigned long long oldVersion, const Nullable<unsigned long long>& newVersion, blink::WebIDBDataLoss dataLoss = blink::WebIDBDataLossNone, const String& dataLossMessage = String())
{
return adoptRefWillBeNoop(new IDBVersionChangeEvent(eventType, oldVersion, newVersion, dataLoss, dataLossMessage));
}
static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create(const AtomicString& eventType, const IDBVersionChangeEventInit& initializer)
{
return adoptRefWillBeNoop(new IDBVersionChangeEvent(eventType, initializer));
}
unsigned long long oldVersion() const { return m_oldVersion; }
unsigned long long newVersion(bool& isNull) const;
const AtomicString& dataLoss() const;
const String& dataLossMessage() const { return m_dataLossMessage; }
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual void trace(Visitor*) OVERRIDE;
private:
IDBVersionChangeEvent();
IDBVersionChangeEvent(const AtomicString& eventType, unsigned long long oldVersion, const Nullable<unsigned long long>& newVersion, blink::WebIDBDataLoss, const String& dataLoss);
IDBVersionChangeEvent(const AtomicString& eventType, const IDBVersionChangeEventInit&);
unsigned long long m_oldVersion;
Nullable<unsigned long long> m_newVersion;
bool m_dataLoss;
String m_dataLossMessage;
};
}
#endif