예제 #1
0
void IDBCursor::close()
{
    // The notifier may be the last reference to this cursor.
    RefPtrWillBeRawPtr<IDBCursor> protect(this);
    handleBlobAcks();
    m_request.clear();
    m_backend.clear();
}
예제 #2
0
ScriptValue IDBRequest::result(ExceptionState& exceptionState)
{
    if (m_readyState != DONE) {
        exceptionState.throwDOMException(InvalidStateError, IDBDatabase::requestNotFinishedErrorMessage);
        return ScriptValue();
    }
    if (m_contextStopped || !executionContext())
        return ScriptValue();
    m_resultDirty = false;
    ScriptValue value = idbAnyToScriptValue(m_scriptState.get(), m_result);
    handleBlobAcks();
    return value;
}
예제 #3
0
void IDBCursor::checkForReferenceCycle()
{
    // If this cursor and its request have the only references
    // to each other, then explicitly break the cycle.
    if (!m_request || m_request->getResultCursor() != this)
        return;

    if (!hasOneRef() || !m_request->hasOneRef())
        return;

    handleBlobAcks();
    m_request.clear();
}
예제 #4
0
void IDBCursor::setValueReady(IDBKey* key, IDBKey* primaryKey, PassRefPtr<SharedBuffer> value, PassOwnPtr<Vector<blink::WebBlobInfo> > blobInfo)
{
    m_key = key;
    m_keyDirty = true;

    m_primaryKey = primaryKey;
    m_primaryKeyDirty = true;

    if (isCursorWithValue()) {
        m_value = value;
        handleBlobAcks();
        m_blobInfo = blobInfo;
        m_valueDirty = true;
    }

    m_gotValue = true;
}
예제 #5
0
ScriptValue IDBCursor::value(ScriptState* scriptState)
{
    ASSERT(isCursorWithValue());

    IDBObjectStore* objectStore = effectiveObjectStore();
    const IDBObjectStoreMetadata& metadata = objectStore->metadata();
    IDBAny* value;
    if (metadata.autoIncrement && !metadata.keyPath.isNull()) {
        value = IDBAny::create(m_value, m_blobInfo.get(), m_primaryKey, metadata.keyPath);
#ifndef NDEBUG
        assertPrimaryKeyValidOrInjectable(scriptState, m_value, m_blobInfo.get(), m_primaryKey, metadata.keyPath);
#endif
    } else {
        value = IDBAny::create(m_value, m_blobInfo.get());
    }

    m_valueDirty = false;
    ScriptValue scriptValue = idbAnyToScriptValue(scriptState, value);
    handleBlobAcks();
    return scriptValue;
}
예제 #6
0
void IDBRequest::dispose()
{
    handleBlobAcks();
}
예제 #7
0
IDBCursor::~IDBCursor()
{
    handleBlobAcks();
}
예제 #8
0
void IDBCursor::close()
{
    handleBlobAcks();
    m_request.clear();
    m_backend.clear();
}
예제 #9
0
IDBRequest::~IDBRequest()
{
    ASSERT(m_readyState == DONE || m_readyState == EarlyDeath || !executionContext());
    handleBlobAcks();
}