#include "config.h"
#include "StorageEvent.h"
#include "Storage.h"
#include <wtf/IsoMallocInlines.h>
namespace WebCore {
WTF_MAKE_ISO_ALLOCATED_IMPL(StorageEvent);
Ref<StorageEvent> StorageEvent::createForBindings()
{
return adoptRef(*new StorageEvent);
}
StorageEvent::StorageEvent() = default;
StorageEvent::~StorageEvent() = default;
Ref<StorageEvent> StorageEvent::create(const AtomString& type, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea)
{
return adoptRef(*new StorageEvent(type, key, oldValue, newValue, url, storageArea));
}
Ref<StorageEvent> StorageEvent::create(const AtomString& type, const Init& initializer, IsTrusted isTrusted)
{
return adoptRef(*new StorageEvent(type, initializer, isTrusted));
}
StorageEvent::StorageEvent(const AtomString& type, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea)
: Event(type, CanBubble::No, IsCancelable::No)
, m_key(key)
, m_oldValue(oldValue)
, m_newValue(newValue)
, m_url(url)
, m_storageArea(storageArea)
{
}
StorageEvent::StorageEvent(const AtomString& type, const Init& initializer, IsTrusted isTrusted)
: Event(type, initializer, isTrusted)
, m_key(initializer.key)
, m_oldValue(initializer.oldValue)
, m_newValue(initializer.newValue)
, m_url(initializer.url)
, m_storageArea(initializer.storageArea)
{
}
void StorageEvent::initStorageEvent(const AtomString& type, bool canBubble, bool cancelable, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea)
{
if (isBeingDispatched())
return;
initEvent(type, canBubble, cancelable);
m_key = key;
m_oldValue = oldValue;
m_newValue = newValue;
m_url = url;
m_storageArea = storageArea;
}
EventInterface StorageEvent::eventInterface() const
{
return StorageEventInterfaceType;
}
}