コード例 #1
0
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());
}
コード例 #2
0
ファイル: StorageAreaProxy.cpp プロジェクト: jbat100/webkit
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);
}
コード例 #3
0
ファイル: StorageAreaImpl.cpp プロジェクト: dog-god/iptv
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);
}
コード例 #4
0
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();
}
コード例 #5
0
unsigned StorageArea::length(ExceptionState& exceptionState, LocalFrame* frame)
{
    if (!canAccessStorage(frame)) {
        exceptionState.throwSecurityError("access is denied for this document.");
        return 0;
    }
    return m_storageArea->length();
}
コード例 #6
0
bool StorageAreaProxy::contains(const String& key, ExceptionCode& ec, Frame* frame)
{
    if (!canAccessStorage(frame)) {
        ec = SECURITY_ERR;
        return false;
    }
    return !getItem(key, ec, frame).isNull();
}
コード例 #7
0
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);
}
コード例 #8
0
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);
}
コード例 #9
0
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());
}
コード例 #10
0
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);
}
コード例 #11
0
String StorageAreaProxy::key(unsigned index, ExceptionCode& ec, Frame* frame)
{
    if (!canAccessStorage(frame)) {
        ec = SECURITY_ERR;
        return String();
    }
    ec = 0;
    return m_storageArea->key(index);
}
コード例 #12
0
unsigned StorageAreaProxy::length(ExceptionCode& ec, Frame* frame)
{
    if (!canAccessStorage(frame)) {
        ec = SECURITY_ERR;
        return 0;
    }
    ec = 0;
    return m_storageArea->length();
}
コード例 #13
0
void StorageAreaProxy::clear(ExceptionCode& ec, Frame* frame)
{
    if (!canAccessStorage(frame)) {
        ec = SECURITY_ERR;
        return;
    }
    ec = 0;
    m_storageArea->clear(frame->document()->url());
}
コード例 #14
0
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());
}
コード例 #15
0
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;
}
コード例 #16
0
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;
}
コード例 #17
0
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;
}
コード例 #18
0
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.");
}
コード例 #19
0
ファイル: StorageAreaProxy.cpp プロジェクト: jbat100/webkit
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);
}
コード例 #20
0
ファイル: StorageAreaProxy.cpp プロジェクト: jbat100/webkit
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();
}
コード例 #21
0
ファイル: StorageAreaProxy.cpp プロジェクト: jbat100/webkit
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);
}
コード例 #22
0
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;
}
コード例 #23
0
ファイル: StorageAreaImpl.cpp プロジェクト: dog-god/iptv
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();
}
コード例 #24
0
ファイル: StorageAreaImpl.cpp プロジェクト: dog-god/iptv
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);
}
コード例 #25
0
ファイル: StorageAreaImpl.cpp プロジェクト: dog-god/iptv
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);
}
コード例 #26
0
ファイル: StorageAreaImpl.cpp プロジェクト: dog-god/iptv
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);
}
コード例 #27
0
String StorageAreaProxy::getItem(const String& key, Frame* frame) const
{
    if (canAccessStorage(frame))
        return m_storageArea->getItem(key);
    return String();
}
コード例 #28
0
String StorageAreaProxy::key(unsigned index, Frame* frame) const
{
    if (canAccessStorage(frame))
        return m_storageArea->key(index);
    return String();
}
コード例 #29
0
unsigned StorageAreaProxy::length(Frame* frame) const
{
    if (canAccessStorage(frame))
        return m_storageArea->length();
    return 0;
}