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); }
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); }
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); }
void SessionStorageArea::areaCleared(Frame* sourceFrame) { dispatchStorageEvent(String(), String(), String(), sourceFrame); }
void SessionStorageArea::itemRemoved(const String& key, const String& oldValue, Frame* sourceFrame) { dispatchStorageEvent(key, oldValue, String(), sourceFrame); }
void SessionStorageArea::itemChanged(const String& key, const String& oldValue, const String& newValue, Frame* sourceFrame) { dispatchStorageEvent(key, oldValue, newValue, sourceFrame); }