void StorageArea::clear(ExceptionState& exceptionState, LocalFrame* frame) { if (!canAccessStorage(frame)) { exceptionState.throwSecurityError("access is denied for this document."); return; } m_storageArea->clear(frame->document()->url()); }
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); }
void StorageAreaImpl::removeItem(const String& key, ExceptionCode& ec, Frame* frame) { ec = 0; if (!canAccessStorage(frame)) { ec = SECURITY_ERR; return; } ASSERT(!m_isShutdown); blockUntilImportComplete(); if (disabledByPrivateBrowsingInFrame(frame)) return; String oldValue; RefPtr<StorageMap> newMap = m_storageMap->removeItem(key, oldValue); if (newMap) m_storageMap = newMap.release(); if (oldValue.isNull()) return; if (m_storageAreaSync) m_storageAreaSync->scheduleItemForSync(key, String()); StorageEventDispatcher::dispatch(key, oldValue, String(), m_storageType, m_securityOrigin.get(), frame); }
bool StorageArea::contains(const String& key, ExceptionState& exceptionState, LocalFrame* frame) { if (!canAccessStorage(frame)) { exceptionState.throwSecurityError("access is denied for this document."); return false; } return !getItem(key, exceptionState, frame).isNull(); }
unsigned StorageArea::length(ExceptionState& exceptionState, LocalFrame* frame) { if (!canAccessStorage(frame)) { exceptionState.throwSecurityError("access is denied for this document."); return 0; } return m_storageArea->length(); }
bool StorageAreaProxy::contains(const String& key, ExceptionCode& ec, Frame* frame) { if (!canAccessStorage(frame)) { ec = SECURITY_ERR; return false; } return !getItem(key, ec, frame).isNull(); }
String StorageArea::key(unsigned index, ExceptionState& exceptionState, LocalFrame* frame) { if (!canAccessStorage(frame)) { exceptionState.throwSecurityError("access is denied for this document."); return String(); } return m_storageArea->key(index); }
String StorageArea::getItem(const String& key, ExceptionState& exceptionState, LocalFrame* frame) { if (!canAccessStorage(frame)) { exceptionState.throwSecurityError("access is denied for this document."); return String(); } return m_storageArea->getItem(key); }
void StorageArea::removeItem(const String& key, ExceptionState& exceptionState, LocalFrame* frame) { if (!canAccessStorage(frame)) { exceptionState.throwSecurityError("access is denied for this document."); return; } m_storageArea->removeItem(key, frame->document()->url()); }
String StorageAreaProxy::getItem(const String& key, ExceptionCode& ec, Frame* frame) { if (!canAccessStorage(frame)) { ec = SECURITY_ERR; return String(); } ec = 0; return m_storageArea->getItem(key); }
String StorageAreaProxy::key(unsigned index, ExceptionCode& ec, Frame* frame) { if (!canAccessStorage(frame)) { ec = SECURITY_ERR; return String(); } ec = 0; return m_storageArea->key(index); }
unsigned StorageAreaProxy::length(ExceptionCode& ec, Frame* frame) { if (!canAccessStorage(frame)) { ec = SECURITY_ERR; return 0; } ec = 0; return m_storageArea->length(); }
void StorageAreaProxy::clear(ExceptionCode& ec, Frame* frame) { if (!canAccessStorage(frame)) { ec = SECURITY_ERR; return; } ec = 0; m_storageArea->clear(frame->document()->url()); }
void StorageAreaProxy::removeItem(const String& key, ExceptionCode& ec, Frame* frame) { if (!canAccessStorage(frame)) { ec = SECURITY_ERR; return; } ec = 0; m_storageArea->removeItem(key, frame->document()->url()); }
void StorageAreaProxy::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame) { if (!canAccessStorage(frame)) { ec = SECURITY_ERR; return; } WebKit::WebStorageArea::Result result = WebKit::WebStorageArea::ResultOK; m_storageArea->setItem(key, value, frame->document()->url(), result); ec = (result == WebKit::WebStorageArea::ResultOK) ? 0 : QUOTA_EXCEEDED_ERR; }
String StorageAreaProxy::removeItem(const String& key, Frame* frame) { if (!canAccessStorage(frame)) return String(); WebKit::WebString oldValue; m_storageArea->removeItem(key, frame->document()->url(), oldValue); if (!oldValue.isNull()) storageEvent(key, oldValue, String(), m_storageType, frame->document()->securityOrigin(), frame); return oldValue; }
bool StorageAreaProxy::clear(Frame* frame) { if (!canAccessStorage(frame)) return false; bool clearedSomething; m_storageArea->clear(frame->document()->url(), clearedSomething); if (clearedSomething) storageEvent(String(), String(), String(), m_storageType, frame->document()->securityOrigin(), frame); return clearedSomething; }
void StorageArea::setItem(const String& key, const String& value, ExceptionState& exceptionState, LocalFrame* frame) { if (!canAccessStorage(frame)) { exceptionState.throwSecurityError("access is denied for this document."); return; } WebStorageArea::Result result = WebStorageArea::ResultOK; m_storageArea->setItem(key, value, frame->document()->url(), result); if (result != WebStorageArea::ResultOK) exceptionState.throwDOMException(QuotaExceededError, "Setting the value of '" + key + "' exceeded the quota."); }
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); }
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(); }
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); }
String StorageAreaProxy::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame) { WebKit::WebStorageArea::Result result = WebKit::WebStorageArea::ResultOK; WebKit::WebString oldValue; if (!canAccessStorage(frame)) ec = QUOTA_EXCEEDED_ERR; else { m_storageArea->setItem(key, value, frame->document()->url(), result, oldValue); ec = (result == WebKit::WebStorageArea::ResultOK) ? 0 : QUOTA_EXCEEDED_ERR; String oldValueString = oldValue; if (oldValueString != value && result == WebKit::WebStorageArea::ResultOK) storageEvent(key, oldValue, value, m_storageType, frame->document()->securityOrigin(), frame); } return oldValue; }
unsigned StorageAreaImpl::length(ExceptionCode& ec, Frame* frame) const { ec = 0; if (!canAccessStorage(frame)) { ec = SECURITY_ERR; return 0; } if (disabledByPrivateBrowsingInFrame(frame)) return 0; ASSERT(!m_isShutdown); blockUntilImportComplete(); return m_storageMap->length(); }
String StorageAreaImpl::key(unsigned index, ExceptionCode& ec, Frame* frame) const { ec = 0; if (!canAccessStorage(frame)) { ec = SECURITY_ERR; return String(); } if (disabledByPrivateBrowsingInFrame(frame)) return String(); ASSERT(!m_isShutdown); blockUntilImportComplete(); return m_storageMap->key(index); }
bool StorageAreaImpl::contains(const String& key, ExceptionCode& ec, Frame* frame) const { ec = 0; if (!canAccessStorage(frame)) { ec = SECURITY_ERR; return false; } if (disabledByPrivateBrowsingInFrame(frame)) return false; ASSERT(!m_isShutdown); blockUntilImportComplete(); return m_storageMap->contains(key); }
void StorageAreaImpl::clear(ExceptionCode& ec, Frame* frame) { ec = 0; if (!canAccessStorage(frame)) { ec = SECURITY_ERR; return; } ASSERT(!m_isShutdown); blockUntilImportComplete(); if (disabledByPrivateBrowsingInFrame(frame)) return; if (!m_storageMap->length()) return; unsigned quota = m_storageMap->quota(); m_storageMap = StorageMap::create(quota); if (m_storageAreaSync) m_storageAreaSync->scheduleClear(); StorageEventDispatcher::dispatch(String(), String(), String(), m_storageType, m_securityOrigin.get(), frame); }
String StorageAreaProxy::getItem(const String& key, Frame* frame) const { if (canAccessStorage(frame)) return m_storageArea->getItem(key); return String(); }
String StorageAreaProxy::key(unsigned index, Frame* frame) const { if (canAccessStorage(frame)) return m_storageArea->key(index); return String(); }
unsigned StorageAreaProxy::length(Frame* frame) const { if (canAccessStorage(frame)) return m_storageArea->length(); return 0; }