예제 #1
0
void StorageAreaImpl::clear(Frame* sourceFrame)
{
    ASSERT(!m_isShutdown);
    blockUntilImportComplete();

    if (!m_storageMap->length())
        return;

    unsigned quota = m_storageMap->quota();
    m_storageMap = StorageMap::create(quota);

    if (m_storageAreaSync)
        m_storageAreaSync->scheduleClear();

    dispatchStorageEvent(String(), String(), String(), sourceFrame);
}
예제 #2
0
void StorageAreaImpl::removeItem(Frame* sourceFrame, const String& key)
{
    ASSERT(!m_isShutdown);
    blockUntilImportComplete();

    String oldValue;
    auto newMap = m_storageMap->removeItem(key, oldValue);
    if (newMap)
        m_storageMap = WTFMove(newMap);

    if (oldValue.isNull())
        return;

    if (m_storageAreaSync)
        m_storageAreaSync->scheduleItemForSync(key, String());

    dispatchStorageEvent(key, oldValue, String(), sourceFrame);
}
예제 #3
0
void StorageAreaImpl::setItem(Frame* sourceFrame, const String& key, const String& value, bool& quotaException)
{
    ASSERT(!m_isShutdown);
    ASSERT(!value.isNull());
    blockUntilImportComplete();

    String oldValue;
    auto newMap = m_storageMap->setItem(key, value, oldValue, quotaException);
    if (newMap)
        m_storageMap = WTFMove(newMap);

    if (quotaException)
        return;

    if (oldValue == value)
        return;

    if (m_storageAreaSync)
        m_storageAreaSync->scheduleItemForSync(key, value);

    dispatchStorageEvent(key, oldValue, value, sourceFrame);
}
예제 #4
0
void SessionStorageArea::areaCleared(Frame* sourceFrame)
{
    dispatchStorageEvent(String(), String(), String(), sourceFrame);
}
예제 #5
0
void SessionStorageArea::itemRemoved(const String& key, const String& oldValue, Frame* sourceFrame)
{
    dispatchStorageEvent(key, oldValue, String(), sourceFrame);
}
예제 #6
0
void SessionStorageArea::itemChanged(const String& key, const String& oldValue, const String& newValue, Frame* sourceFrame)
{
    dispatchStorageEvent(key, oldValue, newValue, sourceFrame);
}