This source file includes following definitions.
- supplementName
- from
- storageQuota
- webkitTemporaryStorage
- webkitPersistentStorage
- storageQuota
- webkitTemporaryStorage
- webkitPersistentStorage
- trace
#include "config.h"
#include "modules/quota/NavigatorStorageQuota.h"
#include "core/frame/Navigator.h"
#include "modules/quota/DeprecatedStorageQuota.h"
#include "modules/quota/StorageQuota.h"
namespace WebCore {
NavigatorStorageQuota::NavigatorStorageQuota(LocalFrame* frame)
: DOMWindowProperty(frame)
{
}
NavigatorStorageQuota::~NavigatorStorageQuota()
{
}
const char* NavigatorStorageQuota::supplementName()
{
return "NavigatorStorageQuota";
}
NavigatorStorageQuota& NavigatorStorageQuota::from(Navigator& navigator)
{
NavigatorStorageQuota* supplement = static_cast<NavigatorStorageQuota*>(WillBeHeapSupplement<Navigator>::from(navigator, supplementName()));
if (!supplement) {
supplement = new NavigatorStorageQuota(navigator.frame());
provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
}
return *supplement;
}
StorageQuota* NavigatorStorageQuota::storageQuota(Navigator& navigator)
{
return NavigatorStorageQuota::from(navigator).storageQuota();
}
DeprecatedStorageQuota* NavigatorStorageQuota::webkitTemporaryStorage(Navigator& navigator)
{
return NavigatorStorageQuota::from(navigator).webkitTemporaryStorage();
}
DeprecatedStorageQuota* NavigatorStorageQuota::webkitPersistentStorage(Navigator& navigator)
{
return NavigatorStorageQuota::from(navigator).webkitPersistentStorage();
}
StorageQuota* NavigatorStorageQuota::storageQuota() const
{
if (!m_storageQuota && frame())
m_storageQuota = StorageQuota::create();
return m_storageQuota.get();
}
DeprecatedStorageQuota* NavigatorStorageQuota::webkitTemporaryStorage() const
{
if (!m_temporaryStorage && frame())
m_temporaryStorage = DeprecatedStorageQuota::create(DeprecatedStorageQuota::Temporary);
return m_temporaryStorage.get();
}
DeprecatedStorageQuota* NavigatorStorageQuota::webkitPersistentStorage() const
{
if (!m_persistentStorage && frame())
m_persistentStorage = DeprecatedStorageQuota::create(DeprecatedStorageQuota::Persistent);
return m_persistentStorage.get();
}
void NavigatorStorageQuota::trace(Visitor* visitor)
{
visitor->trace(m_storageQuota);
visitor->trace(m_temporaryStorage);
visitor->trace(m_persistentStorage);
}
}