#include "config.h"
#include "StorageEvent.h"
#include "Storage.h"
namespace WebCore {
Ref<StorageEvent> StorageEvent::createForBindings()
{
return adoptRef(*new StorageEvent);
}
StorageEvent::StorageEvent()
{
}
StorageEvent::~StorageEvent()
{
}
Ref<StorageEvent> StorageEvent::create(const AtomicString& 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 AtomicString& type, const Init& initializer, IsTrusted isTrusted)
{
return adoptRef(*new StorageEvent(type, initializer, isTrusted));
}
StorageEvent::StorageEvent(const AtomicString& type, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea)
: Event(type, false, false)
, m_key(key)
, m_oldValue(oldValue)
, m_newValue(newValue)
, m_url(url)
, m_storageArea(storageArea)
{
}
StorageEvent::StorageEvent(const AtomicString& 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 AtomicString& type, bool canBubble, bool cancelable, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea)
{
if (dispatched())
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;
}
}