void StorageAreaProxy::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* sourceFrame) { ec = 0; if (!canAccessStorage(sourceFrame)) { ec = SECURITY_ERR; return; } ASSERT(!value.isNull()); if (disabledByPrivateBrowsingInFrame(sourceFrame)) { ec = QUOTA_EXCEEDED_ERR; return; } loadValuesIfNeeded(); ASSERT(m_storageMap->hasOneRef()); String oldValue; bool quotaException; m_storageMap->setItem(key, value, oldValue, quotaException); if (quotaException) { ec = QUOTA_EXCEEDED_ERR; return; } if (oldValue == value) return; m_pendingValueChanges.add(key); WebProcess::shared().connection()->send(Messages::StorageManager::SetItem(m_storageAreaID, key, value, sourceFrame->document()->url()), 0); }
String StorageAreaProxy::getItem(const String& key, ExceptionCode& ec, Frame* sourceFrame) { ec = 0; if (!canAccessStorage(sourceFrame)) { ec = SECURITY_ERR; return String(); } if (disabledByPrivateBrowsingInFrame(sourceFrame)) return String(); loadValuesIfNeeded(); return m_storageMap->getItem(key); }
String StorageAreaProxy::key(unsigned index, ExceptionCode& ec, Frame* sourceFrame) { ec = 0; if (!canAccessStorage(sourceFrame)) { ec = SECURITY_ERR; return String(); } if (disabledByPrivateBrowsingInFrame(sourceFrame)) return String(); loadValuesIfNeeded(); return m_storageMap->key(index); }
unsigned StorageAreaProxy::length(ExceptionCode& ec, Frame* sourceFrame) { ec = 0; if (!canAccessStorage(sourceFrame)) { ec = SECURITY_ERR; return 0; } if (disabledByPrivateBrowsingInFrame(sourceFrame)) return 0; loadValuesIfNeeded(); return m_storageMap->length(); }
void StorageAreaMap::removeItem(WebCore::Frame* sourceFrame, StorageAreaImpl* sourceArea, const String& key) { loadValuesIfNeeded(); ASSERT(m_storageMap->hasOneRef()); String oldValue; m_storageMap->removeItem(key, oldValue); if (oldValue.isNull()) return; m_pendingValueChanges.add(key); WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::RemoveItem(m_storageMapID, sourceArea->storageAreaID(), m_currentSeed, key, sourceFrame->document()->url()), 0); }
void StorageAreaMap::setItem(Frame* sourceFrame, StorageAreaImpl* sourceArea, const String& key, const String& value, bool& quotaException) { loadValuesIfNeeded(); ASSERT(m_storageMap->hasOneRef()); String oldValue; quotaException = false; m_storageMap->setItem(key, value, oldValue, quotaException); if (quotaException) return; if (oldValue == value) return; m_pendingValueChanges.add(key); WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::SetItem(m_storageMapID, sourceArea->storageAreaID(), m_currentSeed, key, value, sourceFrame->document()->url()), 0); }
unsigned StorageAreaMap::length() { loadValuesIfNeeded(); return m_storageMap->length(); }
bool StorageAreaMap::contains(const String& key) { loadValuesIfNeeded(); return m_storageMap->contains(key); }
String StorageAreaMap::item(const String& key) { loadValuesIfNeeded(); return m_storageMap->getItem(key); }
String StorageAreaMap::key(unsigned index) { loadValuesIfNeeded(); return m_storageMap->key(index); }